Harald Hoyer 308914
From ff366790a6e30175f243d54c2922a8c781030ede Mon Sep 17 00:00:00 2001
Harald Hoyer 308914
From: Javier Martinez Canillas <javierm@redhat.com>
Harald Hoyer 308914
Date: Tue, 5 May 2020 19:11:18 +0200
Harald Hoyer 308914
Subject: [PATCH] 51-dracut-rescue.install: Don't use BLS fragment shipped by
Harald Hoyer 308914
 kernel package
Harald Hoyer 308914
Harald Hoyer 308914
For the GRUB and zipl bootloaders the BLS fragment that is shipped by the
Harald Hoyer 308914
kernel package is used, so the same fragment is used for the rescue entry.
Harald Hoyer 308914
Harald Hoyer 308914
But there are cases where this BLS fragment is not suitable. For example,
Harald Hoyer 308914
if the boot directory is on a btrfs subvolume the path in the linux and
Harald Hoyer 308914
initrd fiels need to be adjusted with the real path. Otherwise GRUB won't
Harald Hoyer 308914
be able to read them.
Harald Hoyer 308914
Harald Hoyer 308914
The GRUB and zipl kernel-install plugins already take care of this before
Harald Hoyer 308914
installing the BLS fragments, so just copy the installed fragment that has
Harald Hoyer 308914
the updated paths instead of using the BLS shipped by the kernel package.
Harald Hoyer 308914
Harald Hoyer 308914
Resolves: rhbz#1827882
Harald Hoyer 308914
Harald Hoyer 308914
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Harald Hoyer 308914
---
Harald Hoyer 308914
 51-dracut-rescue.install | 6 +++++-
Harald Hoyer 308914
 1 file changed, 5 insertions(+), 1 deletion(-)
Harald Hoyer 308914
Harald Hoyer 308914
diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install
Harald Hoyer 308914
index b4ed1783..b2b3b9ef 100755
Harald Hoyer 308914
--- a/51-dracut-rescue.install
Harald Hoyer 308914
+++ b/51-dracut-rescue.install
Harald Hoyer 308914
@@ -106,7 +106,11 @@ case "$COMMAND" in
Harald Hoyer 308914
                 echo "initrd     $BOOT_DIR/initrd"
Harald Hoyer 308914
             } > $LOADER_ENTRY
Harald Hoyer 308914
         else
Harald Hoyer 308914
-            cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
Harald Hoyer 308914
+            if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
Harald Hoyer 308914
+                cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" $LOADER_ENTRY
Harald Hoyer 308914
+            else
Harald Hoyer 308914
+                cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
Harald Hoyer 308914
+            fi
Harald Hoyer 308914
             sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
Harald Hoyer 308914
         fi
Harald Hoyer 308914
 
Harald Hoyer 308914