1 Star 0 Fork 32

sun_hai/dracut

forked from src-openEuler/dracut 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
skip-the-broken-sd-in-initqueue.patch 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
panxiaohe 提交于 2021-07-23 16:35 . Update to 055
From 816a7dbff7128b4b87ea8d6abd2caf564f8f3502 Mon Sep 17 00:00:00 2001
From: gaoyi <[email protected]>
Date: Fri, 18 Oct 2019 10:42:55 -0400
Subject: [PATCH] skip the broken sd in initqueue
---
.../98dracut-systemd/dracut-initqueue.sh | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/modules.d/98dracut-systemd/dracut-initqueue.sh b/modules.d/98dracut-systemd/dracut-initqueue.sh
index 3ddc236..c7d7888 100755
--- a/modules.d/98dracut-systemd/dracut-initqueue.sh
+++ b/modules.d/98dracut-systemd/dracut-initqueue.sh
@@ -16,6 +16,31 @@ RDRETRY=${RDRETRY:-180}
RDRETRY=$((RDRETRY * 2))
export RDRETRY
+if getarg 'skipbadscsi' -d 'skipbadscsi'; then
+ sd_dir=/sys/block
+ while [ "`ls $sd_dir/`" = "" ]
+ do
+ sleep 1
+ done
+
+ dev_num=0
+ for _sd_device in `ls $sd_dir/`
+ do
+ blkid /dev/$_sd_device >/dev/null 2>&1 &
+ ((dev_num++))
+ done
+
+ sleep $dev_num
+
+ for _sd_device in `ps -eo cmd,stat | grep -Po "(?<=blkid /dev/).*(?=D)"`
+ do
+ echo offline > $sd_dir/$_sd_device/device/state
+ echo "Dev $_sd_device maybe broken, set it offline" > /dev/kmsg
+ done
+
+ udevadm settle --timeout=30
+fi
+
main_loop=0
export main_loop
--
2.19.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sun_hai_10/dracut.git
[email protected]:sun_hai_10/dracut.git
sun_hai_10
dracut
dracut
master

搜索帮助