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'"
+ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/bin/cryptroot.sh $env{DEVNAME} luks-$env{ID_FS_UUID}"
LABEL="luks_end"
#!/bin/sh
-[ -s /cryptroot ] && {
- udevadm control --stop_exec_queue
- while read cryptopts; do
- ( exec >/dev/console 2>&1 </dev/console
- set $cryptopts
- [ -b /dev/mapper/$2 ] || ( /sbin/cryptsetup luksOpen $cryptopts || emergency_shell )
- )
- done </cryptroot
- >/cryptroot
- udevadm control --start_exec_queue
- udevadm settle --timeout=30
-}
+exec >/dev/console 2>&1 </dev/console
+[ -b /dev/mapper/$2 ] && exit 0
+/sbin/cryptsetup -T 3 -t 30 luksOpen $1 $2
inst cryptsetup
instmods dm_crypt =crypto
inst_rules "$moddir/63-luks.rules"
-inst_hook mount 10 "$moddir/cryptroot.sh"
\ No newline at end of file
+inst "$moddir/cryptroot.sh" "/bin/cryptroot.sh"
\ No newline at end of file