grub2/0235-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch
Javier Martinez Canillas db7cf3a089
More fixes for BLS
Add some fixes for BLS parsing logic and also make 20-grub.install script
to query the relative path of the kernel and initramfs images, so BLS can
also work when /boot is not a mount point or is a btrfs subvolume.

Also pull some build fixes.

Resolves: rhbz#1588184

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-06-07 19:02:21 +02:00

44 lines
1.5 KiB
Diff

From 8afe59812e83e78564697ef8241ed4f1b3527423 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Tue, 24 Apr 2018 02:16:38 +0200
Subject: [PATCH 235/243] Only attempt to query dev mounted in /boot/efi as
boot dev on EFI machines
The 10_linux script calls grub2-probe to probe the information for the dev
mounted in /boot/efi, but this directory may not exist on non-EFI machines
which leads to the following error when generating the grub2 config file:
/usr/sbin/grub2-probe: error: failed to get canonical path of `/boot/efi/'
Instead query for the device mounted in /boot and use that as the boot dev
for non-EFI machines.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub.d/10_linux.in | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index b24bb410dc0..c2ffc77398f 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -138,8 +138,13 @@ linux_entry ()
fi
fi
- bootefi_device="`${grub_probe} --target=device /boot/efi/`"
- prepare_grub_to_access_device ${bootefi_device} boot
+ if [ -d /sys/firmware/efi ]; then
+ bootefi_device="`${grub_probe} --target=device /boot/efi/`"
+ prepare_grub_to_access_device ${bootefi_device} boot
+ else
+ boot_device="`${grub_probe} --target=device /boot/`"
+ prepare_grub_to_access_device ${boot_device} boot
+ fi
cat << EOF
insmod blscfg
--
2.17.1