2018-07-10 19:08:14 +00:00
|
|
|
From f6531c4888e80512c40ff144399f91919e4afff2 Mon Sep 17 00:00:00 2001
|
2018-04-24 14:41:42 +00:00
|
|
|
From: Javier Martinez Canillas <javierm@redhat.com>
|
|
|
|
Date: Tue, 24 Apr 2018 02:16:38 +0200
|
2018-07-10 19:08:14 +00:00
|
|
|
Subject: [PATCH] Only attempt to query dev mounted in /boot/efi as boot dev on
|
|
|
|
EFI machines
|
2018-04-24 14:41:42 +00:00
|
|
|
|
|
|
|
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
|
2018-07-10 19:08:14 +00:00
|
|
|
index 1e7ec7071c3..13a6115056b 100644
|
2018-04-24 14:41:42 +00:00
|
|
|
--- a/util/grub.d/10_linux.in
|
|
|
|
+++ b/util/grub.d/10_linux.in
|
2018-07-10 19:08:14 +00:00
|
|
|
@@ -147,8 +147,13 @@ linux_entry ()
|
2018-04-24 14:41:42 +00:00
|
|
|
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
|