network: don't use "ifup -m"
[dracut.git] / modules.d / 90mdraid / mdraid-waitclean.sh
blob5c901982d8364640e301f9f7041c54624ac72b3a
1 #!/bin/sh
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
6 containers=""
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"
13 continue
15 info "Waiting for $md to become clean"
16 mdadm $_offroot -W "$md" >/dev/null 2>&1
17 done
19 for md in $containers; do
20 info "Waiting for $md to become clean"
21 mdadm $_offroot -W "$md" >/dev/null 2>&1
22 done
24 unset containers udevinfo _offroot