]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
prompt the crypto disk, when asking for a password
authorHarald Hoyer <harald@redhat.com>
Tue, 23 Jun 2009 05:47:42 +0000 (07:47 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 23 Jun 2009 05:49:23 +0000 (07:49 +0200)
also check, if root is already mounted and flock against
console activities.

modules.d/50plymouth/cryptroot-ask.sh

index fadb50227b2b6456b3eae71d3b2f225286351d0e..88b93c036101b6e258bde182822e8be84976d1c1 100755 (executable)
@@ -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