1 Star 0 Fork 32

jchzhou/dracut

forked from src-openEuler/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
From 097d4bdb20443c1c5a86cc617ac2ab0c24193d75 Mon Sep 17 00:00:00 2001
From: Pavel Valena <[email protected]>
Date: Sat, 17 Aug 2024 01:43:50 +0200
Subject: [PATCH] feat(dracut-init.sh): give --force-add precedence over --omit
This gives precedence of force_add_dracutmodules to omit_dracutmodules,
as there is not other way to override omit_dracutmodules list, and users
would expect it to be overriden from command line.
Ref: https://github.com/dracut-ng/dracut-ng/pull/569
This way, `--add` retains it behaviour, and `--force-add` gains additional
functionality in non-hostonly mode. The module may still be skipped
if the module check returns 1, but it should throw error (as I'd expect
for `--force-add`).
Ref: https://issues.redhat.com/browse/RHEL-26114
(cherry picked from commit a669346f48cbb3278c51ba5e95b1b91f9bfdee0a)
Resolves: RHEL-26114
---
dracut-init.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dracut-init.sh b/dracut-init.sh
index fe1b1426..27abb07b 100644
--- a/dracut-init.sh
+++ b/dracut-init.sh
@@ -921,8 +921,10 @@ check_module() {
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
- ddebug "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
- return 1
+ if [[ " $force_add_dracutmodules " != *\ $_mod\ * ]]; then
+ ddebug "Module '$_mod' will not be installed, because it's in the list to be omitted!"
+ return 1
+ fi
fi
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
--
2.34.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jchzhou/dracut.git
[email protected]:jchzhou/dracut.git
jchzhou
dracut
dracut
master

搜索帮助