1 Star 0 Fork 46

庞庆 / grub2

forked from src-anolis-os / grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0208-grub-switch-to-blscfg-Only-fix-boot-prefix-for-non-g.patch 2.14 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: Wed, 18 Jul 2018 08:07:37 +0200
Subject: [PATCH] grub-switch-to-blscfg: Only fix boot prefix for non-generated
BLS files
The BLS files are either copied from /lib/modules/$kernelver/bls.conf or
generated if this file doesn't exist. The shipped bls.conf default path
for the kernel and initramfs is relative to the boot partition.
But in some setups /boot may not be a mount point so in that case the
boot prefix has to be added to the BLS. But we already provide this
prefix for generated BLS files so attempting to add a boot prefix will
lead to a path that contains the boot prefix twice (i.e: /boot/boot).
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub-switch-to-blscfg.in | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
index 40612e006..9cf64f8e7 100644
--- a/util/grub-switch-to-blscfg.in
+++ b/util/grub-switch-to-blscfg.in
@@ -236,6 +236,10 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do
if [ -f "${kernel_dir}/bls.conf" ] ; then
cp -af "${kernel_dir}/bls.conf" "${bls_target}"
+ if [ -n "${bootprefix}" ]; then
+ sed -i -e "s,^\(linux[^ \t]*[ \t]\+\).*,\1${bootprefix}${linux},g" "${bls_target}"
+ sed -i -e "/^initrd/ s,\([ \t]\+\)\([^ \t]\+\),\1${bootprefix}\2,g" "${bls_target}"
+ fi
else
mkbls "${kernelver}" \
"$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${kernel_dir}")")" \
@@ -243,11 +247,6 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do
>"${bls_target}"
fi
- if [ -n "${bootprefix}" ]; then
- sed -i -e "s,^\(linux[^ \t]*[ \t]\+\).*,\1${bootprefix}${linux},g" "${bls_target}"
- sed -i -e "/^initrd/ s,\([ \t]\+\)\([^ \t]\+\),\1${bootprefix}\2,g" "${bls_target}"
- fi
-
if [ "x$GRUB_LINUX_MAKE_DEBUG" = "xtrue" ]; then
arch="$(uname -m)"
bls_debug="$(echo ${bls_target} | sed -e "s/\.${arch}/-debug.${arch}/")"
马建仓 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