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 <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2024-08-12 15:59:22 +02:00
parent 46ee314b94
commit 8fa8d8c0bc
2 changed files with 12 additions and 2 deletions

View File

@ -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 <esyr@redhat.com> - 31-7
- weak-modules: use either zcat or xzcat based on symvers file extension
- Resolves: RHEL-39388
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 31-6
- Bump release for June 2024 mass rebuild

View File

@ -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