1 Star 0 Fork 46

庞庆 / grub2

forked from src-anolis-os / grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0144-Make-grub2-switch-to-blscfg-to-generate-debug-BLS-wh.patch 2.17 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, 11 Apr 2018 11:49:24 +0200
Subject: [PATCH] Make grub2-switch-to-blscfg to generate debug BLS when
MAKEDEBUG is set
If MAKEDEBUG=yes in /etc/sysconfig/kernel, then a debug menu entry should
be created. So for BLS, a debug configuration file has to be created that
contains additional debug kernel command line parameters.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
util/grub-switch-to-blscfg.in | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in
index eae3c379e..c59299ffa 100644
--- a/util/grub-switch-to-blscfg.in
+++ b/util/grub-switch-to-blscfg.in
@@ -21,6 +21,7 @@
# Initialize some variables.
prefix=@prefix@
exec_prefix=@exec_prefix@
+sbindir=@sbindir@
bindir=@bindir@
sysconfdir="@sysconfdir@"
PACKAGE_NAME=@PACKAGE_NAME@
@@ -33,9 +34,12 @@ fi
self=`basename $0`
+grub_get_kernel_settings="${sbindir}/@grub_get_kernel_settings@"
grub_editenv=${bindir}/@grub_editenv@
etcdefaultgrub=/etc/default/grub
+eval "$("${grub_get_kernel_settings}")" || true
+
EFIDIR=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/')
if [ -d /sys/firmware/efi/efivars/ ]; then
startlink=/etc/grub2-efi.cfg
@@ -226,6 +230,17 @@ for kernelver in $(cd /lib/modules/ ; ls -1) "" ; do
"$(date -u +%Y%m%d%H%M%S -d "$(stat -c '%y' "${kernel_dir}")")" \
>"${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}/")"
+ cp -aT "${bls_target}" "${bls_debug}"
+ title="$(grep '^title[ \t]' "${bls_debug}" | sed -e 's/^title[ \t]*//')"
+ blsid="$(grep '^id[ \t]' "${bls_debug}" | sed -e "s/\.${ARCH}/-debug.${arch}/")"
+ sed -i -e "s/^title.*/title ${title}${GRUB_LINUX_DEBUG_TITLE_POSTFIX}/" "${bls_debug}"
+ sed -i -e "s/^id.*/${blsid}/" "${bls_debug}"
+ sed -i -e "s/^options.*/options \$kernelopts ${GRUB_CMDLINE_LINUX_DEBUG}/" "${bls_debug}"
+ fi
done
GENERATE=0
马建仓 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