nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0315-blscfg-Always-look-for-BLS-snippets-in-the-root-devi.patch

da16a7
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
da16a7
From: Javier Martinez Canillas <javierm@redhat.com>
da16a7
Date: Tue, 11 Aug 2020 13:16:39 +0200
da16a7
Subject: [PATCH] blscfg: Always look for BLS snippets in the root device
da16a7
da16a7
The blscfg command trying to load the BLS snippets from different devices
da16a7
is a left over from when these where located in the ESP in the EFI case.
da16a7
da16a7
But now that are always located in the /boot directory, the BLS snippets
da16a7
have to be loaded from the root device just like the other files that are
da16a7
in the /boot directory (kernel and initrd images).
da16a7
da16a7
This only worked for legacy BIOS because the boot and root variables were
da16a7
set to the same value. But doesn't work when trying to use a common GRUB
da16a7
config file that could be shared between an EFI and legacy BIOS install.
da16a7
da16a7
That kind of configuration is needed for example on hybrid images that are
da16a7
booted using either EFI or legacy BIOS firmwares.
da16a7
da16a7
Resolves: rhbz#1850193
da16a7
da16a7
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
da16a7
---
da16a7
 grub-core/commands/blscfg.c | 6 ++----
da16a7
 1 file changed, 2 insertions(+), 4 deletions(-)
da16a7
da16a7
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
f6e916
index c92e1c845..70ce5c7bf 100644
da16a7
--- a/grub-core/commands/blscfg.c
da16a7
+++ b/grub-core/commands/blscfg.c
da16a7
@@ -874,14 +874,12 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED,
da16a7
 
da16a7
 #ifdef GRUB_MACHINE_EMU
da16a7
   devid = "host";
da16a7
-#elif defined(GRUB_MACHINE_EFI)
da16a7
+#else
da16a7
   devid = grub_env_get ("root");
da16a7
-#else
da16a7
-  devid = grub_env_get ("boot");
da16a7
 #endif
da16a7
   if (!devid)
da16a7
     return grub_error (GRUB_ERR_FILE_NOT_FOUND,
da16a7
-		       N_("variable `%s' isn't set"), "boot");
da16a7
+		       N_("variable `%s' isn't set"), "root");
da16a7
 
da16a7
   grub_dprintf ("blscfg", "opening %s\n", devid);
da16a7
   dev = grub_device_open (devid);