1 Star 0 Fork 46

庞庆 / grub2

forked from src-anolis-os / grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0146-Only-attempt-to-query-dev-mounted-in-boot-efi-as-boo.patch 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:15 . update to grub2-2.02-120.el8.src.rpm
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Tue, 24 Apr 2018 02:16:38 +0200
Subject: [PATCH] Only attempt to query dev mounted in /boot/efi as boot dev on
EFI machines
The 10_linux script calls grub2-probe to probe the information for the dev
mounted in /boot/efi, but this directory may not exist on non-EFI machines
which leads to the following error when generating the grub2 config file:
/usr/sbin/grub2-probe: error: failed to get canonical path of `/boot/efi/'
Instead query for the device mounted in /boot and use that as the boot dev
for non-EFI machines.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub.d/10_linux.in | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 89cd71d85..61d0664fb 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -133,8 +133,13 @@ linux_entry ()
fi
fi
- bootefi_device="`${grub_probe} --target=device /boot/efi/`"
- prepare_grub_to_access_device ${bootefi_device} boot
+ if [ -d /sys/firmware/efi ]; then
+ bootefi_device="`${grub_probe} --target=device /boot/efi/`"
+ prepare_grub_to_access_device ${bootefi_device} boot
+ else
+ boot_device="`${grub_probe} --target=device /boot/`"
+ prepare_grub_to_access_device ${boot_device} boot
+ fi
cat << EOF
insmod blscfg
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pang-qing/grub2.git
git@gitee.com:pang-qing/grub2.git
pang-qing
grub2
grub2
a8

搜索帮助

344bd9b3 5694891 D2dac590 5694891