From e8e6235eaba6267efcddd75ea0b2cc65a119ba50 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 3 Apr 2018 13:35:42 -0400 Subject: [PATCH] Fix for BLS paths on BIOS / non-UEFI (javierm) Signed-off-by: Peter Jones --- ...scan-different-BLS-directories-on-EF.patch | 49 +++++++++++++++++++ grub.patches | 1 + grub2.spec | 5 +- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 0216-Only-attempt-to-scan-different-BLS-directories-on-EF.patch diff --git a/0216-Only-attempt-to-scan-different-BLS-directories-on-EF.patch b/0216-Only-attempt-to-scan-different-BLS-directories-on-EF.patch new file mode 100644 index 0000000..329df51 --- /dev/null +++ b/0216-Only-attempt-to-scan-different-BLS-directories-on-EF.patch @@ -0,0 +1,49 @@ +From 62b3c9bf77feda2ae595c5e811b3918d3bf990a4 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 3 Apr 2018 15:42:47 +0200 +Subject: [PATCH 216/216] Only attempt to scan different BLS directories on EFI + machines + +Current BLS support attempted to scan for BLS directories, but this only +makes sense on EFI, where BLS fragments are in /loader/$vendor/entries. + +For BIOS, only either the default /loader/entries path should be scanned +or the BLS directory defined in the blsdir GRUB 2 environment variable. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/commands/blscfg.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index e5617c3bc6c..c0973ff83ea 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -676,8 +676,8 @@ static int find_entry (const char *filename, + const char *devid = grub_env_get ("boot"); + + grub_dprintf("blscfg", "%s got here\n", __func__); +- if (!grub_strcmp (filename, ".") || +- !grub_strcmp (filename, "..")) ++ if (filename && (!grub_strcmp (filename, ".") || ++ !grub_strcmp (filename, ".."))) + return 0; + + if (info->platform == PLATFORM_EFI && !grub_strcasecmp (filename, "boot")) +@@ -872,11 +872,10 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED, + info.platform = PLATFORM_EMU; + grub_dprintf ("blscfg", "scanning %s%s\n", GRUB_BOOT_DEVICE, + GRUB_BLS_CONFIG_PATH); +- r = fs->dir (dev, "/boot/loader/", +- find_entry, &info); ++ find_entry(NULL, NULL, &info); + #else + grub_dprintf ("blscfg", "scanning %s\n", GRUB_BLS_CONFIG_PATH); +- r = fs->dir (dev, "/", find_entry, &info); ++ find_entry(NULL, NULL, &info); + #endif + + finish: +-- +2.15.0 + diff --git a/grub.patches b/grub.patches index be8a143..213069e 100644 --- a/grub.patches +++ b/grub.patches @@ -213,3 +213,4 @@ Patch0212: 0212-Work-around-some-minor-include-path-weirdnesses.patch Patch0213: 0213-Make-it-possible-to-enabled-build-id-sha1.patch Patch0214: 0214-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch Patch0215: 0215-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch +Patch0216: 0216-Only-attempt-to-scan-different-BLS-directories-on-EF.patch diff --git a/grub2.spec b/grub2.spec index 4398393..8eac003 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 28%{?dist} +Release: 29%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -452,6 +452,9 @@ fi %endif %changelog +* Tue Apr 03 2018 Peter Jones - 2.02-29 +- Fix for BLS paths on BIOS / non-UEFI (javierm) + * Fri Mar 16 2018 Peter Jones - 2.02-28 - Install kernel-install scripts. (javierm) - Add grub2-switch-to-blscfg