1 Star 0 Fork 49

zhongling.h / grub2

forked from src-anolis-os / grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0247-Remove-quotes-when-reading-ID-value-from-etc-os-rele.patch 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
张彬琛 提交于 2021-04-21 13:03 . update to grub2-2.02-87.el8_2.3.src.rpm
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Wed, 21 Nov 2018 15:37:32 +0100
Subject: [PATCH] Remove quotes when reading ID value from /etc/os-release
The field is used to obtain the path to the GRUB directory in the ESP for
UEFI installs. But in some OS the ID value is quoted, which leads to some
of the scripts to fail:
$ grub2-setpassword
/boot/efi/EFI/"redhat"/ does not exist.
Usage: /usr/sbin/grub2-setpassword [OPTION]
Related: rhbz#1650706
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub-set-password.in | 2 +-
util/grub-switch-to-blscfg.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/grub-set-password.in b/util/grub-set-password.in
index 5ebf50576d6..c0b5ebbfdc5 100644
--- a/util/grub-set-password.in
+++ b/util/grub-set-password.in
@@ -1,6 +1,6 @@
#!/bin/sh -e
-EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')
+EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
if [ -d /sys/firmware/efi/efivars/ ]; then
grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
else
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
index 60cd6ca63cc..d353370cc51 100644
--- a/util/grub-switch-to-blscfg.in
+++ b/util/grub-switch-to-blscfg.in
@@ -40,7 +40,7 @@ etcdefaultgrub=/etc/default/grub
eval "$("${grub_get_kernel_settings}")" || true
-EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')
+EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g')
if [ -d /sys/firmware/efi/efivars/ ]; then
startlink=/etc/grub2-efi.cfg
grubdir=`echo "/@bootdirname@/efi/EFI/${EFIDIR}/" | sed 's,//*,/,g'`
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhonglingh/grub2.git
git@gitee.com:zhonglingh/grub2.git
zhonglingh
grub2
grub2
a8

搜索帮助

344bd9b3 5694891 D2dac590 5694891