1 Star 0 Fork 16

jackzhao166/grub2

forked from OpenCloudOS Stream/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0199-BLS-create-etc-kernel-cmdline-during-mkconfig.patch 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
nilusyi 提交于 2024-04-07 16:45 . update patches
From a41df9b3cf6190ed8a2175602eb19a45d7e002aa Mon Sep 17 00:00:00 2001
From: nilusyi <nilusyi@tencent.com>
Date: Tue, 2 Apr 2024 16:52:33 +0800
Subject: [PATCH 199/272] BLS: create /etc/kernel/cmdline during mkconfig
- v2: squish: don't dup rhgb quiet, check mtimes
- v3: squish: give up on rhgb quiet
- v4: squish: BLS: only write /etc/kernel/cmdline if writable
Signed-off-by: nilusyi <nilusyi@tencent.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Signed-off-by: Jonathan Lebon <jonathan@jlebon.com>
---
util/grub.d/10_linux.in | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 14df28135..7d843db85 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -163,6 +163,14 @@ update_bls_cmdline()
local cmdline="root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
local -a files=($(get_sorted_bls))
+ if [ -w /etc/kernel ] && [[ ! -f /etc/kernel/cmdline ||
+ /etc/kernel/cmdline -ot /etc/default/grub ]]; then
+ # anaconda has the correct information to create this during install;
+ # afterward, grubby will take care of syncing on updates. If the user
+ # has modified /etc/default/grub, try to cope.
+ echo "$cmdline" > /etc/kernel/cmdline
+ fi
+
for bls in "${files[@]}"; do
local options="${cmdline}"
if [ -z "${bls##*debug*}" ]; then
--
2.41.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jackzhao166/grub2.git
git@gitee.com:jackzhao166/grub2.git
jackzhao166
grub2
grub2
master

搜索帮助