1 Star 0 Fork 71

dingwei / grub2

forked from src-openEuler / grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0201-grub-switch-to-blscfg-Only-mark-GRUB-as-BLS-supporte.patch 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
hanzj0122_admin 提交于 2020-07-29 20:47 . update to 2.04
From 96e237b59b621bcfe6f5fa888fe583def382d415 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Thu, 2 Apr 2020 11:07:24 +0200
Subject: [PATCH 201/220] grub-switch-to-blscfg: Only mark GRUB as BLS
supported if blsdir isn't set
If the user set the blsdir environemnt variable to a path that is not the
default where ostree writes the BLS snippets, the blscfg module won't be
able to parse them and can lead to not having any menu entries on boot.
So to minimize the risk of things going wrong when dropping the 15_ostree
script used by ostree to create the menu entries, only mark the bootloader
as BLS supported if the blsdir variable has not been set.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub-switch-to-blscfg.in | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
index a05a8d9..4bbed8e 100644
--- a/util/grub-switch-to-blscfg.in
+++ b/util/grub-switch-to-blscfg.in
@@ -267,8 +267,11 @@ copy_bls() {
}
# The grub2 EFI binary is not copied to the ESP as a part of an ostree
-# transaction. Make sure a grub2 version with BLS support is installed.
-if test -f /run/ostree-booted && test -d /sys/firmware/efi/efivars/; then
+# transaction. Make sure a grub2 version with BLS support is installed
+# but only do this if the blsdir is not set, to make sure that the BLS
+# parsing module will search for the BLS snippets in the default path.
+if test -f /run/ostree-booted && test -d /sys/firmware/efi/efivars && \
+ ! ${grub_editenv} - list | grep -q blsdir; then
grub_binary="$(find /usr/lib/ostree-boot/efi/EFI/${EFIDIR}/ -name grub*.efi)"
cp ${grub_binary} ${grubdir} || exit 1
# Create a hidden file to indicate that grub2 now has BLS support.
--
1.8.3.1
1
https://gitee.com/dingwei_chinamobile/grub2.git
git@gitee.com:dingwei_chinamobile/grub2.git
dingwei_chinamobile
grub2
grub2
master

搜索帮助