aboutsummaryrefslogtreecommitdiff
path: root/scripts/naskpass.initscript
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/naskpass.initscript')
-rwxr-xr-x[-rw-r--r--]scripts/naskpass.initscript18
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/naskpass.initscript b/scripts/naskpass.initscript
index a2d7e95..98fd1dc 100644..100755
--- a/scripts/naskpass.initscript
+++ b/scripts/naskpass.initscript
@@ -290,7 +290,7 @@ setup_mapping()
# Plymouth will add a : if it is a non-graphical prompt
cryptkey="Please unlock disk $diskname"
else
- if [ -x /lib/cryptsetup/naskpass ]; then
+ if [ -x /lib/cryptsetup/naskpass ] && [ $askpass_fallback -eq 0 ]; then
cryptkeyscript="/lib/cryptsetup/naskpass"
cryptkey=""
else
@@ -302,22 +302,24 @@ setup_mapping()
if [ ! -e "$NEWROOT" ]; then
- if [ -x /bin/plymouth ] && plymouth --ping; then
- message "naskpass does not work with playmouth, falling back to default askpass .."
+ if [ -x /bin/plymouth ] && plymouth --ping || [ $askpass_fallback -ne 0 ]; then
+ if [ $askpass_fallback -eq 0 ]; then
+ message "naskpass does not work with plymouth, falling back to default askpass .."
+ fi
if ! crypttarget="$crypttarget" cryptsource="$cryptsource" \
$cryptkeyscript "$cryptkey" | $cryptopen; then
message "cryptsetup: cryptsetup failed, bad password or options?"
continue
fi
else
- dmesg -D
- if ! $cryptkeyscript -c "cryptsetup -T 1 open $cryptsource $crypttarget"; then
+ dmesg -n 1
+ if ! $cryptkeyscript -c "/sbin/cryptsetup -T 1 open $cryptsource $crypttarget"; then
message "naskpass: failed"
continue
else
message "naskpass: success"
fi
- dmesg -E
+ dmesg -n 4
fi
fi
@@ -383,6 +385,7 @@ setup_mapping()
#
# Do we have any kernel boot arguments?
+askpass_fallback=0
cmdline_cryptopts=''
unset cmdline_root
for opt in $(cat /proc/cmdline); do
@@ -406,6 +409,9 @@ for opt in $(cat /proc/cmdline); do
*) # lilo major/minor number (See #398957). Ignore
esac
;;
+ cryptfallback)
+ askpass_fallback=1
+ ;;
esac
done