test/integration/lib.sh: combine Fedora, CentOS with RHEL dependencies

All three distributions work more or less the same, so just combine
their dependency installs.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
This commit is contained in:
Joe Lawrence 2022-05-23 08:47:18 -04:00
parent e72b876f97
commit b6abf449d6
1 changed files with 5 additions and 39 deletions

View File

@ -7,23 +7,6 @@ kpatch_set_ccache_max_size()
ccache --max-size="${ccache_max_size}" ccache --max-size="${ccache_max_size}"
} }
kpatch_fedora_dependencies()
{
local kernel_version
kernel_version=$(uname -r)
sudo dnf install -y gcc "kernel-devel-${kernel_version%.*}" elfutils elfutils-devel
sudo dnf install -y pesign yum-utils openssl wget numactl-devel
sudo dnf builddep -y "kernel-${kernel_version%.*}"
sudo dnf debuginfo-install -y "kernel-${kernel_version%.*}"
sudo dnf install -y ccache
if [[ "$(uname -m)" == "ppc64le" ]]; then
sudo yum install -y gcc-plugin-devel
fi
}
kpatch_ubuntu_dependencies() kpatch_ubuntu_dependencies()
{ {
sudo sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list sudo sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list
@ -98,29 +81,12 @@ kpatch_rhel_dependencies()
kpatch_centos_dependencies() kpatch_centos_dependencies()
{ {
local kernel_version kpatch_rhel_dependencies
local arch }
local rhel_major
kernel_version=$(uname -r)
arch=$(uname -m)
rhel_major=${VERSION_ID%%.*}
sudo yum install -y gcc gcc-c++ "kernel-devel-${kernel_version%.*}" elfutils elfutils-devel kpatch_fedora_dependencies()
sudo yum install -y yum-utils zlib-devel binutils-devel newt-devel \ {
python-devel perl-ExtUtils-Embed audit-libs-devel numactl-devel \ kpatch_rhel_dependencies
pciutils-devel bison ncurses-devel rpm-build java-devel pesign
sudo yum-config-manager --enable debug
sudo yum-builddep -y "kernel-${kernel_version%.*}"
sudo debuginfo-install -y "kernel-${kernel_version%.*}"
# ccache
if ! command -v ccache &> /dev/null; then
if ! sudo yum install -y ccache; then
sudo yum install -y "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${rhel_major}.noarch.rpm" && \
sudo yum install -y ccache && \
sudo yum remove -y epel-release
fi
fi
} }
kpatch_openEuler_dependencies() kpatch_openEuler_dependencies()