From: Harald Hoyer Date: Tue, 23 Jun 2009 05:47:42 +0000 (+0200) Subject: prompt the crypto disk, when asking for a password X-Git-Tag: 0.2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0d1ea3d875281774f7f455ad2bb2e0aa7b5c974;p=thirdparty%2Fdracut.git prompt the crypto disk, when asking for a password also check, if root is already mounted and flock against console activities. --- diff --git a/modules.d/50plymouth/cryptroot-ask.sh b/modules.d/50plymouth/cryptroot-ask.sh index fadb50227..88b93c036 100755 --- a/modules.d/50plymouth/cryptroot-ask.sh +++ b/modules.d/50plymouth/cryptroot-ask.sh @@ -1,4 +1,14 @@ #!/bin/sh -[ -b /dev/mapper/$2 ] || exec /bin/plymouth ask-for-password --command="/sbin/cryptsetup luksOpen -T1 $1 $2" +# do not ask, if we already have root +[ -f /sysroot/proc ] && exit 0 +# check if destination already exists +[ -b /dev/mapper/$2 ] && exit 0 + +# flock against other interactive activities +{ flock -s 9; +/bin/plymouth ask-for-password --prompt "$1 is password protected" --command="/sbin/cryptsetup luksOpen -T1 $1 $2" +} 9>/.console.lock + +exit 0