From 8fa8d8c0bcf06308bbe12f35ec2578b0668dc8a0 Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Mon, 12 Aug 2024 15:59:22 +0200 Subject: [PATCH] weak-modules: use a proper program for dumping symvers Previously it was assumed that symvers is in gzip format, which is no longer the case, so zcat was used. Dispatch based on the symvers file extension. Resolves: RHEL-39388 Signed-off-by: Eugene Syromiatnikov --- kmod.spec | 6 +++++- weak-modules | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index 1a8a2e3..e1401d1 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 31 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -193,6 +193,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Mon Aug 12 2024 Eugene Syromiatnikov - 31-7 +- weak-modules: use either zcat or xzcat based on symvers file extension +- Resolves: RHEL-39388 + * Mon Jun 24 2024 Troy Dawson - 31-6 - Bump release for June 2024 mass rebuild diff --git a/weak-modules b/weak-modules index d4ac171..76523a7 100644 --- a/weak-modules +++ b/weak-modules @@ -758,6 +758,7 @@ validate_weak_links() { # to return to caller that original proposal is not valid # here 0 is true, 1 is false, since it will be the return code local is_configuration_valid=0 + local cat_prog tmp=$(mktemp -p $tmpdir) compatible_modules=() @@ -766,7 +767,12 @@ validate_weak_links() { local symvers_path=$(find_symvers_file "$krel") [[ -n "$symvers_path" ]] || return - zcat "$symvers_path" > $tmpdir/symvers-$krel + cat_prog="cat" + case "$symvers" in + *.gz) cat_prog="zcat" ;; + *.xz) cat_prog="xzcat" ;; + esac + "$cat_prog" "$symvers_path" > $tmpdir/symvers-$krel fi while ((is_updates_changed)); do