dracut-systemd/dracut-initqueue: only start service if really needed
[dracut.git] / modules.d / 90mdraid / md-shutdown.sh
blob400bb003efd94d1aa066fc5b525eb20c72574c60
1 #!/bin/sh
3 _do_md_shutdown() {
4 local ret
5 local final=$1
6 local _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
7 info "Waiting for mdraid devices to be clean."
8 mdadm $_offroot -vv --wait-clean --scan| vinfo
9 ret=$?
10 info "Disassembling mdraid devices."
11 mdadm $_offroot -vv --stop --scan | vinfo
12 ret=$(($ret+$?))
13 if [ "x$final" != "x" ]; then
14 info "/proc/mdstat:"
15 vinfo < /proc/mdstat
17 return $ret
20 if command -v mdadm >/dev/null; then
21 _do_md_shutdown $1
22 else