0 Star 0 Fork 32

Liquor/dracut

forked from src-openEuler/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
check_vol_slaves_all-must-return-1-when-lvm-vgs-fail.patch 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:37 . Package init
From fc613d0d2ca74a39bd76d4defc5bdf479e921272 Mon Sep 17 00:00:00 2001
From: gaoyi <[email protected]>
Date: Wed, 14 Aug 2019 07:22:22 -0400
Subject: [PATCH] check_vol_slaves_all must return 1 when lvm vgs failed
reason: when filter/global_filter is set in lvm.conf, lvm vgs may be
failed
Signed-off-by: gaoyi <[email protected]>
---
dracut-functions.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 7c408f8..c50d328 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -595,6 +595,12 @@ check_vol_slaves_all() {
# strip space
_vg="${_vg//[[:space:]]/}"
if [[ $_vg ]]; then
+ # when filter/global_filter is set, lvm may be failed
+ lvm lvs --noheadings -o vg_name $_vg 2>/dev/null 1>/dev/null
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
+
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
do
check_block_and_slaves_all $1 $(get_maj_min $_pv)
--
2.19.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liquor1/dracut.git
[email protected]:liquor1/dracut.git
liquor1
dracut
dracut
master

搜索帮助