This should handle the case of having more than one encrypted
block device on the system as best we can right now.
#!/bin/sh
-[ -f /cryptroot ] && {
- echo "Encrypted root detected."
- read cryptopts </cryptroot
- /sbin/cryptsetup luksOpen $cryptopts || emergency_shell
+[ -s /cryptroot ] && {
+ udevadm control --stop_exec_queue
+ while read cryptopts; do
+ /sbin/cryptsetup luksOpen $cryptopts
+ done </cryptroot
+ >/cryptroot
+ udevadm control --start_exec_queue
udevadm settle --timeout=30
}
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/sh -c 'echo $env{DEVNAME} luks-$env{ID_FS_UUID} >>/cryptroot'"
LABEL="luks_end"