--- /lib/cryptsetup/cryptdisks.functions.orig 2006-11-20 17:08:12.110124635 +0100 +++ /lib/cryptsetup/cryptdisks.functions 2006-11-20 17:19:58.031662847 +0100 @@ -263,16 +263,25 @@ PARAMS="$PARAMS --key-file=-" $KEYSCRIPT $key <&1 | $CRYPTCMD $PARAMS luksOpen $src $dst else + if test "x$INTERACTIVE" != "xyes" ; then PARAMS="$PARAMS --key-file=$key" - fi - if [ -x /sbin/usplash_write -a -p /dev/.initramfs/usplash_outfifo ]; then - /sbin/usplash_write "INPUTQUIET Password for cryptodisk:" - $CRYPTCMD $PARAMS luksOpen $src $dst < /dev/.initramfs/usplash_outfifo - /sbin/usplash_write "CLEAR" - else $CRYPTCMD $PARAMS luksOpen $src $dst <&1 + else + if [ -x /sbin/usplash_write -a -p /dev/.initramfs/usplash_outfifo ]; then + MAXTRIES=3 + while [ $MAXTRIES -gt 0 ]; do + MAXTRIES=$(($MAXTRIES - 1)) + /sbin/usplash_write "INPUTQUIET Password for cryptodisk $dst ($src):" + $CRYPTCMD $PARAMS luksOpen $src $dst < /dev/.initramfs/usplash_outfifo && break + done + /sbin/usplash_write "CLEAR" + else + $CRYPTCMD $PARAMS luksOpen $src $dst <&1 + fi + fi + fi if [ $? != 0 ]; then