From 7a4346c551247544b3b2984c8958a3b4b8575b8c Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 27 Apr 2006 23:10:08 +0000 Subject: encryption handling changes git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@31 880c04e9-e011-0410-abf7-b926e227c9cd --- hooks/encrypt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/hooks/encrypt b/hooks/encrypt index 0c52375..26b318a 100644 --- a/hooks/encrypt +++ b/hooks/encrypt @@ -14,18 +14,17 @@ run_hook () if /bin/cryptsetup isLuks ${root} >/dev/null 2>&1; then echo "" echo "A password is required to access the root filesystem:" - echo -n "password: " + /bin/cryptsetup luksOpen ${root} root - if [ $? -ne 0 ]; then - err "Password verification failed, aborting..." - exit 1 + while [ $? -ne 0 ]; do + #loop until we get a real password + /bin/cryptsetup luksOpen ${root} root + done + if [ -e "/dev/mapper/root" ]; then + export root="/dev/mapper/root" else - if [ -e "/dev/mapper/root" ]; then - export root="/dev/mapper/root" - else - err "Password succeeded, but root creation failed, aborting..." - exit 1 - fi + err "Password succeeded, but root creation failed, aborting..." + exit 1 fi elif [ "x${crypto}" != "x" ]; then do_oldcrypto () @@ -42,7 +41,6 @@ run_hook () [ "x${5}" != "x" ] && exe="$exe --skip \"${5}\"" echo "" echo "A password is required to access the root filesystem:" - echo -n "password: " eval "${exe}" fi } -- cgit v1.2.3-24-g4f1b