--- /lib/cryptsetup/cryptdisks.functions.orig 2006-11-20 17:08:12.110124635 +0100 +++ /lib/cryptsetup/cryptdisks.functions 2006-11-23 16:31:41.894832293 +0100 @@ -265,17 +265,30 @@ 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 + RC=$? + if [ $RC -eq 0 ]; then + break + fi + done + /sbin/usplash_write "CLEAR" + else + $CRYPTCMD $PARAMS luksOpen $src $dst <&1 + RC=$? + fi + fi + fi - if [ $? != 0 ]; then + if [ $RC != 0 ]; then return 1 fi