1 Star 0 Fork 98

周正亮/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0028-use-fw_path-prefix-when-fallback-searching-for-grub-.patch 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
Date: Wed, 19 Feb 2014 15:58:43 -0500
Subject: [PATCH] use fw_path prefix when fallback searching for grub config
When PXE booting via UEFI firmware, grub was searching for grub.cfg
in the fw_path directory where the grub application was found. If
that didn't exist, a fallback search would look for config file names
based on MAC and IP address. However, the search would look in the
prefix directory which may not be the same fw_path. This patch
changes that behavior to use the fw_path directory for the fallback
search. Only if fw_path is NULL will the prefix directory be searched.
Signed-off-by: Mark Salter <msalter@redhat.com>
---
grub-core/normal/main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index 7ca2e5400b1..02577502116 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -347,7 +347,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
char *config;
const char *prefix, *fw_path;
- fw_path = grub_env_get ("fw_path");
+ prefix = fw_path = grub_env_get ("fw_path");
if (fw_path)
{
config = grub_xasprintf ("%s/grub.cfg", fw_path);
@@ -370,7 +370,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
}
}
- prefix = grub_env_get ("prefix");
+ if (! prefix)
+ prefix = grub_env_get ("prefix");
if (prefix)
{
grub_size_t config_len;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhou-zhengliang/grub2.git
git@gitee.com:zhou-zhengliang/grub2.git
zhou-zhengliang
grub2
grub2
master

搜索帮助