Skip to content

Commit

Permalink
Merge pull request #1372 from anatasluo/master
Browse files Browse the repository at this point in the history
kpatch-build: add support for OpenCloudOS
  • Loading branch information
joe-lawrence authored Mar 26, 2024
2 parents 4077d87 + 57936d3 commit b363972
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kpatch-build/kpatch-build
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ declare -rA SUPPORTED_DEB_DISTROS=(
["ubuntu"]="Ubuntu OS")

declare -rA SUPPORTED_RPM_DISTROS=(
["opencloudos"]="OpenCloudOS"
["anolis"]="Anolis OS"
["centos"]="CentOS"
["fedora"]="Fedora"
Expand Down Expand Up @@ -994,6 +995,8 @@ else
# openEuler has two directories with the same content after 'rpm -D'
# openEuler 21.09 has linux-* and linux-*-source while openEuler 20.03 has linux-* and linux-*-Source
mv "$RPMTOPDIR"/BUILD/kernel-*/linux-*[sS]ource "$KERNEL_SRCDIR" 2>&1 | logger || die
elif [[ "$DISTRO" = opencloudos ]]; then
mv "$RPMTOPDIR"/BUILD/kernel-*/kernel-* "$KERNEL_SRCDIR" 2>&1 | logger || die
elif [[ "$DISTRO" = photon ]]; then
# Photon has some files that are copied over during the build section of the spec file (instead of prep)
# These change occasionally, so check they exist before copying
Expand Down Expand Up @@ -1022,7 +1025,7 @@ else

echo "$ARCHVERSION" > "$VERSIONFILE" || die

if [[ "$DISTRO" = openEuler ]]; then
if [[ "$DISTRO" = openEuler ]] || [[ "$DISTRO" = opencloudos ]]; then
[[ -z "$CONFIGFILE" ]] && CONFIGFILE="/boot/config-${ARCHVERSION}"
elif [[ "$DISTRO" = photon ]]; then
[[ -z "$CONFIGFILE" ]] && CONFIGFILE="$KERNEL_SRCDIR/$SRC_CFG"
Expand Down
13 changes: 13 additions & 0 deletions test/integration/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ kpatch_photon_dependencies()
fi
}

kpatch_opencloudos_dependencies()
{
local kernel_version
local arch
kernel_version=$(uname -r)
arch=$(uname -m)
sudo yum install -y make gcc patch bison flex openssl-devel dwarves dnf-utils \
rpm-build dnf-plugins-core python3-devel openssl-devel ncurses-devel elfutils-libelf-devel
sudo yum install -y "kernel-debuginfo-${kernel_version%.*}"\
"kernel-devel-${kernel_version%.*}"
sudo yum-builddep -y "kernel-${kernel_version}*"
}

kpatch_anolis_dependencies()
{
local kernel_version
Expand Down

0 comments on commit b363972

Please sign in to comment.