1 Star 0 Fork 99

陈亚强/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0128-Only-attempt-to-scan-different-BLS-directories-on-EF.patch 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:52 . Package init
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Tue, 3 Apr 2018 15:42:47 +0200
Subject: [PATCH] Only attempt to scan different BLS directories on EFI
machines
Current BLS support attempted to scan for BLS directories, but this only
makes sense on EFI, where BLS fragments are in /loader/$vendor/entries.
For BIOS, only either the default /loader/entries path should be scanned
or the BLS directory defined in the blsdir GRUB 2 environment variable.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
grub-core/commands/blscfg.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index e0b65534af4..e775c6b8794 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -676,8 +676,8 @@ static int find_entry (const char *filename,
const char *devid = grub_env_get ("boot");
grub_dprintf("blscfg", "%s got here\n", __func__);
- if (!grub_strcmp (filename, ".") ||
- !grub_strcmp (filename, ".."))
+ if (filename && (!grub_strcmp (filename, ".") ||
+ !grub_strcmp (filename, "..")))
return 0;
if (info->platform == PLATFORM_EFI && !grub_strcasecmp (filename, "boot"))
@@ -872,11 +872,10 @@ grub_cmd_blscfg (grub_extcmd_context_t ctxt UNUSED,
info.platform = PLATFORM_EMU;
grub_dprintf ("blscfg", "scanning %s%s\n", GRUB_BOOT_DEVICE,
GRUB_BLS_CONFIG_PATH);
- r = fs->dir (dev, "/boot/loader/",
- find_entry, &info);
+ find_entry(NULL, NULL, &info);
#else
grub_dprintf ("blscfg", "scanning %s\n", GRUB_BLS_CONFIG_PATH);
- r = fs->dir (dev, "/", find_entry, &info);
+ find_entry(NULL, NULL, &info);
#endif
finish:
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaqiangchen/grub2.git
[email protected]:yaqiangchen/grub2.git
yaqiangchen
grub2
grub2
master

搜索帮助