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

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