1 Star 0 Fork 9

jackzhao166/dracut

forked from OpenCloudOS Stream/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
2237-kmoddir-fix-trailing-forwardslash-handling.patch 992 Bytes
一键复制 编辑 原始数据 按行查看 历史
kianli 提交于 2023-08-15 20:06 . Upgrade to 059
From 6fb0f4b4d54eeb1b1e89c06cc54bdcab504138da Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Fri, 24 Feb 2023 19:19:59 +0100
Subject: [PATCH] fix(dracut.sh): kmoddir does not handle trailing /
Fixes https://github.com/dracutdevs/dracut/issues/2236
+(/) only works in bash interactive mode. Using any non-interactive
bash run simply doesn't remove anything.
The solution is copied from dracut-lib.sh, trim().
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 1aa3f8e1f..0c0f85c2d 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1033,7 +1033,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
((stdloglvl < 0)) && stdloglvl=0
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
-drivers_dir="${drivers_dir%%+(/)}"
+drivers_dir="${drivers_dir%"${drivers_dir##*[!/]}"}"
[[ $do_strip_l ]] && do_strip=$do_strip_l
[[ $do_strip ]] || do_strip=yes
[[ $aggressive_strip_l ]] && aggressive_strip=$aggressive_strip_l
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jackzhao166/dracut.git
git@gitee.com:jackzhao166/dracut.git
jackzhao166
dracut
dracut
master

搜索帮助