From 78d64adfbe3cd089df8e41166c3688f026acdad1 Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Dec 05 2022 00:41:23 +0000 Subject: 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 --- diff --git a/20-grub.install b/20-grub.install index bc55a14..bb0d529 100755 --- a/20-grub.install +++ b/20-grub.install @@ -75,6 +75,7 @@ case "$COMMAND" in command -v restorecon &>/dev/null && \ restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac" fi + # OLD method using gzip'd file (will be deprecated and removed in the future) # symvers is symvers-.gz symlink, needs a special treatment i="$KERNEL_DIR/symvers.gz" if [[ -e "$i" ]]; then @@ -83,6 +84,14 @@ case "$COMMAND" in command -v restorecon &>/dev/null && \ restorecon "/boot/symvers-${KERNEL_VERSION}.gz" fi + # symvers is symvers-.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 if [[ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]] || [[ ! -f /sbin/new-kernel-pkg ]]; then