3 if getargbool
0 rd.md.waitclean
; then
4 _offroot
=$
(strstr
"$(mdadm --help-options 2>&1)" offroot
&& echo --offroot)
5 type getarg
>/dev
/null
2>&1 || .
/lib
/dracut-lib.sh
7 for md
in /dev
/md
[0-9_]*; do
8 [ -b "$md" ] ||
continue
9 udevinfo
="$(udevadm info --query=env --name=$md)"
10 strstr
"$udevinfo" "DEVTYPE=partition" && continue
11 if strstr
"$udevinfo" "MD_LEVEL=container"; then
12 containers
="$containers $md"
15 info
"Waiting for $md to become clean"
16 mdadm
$_offroot -W "$md" >/dev
/null
2>&1
19 for md
in $containers; do
20 info
"Waiting for $md to become clean"
21 mdadm
$_offroot -W "$md" >/dev
/null
2>&1
24 unset containers udevinfo _offroot