1 Star 0 Fork 98

余诗/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Export-all-variables-from-the-initial-context-when-c.patch 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Tue, 22 Jan 2019 15:40:25 +0100
Subject: [PATCH] Export all variables from the initial context when creating a
submenu
When a submenu is created, only the exported variables are copied to the
new menu context. But we want the variables to be global, so export lets
export all variables to the new created submenu.
Also, don't unset the default variable when a new submenu is created.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
grub-core/normal/context.c | 2 +-
grub-core/normal/menu.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/grub-core/normal/context.c b/grub-core/normal/context.c
index ee53d4a68e5..87edd254c44 100644
--- a/grub-core/normal/context.c
+++ b/grub-core/normal/context.c
@@ -99,7 +99,7 @@ grub_env_new_context (int export_all)
grub_err_t
grub_env_context_open (void)
{
- return grub_env_new_context (0);
+ return grub_env_new_context (1);
}
int grub_extractor_level = 0;
diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index 4a02aadb01c..fe2e77a43e2 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -375,8 +375,6 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot)
if (ptr && ptr[0] && ptr[1])
grub_env_set ("default", ptr + 1);
- else
- grub_env_unset ("default");
grub_script_execute_new_scope (entry->sourcecode, entry->argc, entry->args);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yushi-Icy/grub2.git
[email protected]:yushi-Icy/grub2.git
yushi-Icy
grub2
grub2
master

搜索帮助