diff -r 3f47a1bee7f8 .hgtags --- a/.hgtags Mon Jul 30 12:06:30 2007 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -ba7328e4375e9755a9dab61897c7b79eb05c3363 default diff -r 3f47a1bee7f8 rc.sysinit --- a/rc.sysinit Mon Jul 30 12:06:30 2007 -0700 +++ b/rc.sysinit Mon Jul 30 12:15:29 2007 -0700 @@ -150,16 +150,27 @@ if [ -f /etc/crypttab -a -n "$(grep -v ^ elif [ "${cpass:0:1}" != "/" ]; then # For some fun reason, the parameter ordering varies for # LUKS and non-LUKS devices. Joy. - if [ "${cpass}" = "ASK" ]; then - echo -ne "\nEnter passphrase for '${cname}' volume: " - read -r -s cpass < /dev/console - fi - - if $CS isLuks $csrc 2>/dev/null; then - echo "$cpass" | $CS $copts luksOpen $csrc $cname >/dev/null - else - echo "$cpass" | $CS $copts create $cname $csrc >/dev/null - fi + i=0 + while [ $i -lt 3 ]; do + if [ "${cpass}" = "ASK" ]; then + echo -ne "\nEnter passphrase for '${cname}' volume: " + read -r -s cpass < /dev/console + fi + + if $CS isLuks $csrc 2>/dev/null; then + echo "$cpass" | $CS $copts luksOpen $csrc $cname + else + echo "$cpass" | $CS $copts create $cname $csrc >/dev/null + fi + ret=$? + if [ $ret -ne 0 ]; then + i=$((i + 1)) + cpass="ASK" + else + i=3 + fi + + done else if $CS isLuks $csrc 2>/dev/null; then $CS -d $cpass $copts luksOpen $csrc $cname >/dev/null @@ -167,7 +178,7 @@ if [ -f /etc/crypttab -a -n "$(grep -v ^ $CS -d $cpass $copts create $cname $csrc >/dev/null fi fi - if [ $? -ne 0 ]; then + if [ $ret -ne 0 ]; then csfailed=1 stat_append "failed " else