Allow for xz'd symvers file

The Fedora/ARK kernel is moving to removing gzip as a dependency and
replacing it with xz.

Use xz instead of gz as an extension for the symvers file.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
This commit is contained in:
Prarit Bhargava 2022-12-04 19:41:23 -05:00
parent 81ed67d3a8
commit 78d64adfbe

View file

@ -75,6 +75,7 @@ case "$COMMAND" in
command -v restorecon &>/dev/null && \ command -v restorecon &>/dev/null && \
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac" restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
fi fi
# OLD method using gzip'd file (will be deprecated and removed in the future)
# symvers is symvers-<version>.gz symlink, needs a special treatment # symvers is symvers-<version>.gz symlink, needs a special treatment
i="$KERNEL_DIR/symvers.gz" i="$KERNEL_DIR/symvers.gz"
if [[ -e "$i" ]]; then if [[ -e "$i" ]]; then
@ -83,6 +84,14 @@ case "$COMMAND" in
command -v restorecon &>/dev/null && \ command -v restorecon &>/dev/null && \
restorecon "/boot/symvers-${KERNEL_VERSION}.gz" restorecon "/boot/symvers-${KERNEL_VERSION}.gz"
fi fi
# symvers is symvers-<version>.bz symlink, needs a special treatment
i="$KERNEL_DIR/symvers.bz"
if [[ -e "$i" ]]; then
rm -f "/boot/symvers-${KERNEL_VERSION}.bz"
ln -s "$i" "/boot/symvers-${KERNEL_VERSION}.bz"
command -v restorecon &>/dev/null && \
restorecon "/boot/symvers-${KERNEL_VERSION}.bz"
fi
fi fi
if [[ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]] || [[ ! -f /sbin/new-kernel-pkg ]]; then if [[ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]] || [[ ! -f /sbin/new-kernel-pkg ]]; then