summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2014-08-27 19:51:15 +0200
committerDaniel Baumann <mail@daniel-baumann.ch>2014-08-27 19:51:15 +0200
commit6bc8a6645a6310e8089f5521b7c62b25925abe78 (patch)
treeee8cf09fcfcc5b485b50af9f0f9d4aaad9a4f7f5 /components
parent5a0f758cea753b3d27d597649b49789ac29d2177 (diff)
downloadlive-boot-6bc8a6645a6310e8089f5521b7c62b25925abe78.tar.gz
live-boot-6bc8a6645a6310e8089f5521b7c62b25925abe78.zip
Adding plymouth support for LUKS passwort prompt based on a patch from Gaudenz Steinlin <gaudenz@debian.org> (Closes: #754166).
Diffstat (limited to 'components')
-rwxr-xr-xcomponents/9990-misc-helpers.sh44
1 files changed, 41 insertions, 3 deletions
diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh
index 2bf2db1..9951873 100755
--- a/components/9990-misc-helpers.sh
+++ b/components/9990-misc-helpers.sh
@@ -803,9 +803,30 @@ open_luks_device ()
load_keymap
+ # check for plymouth
+ if [ -x /bin/plymouth ]
+ then
+ _PLYMOUTH="true"
+ fi
+
+ case "${_PLYMOUTH}" in
+ true)
+ plymouth --ping
+
+ cryptkeyscript="plymouth ask-for-password --prompt"
+ # Plymouth will add a : if it is a non-graphical prompt
+ cryptkeyprompt="Please unlock disk ${dev}"
+ ;;
+
+ *)
+ cryptkeyscript="/lib/cryptsetup/askpass"
+ cryptkeyprompt="Please unlock disk ${dev}: "
+ ;;
+ esac
+
while true
do
- /lib/cryptsetup/askpass "Enter passphrase for ${dev}: " | \
+ $cryptkeyscript "$cryptkeyprompt" | \
/sbin/cryptsetup -T 1 luksOpen ${dev} ${name} ${opts}
if [ 0 -eq ${?} ]
@@ -816,11 +837,28 @@ open_luks_device ()
fi
echo >&6
- echo -n "There was an error decrypting ${dev} ... Retry? [Y/n] " >&6
- read answer
+ retryprompt="There was an error decrypting ${dev} ... Retry? [Y/n]"
+
+ case "${_PLYMOUTH}" in
+ true)
+ plymouth display-message --text "${retryprompt}"
+ answer=$(plymouth watch-keystroke --keys="YNyn")
+ ;;
+
+ *)
+ echo -n "${retryprompt} " >&6
+ read answer
+ ;;
+ esac
if [ "$(echo "${answer}" | cut -b1 | tr A-Z a-z)" = "n" ]
then
+ case "${_PLYMOUTH}" in
+ true)
+ plymouth display-message --text ""
+ ;;
+ esac
+
return 2
fi
done