From 96aa636698bc757f0893b016d8603dd9bb18b19b Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Tue, 16 May 2023 08:21:40 +0200 Subject: [PATCH] kabi: handle symvers.xz Check for symvers.xz support in addition to symvers.gz, due to unnanounced unilateral change[1][2] in the kernel packaging. [1] https://gitlab.com/cki-project/kernel-ark/-/commit/26446656572b8d5934f5d714b1fea76f3ed559c0 [2] https://src.fedoraproject.org/rpms/kernel/c/2db77a072a997c00ee63ddf38b79766699094f1c?branch=rawhide * kabi.attr: Add xz extension to the file matching pattern * kabi.sh: Add xz extension to the matching pattern; determine catenation program based on extension. Signed-off-by: Eugene Syromiatnikov References: https://bugzilla.redhat.com/show_bug.cgi?id=2192895 --- kabi.attr | 2 +- kabi.sh | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/kabi.attr b/kabi.attr index 2d81387..5500b17 100644 --- a/kabi.attr +++ b/kabi.attr @@ -1,2 +1,2 @@ %__kabi_provides %{_rpmconfigdir}/kabi.sh -%__kabi_path ^(/boot/symvers-.*|/lib/modules/[1-9].*/symvers)\.gz$ +%__kabi_path ^(/boot/symvers-.*|/lib/modules/[1-9].*/symvers)\.(gz|xz)$ diff --git a/kabi.sh b/kabi.sh index 3fb749b..dd49b8b 100644 --- a/kabi.sh +++ b/kabi.sh @@ -7,10 +7,16 @@ IFS=$'\n' -for symvers in $(grep -E '(/boot/symvers-.*|/lib/modules/[1-9].*/symvers)\.gz') "$@"; +for symvers in $(grep -E '(/boot/symvers-.*|/lib/modules/[1-9].*/symvers)\.(gz|xz)') "$@"; do + cat_prog="cat" + case "$symvers" in + *.gz) cat_prog="zcat" ;; + *.xz) cat_prog="xzcat" ;; + esac + # We generate dependencies only for symbols exported by vmlinux itself # and not for kmods here as they are spread across subpackages, # so Provides: generation for kmods is handled by find-provides.ksyms. - zcat $symvers | awk '/[^ ]* [^ ]* vmlinux .*/ { print "kernel(" $2 ") = " $1 }' + "$cat_prog" "$symvers" | awk '/[^ ]* [^ ]* vmlinux .*/ { print "kernel(" $2 ") = " $1 }' done