weak-modules: add support for zstd compression for initramfs
* weak-modules (decompress_initramfs): Rewrite decompressing of initramfs into a loop that iterates over different compression programs, include zstd in the list. * kmod.spec (Release): Bump to 11. (%changelog): Add a record. Resolves: RHEL-74288 Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
parent
ec1e060e0a
commit
9c37c7f5d4
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
Name: kmod
|
Name: kmod
|
||||||
Version: 31
|
Version: 31
|
||||||
Release: 10%{?dist}
|
Release: 11%{?dist}
|
||||||
Summary: Linux kernel module management utilities
|
Summary: Linux kernel module management utilities
|
||||||
|
|
||||||
# https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis
|
# https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis
|
||||||
@ -196,6 +196,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
|
|||||||
%{_libdir}/libkmod.so
|
%{_libdir}/libkmod.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 14 2025 Eugene Syromiatnikov <esyr@redhat.com> - 31-11
|
||||||
|
- Enable zstd compression support for initramfs in weak-modules
|
||||||
|
- Resolves: RHEL-74288
|
||||||
|
|
||||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 31-10
|
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 31-10
|
||||||
- Bump release for October 2024 mass rebuild:
|
- Bump release for October 2024 mass rebuild:
|
||||||
Resolves: RHEL-64018
|
Resolves: RHEL-64018
|
||||||
|
12
weak-modules
12
weak-modules
@ -129,6 +129,7 @@ read_modules_list() {
|
|||||||
decompress_initramfs() {
|
decompress_initramfs() {
|
||||||
local input=$1
|
local input=$1
|
||||||
local output=$2
|
local output=$2
|
||||||
|
local zcmd
|
||||||
|
|
||||||
# First, check if this is compressed at all
|
# First, check if this is compressed at all
|
||||||
if cpio -i -t < "$input" > /dev/null 2>/dev/null; then
|
if cpio -i -t < "$input" > /dev/null 2>/dev/null; then
|
||||||
@ -146,15 +147,12 @@ decompress_initramfs() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try gzip
|
# Try zstd/xz/gzip for decompressing
|
||||||
if gzip -cd < "$input" > "$output" 2>/dev/null ; then
|
for zcmd in zstd xz gzip; do
|
||||||
return 0
|
if "$zcmd" -cd < "$input" > "$output" 2>/dev/null ; then
|
||||||
fi
|
|
||||||
|
|
||||||
# Next try xz
|
|
||||||
if xz -cd < "$input" > "$output" 2>/dev/null ; then
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
echo "Unable to decompress $input: Unknown format" >&2
|
echo "Unable to decompress $input: Unknown format" >&2
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user