1 Star 0 Fork 50

Meredith/grub2

forked from src-anolis-os/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0315-blscfg-Always-look-for-BLS-snippets-in-the-root-devi.patch 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:15 . update to grub2-2.02-120.el8.src.rpm
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Tue, 11 Aug 2020 13:16:39 +0200
Subject: [PATCH] blscfg: Always look for BLS snippets in the root device
The blscfg command trying to load the BLS snippets from different devices
is a left over from when these where located in the ESP in the EFI case.
But now that are always located in the /boot directory, the BLS snippets
have to be loaded from the root device just like the other files that are
in the /boot directory (kernel and initrd images).
This only worked for legacy BIOS because the boot and root variables were
set to the same value. But doesn't work when trying to use a common GRUB
config file that could be shared between an EFI and legacy BIOS install.
That kind of configuration is needed for example on hybrid images that are
booted using either EFI or legacy BIOS firmwares.
Resolves: rhbz#1850193
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
grub-core/commands/blscfg.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index c92e1c845..70ce5c7bf 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -874,14 +874,12 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED,
#ifdef GRUB_MACHINE_EMU
devid = "host";
-#elif defined(GRUB_MACHINE_EFI)
+#else
devid = grub_env_get ("root");
-#else
- devid = grub_env_get ("boot");
#endif
if (!devid)
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
- N_("variable `%s' isn't set"), "boot");
+ N_("variable `%s' isn't set"), "root");
grub_dprintf ("blscfg", "opening %s\n", devid);
dev = grub_device_open (devid);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yueeranna/grub2.git
git@gitee.com:yueeranna/grub2.git
yueeranna
grub2
grub2
a8

搜索帮助

0d507c66 1850385 C8b1a773 1850385