From abe759192192e4226b87d2a1bf8ecbc012da4247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Kosti=C4=87?= Date: Tue, 20 Oct 2026 10:56:39 +0200 Subject: [PATCH 1/2] kpatch-build, lib.sh, man: add kernel variant support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add kpatch-build kernel variant argument (e.g., 64k , rt-64k), and integration tests. This effort adds support for RHEL-derived distributions. Signed-off-by: Marko Kostić --- kpatch-build/kpatch-build | 17 ++++++++++++++++- man/kpatch-build.1 | 3 +++ test/integration/lib.sh | 14 ++++++++++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 67871a7ba..94373bcb4 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -781,6 +781,7 @@ usage() { echo " -r, --sourcerpm Specify kernel source RPM" >&2 echo " -s, --sourcedir Specify kernel source directory" >&2 echo " -c, --config Specify kernel config file" >&2 + echo " -V, --variant Specify kernel variant" >&2 echo " -v, --vmlinux Specify original vmlinux" >&2 echo " -j, --jobs Specify the number of make jobs" >&2 echo " -t, --target Specify custom kernel build targets" >&2 @@ -803,7 +804,7 @@ if ! command -v gawk &> /dev/null; then die "gawk not installed" fi -options="$(getopt -o ha:r:s:c:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace,version" -- "$@")" || die "getopt failed" +options="$(getopt -o ha:r:s:c:V:v:j:t:n:o:dR -l "help,archversion:,sourcerpm:,sourcedir:,config:,variant:,vmlinux:,jobs:,target:,name:,output:,oot-module:,oot-module-src:,debug,skip-gcc-check,skip-compiler-check,skip-cleanup,non-replace,version" -- "$@")" || die "getopt failed" eval set -- "$options" @@ -832,6 +833,10 @@ while [[ $# -gt 0 ]]; do CONFIGFILE="$(readlink -f "$2")" shift ;; + -V|--variant) + VARIANT="$2" + shift + ;; -v|--vmlinux) [[ ! -f "$2" ]] && die "vmlinux file '$2' not found" VMLINUX="$(readlink -f "$2")" @@ -927,6 +932,10 @@ if [[ -n "$SRCRPM" ]]; then ARCHVERSION="${ARCHVERSION#kernel-}" ARCHVERSION="${ARCHVERSION#alt-}" ARCHVERSION="${ARCHVERSION#linux-}" + + if [[ -n "$VARIANT" ]]; then + ARCHVERSION="${ARCHVERSION}+${VARIANT//-/_}" + fi fi if [[ -n "$OOT_MODULE" ]] && [[ -z "$OOT_MODULE_SRCDIR" ]]; then @@ -999,6 +1008,10 @@ if [[ "$ARCHVERSION" =~ - ]]; then KREL="${KREL%.*}" fi +if [[ -z "$VARIANT" ]] && [[ "$ARCHVERSION" =~ \+(.*)$ ]]; then + VARIANT="${BASH_REMATCH[1]//_/-}" +fi + [[ "$ARCHVERSION" =~ .el7a. ]] && ALT="-alt" [[ -z "$TARGETS" ]] && TARGETS="vmlinux modules" @@ -1113,6 +1126,8 @@ else [[ -z "$CONFIGFILE" ]] && CONFIGFILE="/boot/config-${ARCHVERSION}" elif [[ "$DISTRO" = photon ]]; then [[ -z "$CONFIGFILE" ]] && CONFIGFILE="$KERNEL_SRCDIR"/.config + elif [[ -n "$VARIANT" ]]; then + [[ -z "$CONFIGFILE" ]] && CONFIGFILE="$KERNEL_SRCDIR/configs/kernel$ALT-$KVER-$ARCH-$VARIANT.config" else [[ -z "$CONFIGFILE" ]] && CONFIGFILE="$KERNEL_SRCDIR/configs/kernel$ALT-$KVER-$ARCH.config" fi diff --git a/man/kpatch-build.1 b/man/kpatch-build.1 index f0e4d7d6b..e234f9f0b 100644 --- a/man/kpatch-build.1 +++ b/man/kpatch-build.1 @@ -28,6 +28,9 @@ effect. -c|--config Specify kernel config file +-V|--variant + Specify kernel variant + -v|--vmlinux Specify original vmlinux diff --git a/test/integration/lib.sh b/test/integration/lib.sh index 2331fe626..511a6ead4 100644 --- a/test/integration/lib.sh +++ b/test/integration/lib.sh @@ -42,10 +42,16 @@ kpatch_rhel_dependencies() local arch local rhel_major local yum_utils_version + local variant kernel_version=$(uname -r) arch=$(uname -m) rhel_major=${VERSION_ID%%.*} + # Detect kernel (e.g., +64k , +rt_64k) + if [[ "$kernel_version" =~ \+(.*)$ ]]; then + variant="${BASH_REMATCH[1]//_/-}" + fi + # kpatch-build dependencies sudo yum install -y \ elfutils \ @@ -53,19 +59,19 @@ kpatch_rhel_dependencies() gcc \ gcc-c++ \ git \ - "kernel-devel-${kernel_version%.*}" \ + "kernel${variant:+-$variant}-devel-${kernel_version%.*}" \ rpm-build \ wget \ yum-utils - sudo debuginfo-install -y "kernel-${kernel_version%.*}" + sudo debuginfo-install -y "kernel${variant:+-$variant}-${kernel_version%.*}" [[ "$arch" == "ppc64le" ]] && sudo yum install -y gcc-plugin-devel # kernel dependencies yum_utils_version=$(rpm -q --queryformat="%{version}" yum-utils) if [[ "${yum_utils_version}" = "$(echo -e "${yum_utils_version}\\n4.0.12" | sort -rV | head -n1)" ]]; then - sudo yum-builddep -y --skip-unavailable "kernel-${kernel_version%.*}" + sudo yum-builddep -y --skip-unavailable "kernel${variant:+-$variant}-${kernel_version%.*}" else - sudo yum-builddep -y "kernel-${kernel_version%.*}" + sudo yum-builddep -y "kernel${variant:+-$variant}-${kernel_version%.*}" fi [[ "$arch" == "x86_64" ]] && sudo yum install -y pesign From 1b7888cd8735e09df4579df8ff9805132ec55529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Kosti=C4=87?= Date: Wed, 21 Oct 2026 14:05:36 +0200 Subject: [PATCH 2/2] .packit.yml: add kernel-64k-aarch64 integration test case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marko Kostić --- .packit.yml | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.packit.yml b/.packit.yml index e92051093..5d09828d3 100644 --- a/.packit.yml +++ b/.packit.yml @@ -47,8 +47,22 @@ _: skip_build: true manual_trigger: false tmt_plan: kpatch-integration-rhel/kernel$ - fmf_url: https://gitlab.com/redhat/centos-stream/tests/kernel/test-plans.git - fmf_ref: main + fmf_url: https://gitlab.com/mkostic1/test-plans.git + fmf_ref: aarch64-64k-page-support + + common-rhel-64k-test-config: &common-rhel-64k-test-config + job: tests + branch: master + identifier: "integration-rhel-64k" + use_internal_tf: true + targets: + rhel+epel-10-aarch64: + distros: [RHEL-10.3-Nightly] + skip_build: true + manual_trigger: false + tmt_plan: kpatch-integration-rhel/kernel-64k + fmf_url: https://gitlab.com/mkostic1/test-plans.git + fmf_ref: aarch64-64k-page-support jobs: - <<: *common-upstream-kernel-test-config @@ -70,3 +84,12 @@ jobs: trigger: commit labels: - integration-commit + + - <<: *common-rhel-64k-test-config + trigger: pull_request + labels: + - integration-pr + - <<: *common-rhel-64k-test-config + trigger: commit + labels: + - integration-commit