]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
51-dracut-rescue.install: Don't use BLS fragment shipped by kernel package
authorJavier Martinez Canillas <javierm@redhat.com>
Tue, 5 May 2020 17:11:18 +0000 (19:11 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Thu, 7 May 2020 13:16:00 +0000 (15:16 +0200)
For the GRUB and zipl bootloaders the BLS fragment that is shipped by the
kernel package is used, so the same fragment is used for the rescue entry.

But there are cases where this BLS fragment is not suitable. For example,
if the boot directory is on a btrfs subvolume the path in the linux and
initrd fiels need to be adjusted with the real path. Otherwise GRUB won't
be able to read them.

The GRUB and zipl kernel-install plugins already take care of this before
installing the BLS fragments, so just copy the installed fragment that has
the updated paths instead of using the BLS shipped by the kernel package.

Resolves: rhbz#1827882

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
51-dracut-rescue.install

index b4ed1783bdba8cbd09cac3750de71b9ec8b762df..b2b3b9efeb6d6e9079ad44f90608e9f253292eac 100755 (executable)
@@ -106,7 +106,11 @@ case "$COMMAND" in
                 echo "initrd     $BOOT_DIR/initrd"
             } > $LOADER_ENTRY
         else
-            cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
+            if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
+                cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" $LOADER_ENTRY
+            else
+                cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
+            fi
             sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
         fi