crypt: wait for all rd_LUKS_UUID disks to appear
authorHarald Hoyer <harald@redhat.com>
Mon, 12 Jul 2010 14:16:39 +0000 (16:16 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 12 Jul 2010 14:16:39 +0000 (16:16 +0200)
Also give a hint in emergency, if one disk is not found.

modules.d/90crypt/parse-crypt.sh

index 775617f..04d9ecb 100755 (executable)
@@ -9,9 +9,12 @@ else
     } > /etc/udev/rules.d/70-luks.rules
     LUKS=$(getargs rd_LUKS_UUID=)
     if [ -n "$LUKS" ]; then
+       echo '. /lib/dracut-lib.sh' > /emergency/crypt.sh
        for luksid in $LUKS; do 
        printf 'ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{ID_FS_UUID}=="*%s*", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $luksid \
            >> /etc/udev/rules.d/70-luks.rules  
+       printf '[ -e /dev/disk/by-uuid/*%s* ] || exit 1 \n'  $luksid >> /initqueue-finished/crypt.sh
+       printf '[ -e /dev/disk/by-uuid/*%s* ] || warn "crypto LUKS UUID "%s" not found" \n' $luksid $luksid >> /emergency/00-crypt.sh
        done
     else
        echo 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"' \