On Fri, Mar 11, 2011 at 11:41 AM, Harald Hoyer <harald@xxxxxxxxxx> wrote: > Am 10.03.2011 23:54, schrieb Andrey Borzenkov: >> Otherwise there is no way to skip pasword prompt. --has-active-vt >> seems to correctly catch also the case when plymouthd is started >> but splash is disabled. >> >> Signed-off-by: Andrey Borzenkov <arvidjaar@xxxxxxxxx> >> >> --- >> modules.d/90crypt/cryptroot-ask.sh | 5 ++--- >> 1 files changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh >> index 5150688..9c99ccc 100755 >> --- a/modules.d/90crypt/cryptroot-ask.sh >> +++ b/modules.d/90crypt/cryptroot-ask.sh >> @@ -80,9 +80,8 @@ if [ -n "$(getarg rd.luks.key)" ]; then >> rmdir "$mntp" >> unset mntp keypath keydev >> else >> - # Prompt for password with plymouth, if installed. >> - # Should we check if plymouthd is running? >> - if [ -x /bin/plymouth ]; then >> + # Prompt for password with plymouth, if installed and running. >> + if [ -x /bin/plymouth ] && /bin/plymouth --has-active-vt; then >> prompt="Password [$device ($luksname)]:" >> if [ ${#luksname} -gt 8 ]; then >> sluksname=${sluksname##luks-} > > Very nice! Thank you! > I think attached patch still makes sense in addition to (or probably even instead of) this one.
From: Andrey Borzenkov <arvidjaar@xxxxxxxxx> Subject: [PATCH] cryptoroot-ask: limit number of plymouth password requests Set number ot retries to 5 to align with non-plymouth case. Signed-off-by: Andrey Borzenkov <arvidjaar@xxxxxxxxx> --- modules.d/90crypt/cryptroot-ask.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules.d/90crypt/cryptroot-ask.sh b/modules.d/90crypt/cryptroot-ask.sh index 9c99ccc..4a65c23 100755 --- a/modules.d/90crypt/cryptroot-ask.sh +++ b/modules.d/90crypt/cryptroot-ask.sh @@ -92,7 +92,7 @@ else # flock against other interactive activities { flock -s 9; /bin/plymouth ask-for-password \ - --prompt "$prompt" \ + --prompt "$prompt" --number-of-tries=5 \ --command="/sbin/cryptsetup luksOpen -T1 $device $luksname" } 9>/.console.lock -- tg: (664193e..) upstream/passwd-retries (depends on: upstream/crypto-plymouth)