diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 6bdad3b..7ae128c 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -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" @@ -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 @@ -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" diff --git a/test/integration/lib.sh b/test/integration/lib.sh index 036391b..84a6dc8 100644 --- a/test/integration/lib.sh +++ b/test/integration/lib.sh @@ -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