#!/usr/bin/ash run_hook() { # 64-md-raid-assembly.rules assembles md arrays incrementally. # In incremental mode, mdadm starts an array as soon as all members # have been added. # 64-md-raid-assembly.rules subsequently triggers a delayed # last-resort action using a systemd.timer that starts the array # even if degraded, but systemd.timer is not available in initcpio. # # Block devices may need more time to come online than udev's # run_hook will give them. Here we wait some more seconds and then # try to start arrays that were incompletely incrementally assembled. local seconds=10 # quick exit mdadm --detail --scan | grep -q INACTIVE-ARRAY || return 0 # wait for slow block devices echo "Waiting $seconds seconds for incomplete mdadm arrays..." sleep $seconds # try to complete assembling and start arrays, possibly in degraded mode mdadm -IRs } # vim: set ft=sh ts=4 sw=4 et: