Projects
Eulaceura:Mainline:GA
dracut
_service:obs_scm:skip-the-broken-sd-in-initqueu...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:skip-the-broken-sd-in-initqueue.patch of Package dracut
From 816a7dbff7128b4b87ea8d6abd2caf564f8f3502 Mon Sep 17 00:00:00 2001 From: gaoyi <gaoyi15@huawei.com> 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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2