1 Star 0 Fork 32

陈棋德/dracut

forked from src-openEuler/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-feat-lvm-update-lvm-command-options.patch 2.55 KB
一键复制 编辑 原始数据 按行查看 历史
panxiaohe 提交于 2022-04-11 17:17 . sync commits from branch 22.03
From c0a54f2993b1d3c2101202c274a41f925445d54b Mon Sep 17 00:00:00 2001
From: David Teigland <[email protected]>
Date: Wed, 8 Dec 2021 14:43:58 -0600
Subject: [PATCH] feat(lvm): update lvm command options
Drop checking for options that have been available for
at least ten years. This simplifies code maintenance.
Add the new --nohints option (when available) to disable
the use of hints which is not useful during startup.
---
modules.d/90lvm/lvm_scan.sh | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index 8038240..00143bf 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -59,39 +59,42 @@ min=$2
sub=${3%% *}
sub=${sub%%\(*}
-lvm_ignorelockingfailure="--ignorelockingfailure"
-lvm_quirk_args="--ignorelockingfailure --ignoremonitoring"
-
-check_lvm_ver 2 2 57 "$maj" "$min" "$sub" \
- && lvm_quirk_args="$lvm_quirk_args --poll n"
-
-if check_lvm_ver 2 2 65 "$maj" "$min" "$sub"; then
- lvm_quirk_args=" --sysinit $extraargs"
-fi
-
-if check_lvm_ver 2 2 221 "$maj" "$min" "$sub"; then
- lvm_quirk_args=" $extraargs"
- unset lvm_ignorelockingfailure
-fi
-
+# For lvchange and vgchange use --sysinit which:
+# disables polling (--poll n)
+# ignores monitoring (--ignoremonitoring)
+# ignores locking failures (--ignorelockingfailure)
+# disables hints (--nohints)
+#
+# For lvscan and vgscan:
+# disable locking (--nolocking)
+# disable hints (--nohints)
+
+activate_args="--sysinit $extraargs"
unset extraargs
export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
+scan_args="--nolocking"
+
+check_lvm_ver 2 3 14 "$maj" "$min" "$sub" \
+ && scan_args="$scan_args --nohints"
+
if [ -n "$LVS" ]; then
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
- lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo
+ # shellcheck disable=SC2086
+ lvm lvscan $scan_args 2>&1 | vinfo
for LV in $LVS; do
# shellcheck disable=SC2086
- lvm lvchange --yes -K -ay $lvm_quirk_args "$LV" 2>&1 | vinfo
+ lvm lvchange --yes -K -ay $activate_args "$LV" 2>&1 | vinfo
done
fi
if [ -z "$LVS" ] || [ -n "$VGS" ]; then
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
- lvm vgscan $lvm_ignorelockingfailure 2>&1 | vinfo
# shellcheck disable=SC2086
- lvm vgchange -ay $lvm_quirk_args $VGS 2>&1 | vinfo
+ lvm vgscan $scan_args 2>&1 | vinfo
+ # shellcheck disable=SC2086
+ lvm vgchange -ay $activate_args $VGS 2>&1 | vinfo
fi
if [ "$lvmwritten" ]; then
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dillon_chen/dracut.git
[email protected]:dillon_chen/dracut.git
dillon_chen
dracut
dracut
master

搜索帮助