[PATCH] Add support for plymouth

Guido Günther agx at sigxcpu.org
Mon Mar 22 21:09:30 UTC 2010


---
 debian/initramfs/cryptroot-script |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/debian/initramfs/cryptroot-script b/debian/initramfs/cryptroot-script
index 8c11a57..bff6eae 100644
--- a/debian/initramfs/cryptroot-script
+++ b/debian/initramfs/cryptroot-script
@@ -30,7 +30,9 @@ esac
 #
 message()
 {
-	if [ -p /dev/.initramfs/usplash_outfifo ] && [ -x /sbin/usplash_write ]; then
+	if [ -x /bin/plymouth ] && plymouth --ping; then
+		plymouth message --text="$@"
+	elif [ -p /dev/.initramfs/usplash_outfifo ] && [ -x /sbin/usplash_write ]; then
 		usplash_write "TEXT-URGENT $@"
 	else
 		echo "$@" >&2
@@ -289,12 +291,17 @@ setup_mapping()
 			return 1
 		fi
 
+
 		if [ -z "$cryptkeyscript" ]; then
-			cryptkeyscript="/lib/cryptsetup/askpass"
 			cryptkey="Unlocking the disk $cryptsource ($crypttarget)\nEnter passphrase: "
+			if [ -x /bin/plymouth ] && plymouth --ping; then
+				cryptkeyscript="plymouth ask-for-password --prompt"
+				cryptkey=$(echo -e "$cryptkey")
+			else
+				cryptkeyscript="/lib/cryptsetup/askpass"
+			fi
 		fi
 
-
 		if ! crypttarget="$crypttarget" cryptsource="$cryptsource" \
 		     $cryptkeyscript "$cryptkey" | $cryptcreate --key-file=- ; then
 			message "cryptsetup: cryptsetup failed, bad password or options?"
-- 
1.7.0


--Qxx1br4bt0+wmkIi--





More information about the pkg-cryptsetup-devel mailing list