--- rm-crypto-usb-key.sh    2011-10-02 20:29:15.000000000 +0200
+++ dgb-crypto-usb-key.sh   2012-05-27 14:18:55.000000000 +0200
@@ -30,6 +30,9 @@
 # first checking whether the device (e.g. sdb) was a USB and removable  
 # stuff, instead of doing the same test on every single partition of the  
 # device (e.g. sdb1, sdb2, ...).
+#
+# 2012-03-29
+# Updated by dgb for plymouth support in Ubuntu 10.04.3 LTS
 
 # define counter-intuitive shell logic values (based on /bin/true & /bin/false)
 # NB. use FALSE only to *set* something to false, but don't test for
@@ -40,6 +43,12 @@
 # set DEBUG=$TRUE to display debug messages, DEBUG=$FALSE to be quiet
 DEBUG=$TRUE
 
+# is plymouth available? default false
+PLYMOUTH=$FALSE
+if [ -x /bin/plymouth ] && plymouth --ping; then
+    PLYMOUTH=$TRUE
+fi
+
 # is usplash available? default false
 USPLASH=$FALSE
 # test for outfifo from Ubuntu Hardy cryptroot script, the second test
@@ -83,7 +92,10 @@
    if [ $# -gt 0 ]; then
        # handle multi-line messages
        echo $2 | while read LINE; do
-           if [ $USPLASH -eq $TRUE ]; then
+            if [ $PLYMOUTH -eq $TRUE ]; then
+                # use plymouth
+                plymouth message --text="$LINE"      
+            elif [ $USPLASH -eq $TRUE ]; then
                # use usplash
                /sbin/usplash_write "$1 $LINE"      
            else
@@ -106,7 +118,9 @@
 readpass ()
 {
    if [ $# -gt 0 ]; then
-       if [ $USPLASH -eq $TRUE ]; then
+        if [ $PLYMOUTH -eq $TRUE ]; then
+            PASS="$(plymouth ask-for-password --prompt "$1: ")"
+        elif [ $USPLASH -eq $TRUE ]; then
            usplash_write "INPUTQUIET $1: "
            PASS="$(cat /dev/.initramfs/usplash_outfifo)"
        else
@@ -249,8 +263,8 @@
 [ $USPLASH -eq $TRUE ] && msg STATUS "                               " && msg CLEAR ""
 
 if [ $OPENED -ne $TRUE ]; then
-   msg TEXT "FAILED to find suitable USB key-file ..."
-   readpass "Try to enter the LUKS password: "
+    msg TEXT "Failed to find suitable USB key-file ..."
+    readpass "Enter the LUKS password: "
 else
    msg TEXT "Success loading key-file from $SFS ($LABEL)"
 fi
@@ -258,3 +272,4 @@
 #
 [ $USPLASH -eq $TRUE ] && /sbin/usplash_write "VERBOSE default"
 
+