cryptsetup does not like running in a while read loop.
authorVictor Lowther <victor.lowther@gmail.com>
Sun, 22 Feb 2009 06:22:36 +0000 (00:22 -0600)
committerDave Jones <davej@redhat.com>
Tue, 24 Feb 2009 19:53:42 +0000 (14:53 -0500)
Add some additional manglage to ensure that stdin/stdout is always pointing
the right thing.  A more elegant way of doing this would be much appreciated

hooks/cryptroot.sh

index 739f5d3..1bcc68f 100755 (executable)
@@ -2,7 +2,9 @@
 [ -s /cryptroot ] && { 
     udevadm control --stop_exec_queue
     while read cryptopts; do
-       /sbin/cryptsetup luksOpen $cryptopts
+       (   exec >/dev/console 2>&1 </dev/console
+           /sbin/cryptsetup luksOpen $cryptopts || emergency_shell
+       )
     done </cryptroot
     >/cryptroot
     udevadm control --start_exec_queue