1 Star 0 Fork 103

GUI/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0207-10_linux.in-fix-early-exit-due-error-when-reading-pe.patch 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
hanzj0122_admin 提交于 2020-07-29 20:47 +08:00 . update to 2.04
From 35181b2c411954a96e3ed9a0ebc6ce470d037595 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Thu, 30 Apr 2020 15:45:31 +0200
Subject: [PATCH 207/220] 10_linux.in: fix early exit due error when reading
petitboot version
The script uses bash's read built-in command to get the petitboot version
version, but this command has a non-zero exit status if the EOF is found.
Since the /sys/firmware/devicetree/base/ibm,firmware-versions/petitboot
string ends with a NUL character, use the empty string as read delimiter
to prevent the command to read to the end-of-file and exit with an error.
Resolves: rhbz#1827397
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub.d/10_linux.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 847646b..09adfce 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -194,7 +194,7 @@ if [ "x${GRUB_ENABLE_BLSCFG}" = "xtrue" ]; then
petitboot_path="/sys/firmware/devicetree/base/ibm,firmware-versions/petitboot"
if test -e ${petitboot_path}; then
- read -a petitboot_version < ${petitboot_path}
+ read -r -d '' petitboot_version < ${petitboot_path}
petitboot_version="$(echo ${petitboot_version//v})"
major_version="$(echo ${petitboot_version} | cut -d . -f1)"
minor_version="$(echo ${petitboot_version} | cut -d . -f2)"
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/GuEe-GUI/grub2.git
git@gitee.com:GuEe-GUI/grub2.git
GuEe-GUI
grub2
grub2
master

搜索帮助