1 Star 0 Fork 98

yu_boyun/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0193-blscfg-Always-use-the-root-variable-to-search-for-BL.patch 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
hanzj0122_admin 提交于 2020-07-29 20:47 . update to 2.04
From 2dba8190a3e18837d37b316e82890b60993b18e5 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Tue, 14 Jan 2020 17:41:29 +0100
Subject: [PATCH 193/220] blscfg: Always use the root variable to search for
BLS snippets
The boot and root variables are set by grub2-mkconfig to tell GRUB what
are the devices and partitions used as the EFI System Partition (ESP)
and to store the /boot directory (or used as the /boot mount point).
But the boot variable is not needed anymore, this was added because the
blscfg module used to search for the BLS snippets in the ESP, but was
later changed to always search for the BLS files in /boot even for EFI.
When doing that change, the logic was made backwards and so the boot
variable is wrongly used for legacy BIOS. This only works because this
is set to the same value as the root variable.
So the correct thing to do is to always use the root variable to search
the BLS snippets, since that is set to the partition that stores them.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
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 069db72..24e35a4 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -1018,14 +1018,12 @@ bls_load_entries (const char *path)
if (!devid) {
#ifdef GRUB_MACHINE_EMU
devid = "host";
-#elif defined(GRUB_MACHINE_EFI)
- devid = grub_env_get ("root");
#else
- devid = grub_env_get ("boot");
+ devid = grub_env_get ("root");
#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);
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yu_boyun/grub2.git
[email protected]:yu_boyun/grub2.git
yu_boyun
grub2
grub2
master

搜索帮助