diff options
Diffstat (limited to 'debian/initramfs')
-rw-r--r-- | debian/initramfs/hook | 2 | ||||
-rw-r--r-- | debian/initramfs/script.local-block | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/debian/initramfs/hook b/debian/initramfs/hook index ae7d4d18..4e94c204 100644 --- a/debian/initramfs/hook +++ b/debian/initramfs/hook @@ -98,7 +98,7 @@ else # make sure the configuration file knows about all running devices /sbin/mdadm --detail --scan | while read array device params; do uuid=${params#*UUID=}; uuid=${uuid%% *} - if ! grep -q "UUID=$uuid" $DESTMDADMCONF; then + if ! grep -qi "UUID=$uuid" $DESTMDADMCONF; then warn "the array $device with UUID $uuid" warn "is currently active, but it is not listed in mdadm.conf. if" warn "it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!" diff --git a/debian/initramfs/script.local-block b/debian/initramfs/script.local-block index e9b47c3d..214f24c7 100644 --- a/debian/initramfs/script.local-block +++ b/debian/initramfs/script.local-block @@ -15,12 +15,20 @@ prereqs) ;; esac +. /scripts/functions + # Poor man's mdadm-last-resort@.timer # That kicks in 2/3rds into the ROOTDELAY if [ ! -f /run/count.mdadm.initrd ] then COUNT=0 + + # Unfortunately raid personalities can be registered _after_ block + # devices have already been added, and their rules processed, try + # triggering again. See #830770 + udevadm trigger --action=add -s block || true + wait_for_udev 10 else COUNT=$(cat /run/count.mdadm.initrd) fi @@ -28,6 +36,11 @@ COUNT=$((COUNT + 1)) echo $COUNT > /run/count.mdadm.initrd +# Run pure assemble command, even though we default to incremental +# assembly it is supported for users to export variables via +# param.conf such as IMSM_NO_PLATFORM. See #830300 +mdadm -q --assemble --scan --no-degraded || true + MAX=30 if [ ${ROOTDELAY:-0} -gt $MAX ]; then MAX=$ROOTDELAY @@ -36,8 +49,12 @@ MAX=$((MAX*2/3)) if [ "$COUNT" = "$MAX" ] then - # Poor man's mdadm-last-resort@.service + # Poor man's mdadm-last-resort@.service for incremental devices mdadm -q --run /dev/md?* + + # And last try for all others + mdadm -q --assemble --scan --run + rm -f /run/count.mdadm.initrd fi |