rename installed kernel to match name used in boot entry

clone of af4f1536b6
This commit is contained in:
Dan Horák 2023-11-10 11:41:36 +01:00
parent 70bd1af9bd
commit 40db3a57ae

View File

@ -54,8 +54,13 @@ EOF
case "$COMMAND" in case "$COMMAND" in
add) add)
if [[ "${KERNEL_DIR}" != "/boot" ]]; then if [[ "${KERNEL_DIR}" != "/boot" ]]; then
# rename to match the name used in the pseudo-BLS snippet above
rm -f "/boot/vmlinuz-${KERNEL_VERSION}"
cp -aT "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}"
command -v restorecon &>/dev/null && \
restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}"
for i in \ for i in \
"$KERNEL_IMAGE" \
"$KERNEL_DIR"/System.map \ "$KERNEL_DIR"/System.map \
"$KERNEL_DIR"/config \ "$KERNEL_DIR"/config \
"$KERNEL_DIR"/zImage.stub "$KERNEL_DIR"/zImage.stub