--- cryptdisks.functions 2008-07-07 16:45:43.000000000 -0300 +++ cryptdisks.functions.new 2008-07-07 17:45:35.000000000 -0300 @@ -266,17 +266,21 @@ tried=$(( $tried + 1 )) done else - if test "x$INTERACTIVE" != "xyes" ; then - PARAMS="$PARAMS --key-file=$key" - cryptsetup $PARAMS luksOpen $src $dst <&1 + if [ -p /dev/.initramfs/usplash_outfifo ] && [ -x /sbin/usplash_write ]; then + while [ "$tried" -lt "$TRIES" ]; do + usplash_write "INPUTQUIET Enter password to unlock the disk ($dst): " + PASS="$(cat /dev/.initramfs/usplash_outfifo)" + echo -n "$PASS" | cryptsetup $PARAMS luksOpen "$src" "$dst" >/dev/null 2>&1 + if [ "$?" -eq "0" ]; then + break + fi + tried=$(( $tried + 1 )) + done + usplash_write "TEXT-URGENT " else - if [ -x /sbin/usplash_write -a -p /dev/.initramfs/usplash_outfifo ]; then - /sbin/usplash_write "QUIT" - # saftey sleep ! - sleep 2 - fi cryptsetup $PARAMS luksOpen $src $dst <&1 fi + fi if [ "$tried" -ge "$TRIES" ]; then