]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
make crypt more failsafe
authorHarald Hoyer <harald@redhat.com>
Thu, 5 Mar 2009 13:47:00 +0000 (14:47 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 5 Mar 2009 13:47:00 +0000 (14:47 +0100)
modules.d/90crypt/63-luks.rules
modules.d/90crypt/cryptroot.sh

index 6ee8f6b31ac6a528a16e666fd03dc88fa54631fc..802ea062ed4fd56e3559f3055f0f644c5181cee5 100644 (file)
@@ -5,7 +5,7 @@
 
 
 SUBSYSTEM!="block", GOTO="luks_end"
-ACTION!="add", GOTO="luks_end"
+ACTION!="add|change", GOTO="luks_end"
 
 KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"
 ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/bin/sh -c 'echo $env{DEVNAME} luks-$env{ID_FS_UUID} >>/cryptroot'"
index 20429f1ab4d794ae149ce10d0c832413ea9430a1..86e3bbfcff1cb87c39c3fd014b2f8e11fac40165 100755 (executable)
@@ -3,7 +3,8 @@
     udevadm control --stop-exec-queue
     while read cryptopts; do
        (   exec >/dev/console 2>&1 </dev/console
-           /sbin/cryptsetup luksOpen $cryptopts || emergency_shell
+          set $cryptopts
+          [ -b /dev/mapper/$2 ] || ( /sbin/cryptsetup luksOpen $cryptopts || emergency_shell )
        )
     done </cryptroot
     >/cryptroot