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'"
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