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

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