20-grub-install: Create a symvers.gz symbolic link

This is not needed for boot, just a symlink would be enough for
tools that expect this file to be present in the boot directory.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2021-06-21 08:08:10 +02:00
parent 485dd93ff1
commit a02c397786
No known key found for this signature in database
GPG key ID: C751E590D63F3D69

View file

@ -75,6 +75,14 @@ case "$COMMAND" in
command -v restorecon &>/dev/null && \
restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
fi
# symvers is symvers-<version>.gz symlink, needs a special treatment
i="$KERNEL_DIR/symvers.gz"
if [[ -e "$i" ]]; then
rm -f "/boot/symvers-${KERNEL_VERSION}.gz"
ln -s "$i" "/boot/symvers-${KERNEL_VERSION}.gz"
command -v restorecon &>/dev/null && \
restorecon "/boot/symvers-${KERNEL_VERSION}.gz"
fi
fi
if [[ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]] || [[ ! -f /sbin/new-kernel-pkg ]]; then
@ -163,6 +171,8 @@ case "$COMMAND" in
done
# hmac is .vmlinuz-<version>.hmac so needs a special treatment
rm -f "/boot/.vmlinuz-${KERNEL_VERSION}.hmac"
# symvers is symvers-<version>.gz symlink, needs a special treatment
rm -f "/boot/symvers-${KERNEL_VERSION}.gz"
exit 0
fi