diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-04-28 01:10:08 +0200 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-04-28 01:10:08 +0200 |
commit | 7a4346c551247544b3b2984c8958a3b4b8575b8c (patch) | |
tree | 42188fcc707f6282799b426d116854f55737350c /hooks | |
parent | 188acd6f8e4f7339e399ab50ca0e2656658a529c (diff) | |
download | mkinitcpio-7a4346c551247544b3b2984c8958a3b4b8575b8c.tar.gz mkinitcpio-7a4346c551247544b3b2984c8958a3b4b8575b8c.tar.xz |
encryption handling changes
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@31 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'hooks')
-rw-r--r-- | hooks/encrypt | 20 |
1 files 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 } |