[Pkg-cryptsetup-devel] Bug#445191: cryptsetup: Please stop usplash if running

Reinhard Tartler siretart at tauware.de
Wed Oct 3 21:21:24 UTC 2007


Package: cryptsetup
Version: 2:1.0.5-2
Severity: wishlist
Tags: patch

Hi there,

usplash currently doesn't support a sane way to input
passwords. The most appearent problem is that if you switch the
VT, usplash quits and offers no possibility to enter the password
for cryptsetup.

Because of this, and the fact that usplash is used by default in
ubuntu, the patch below was applied to ubuntu's cryptsetup
package. It first makes sure that cryptsetup is started on a
fresh and clean VT (see launchpad.net/bugs/58794 for
details. Actually this is strictly only needed when run with
upstart instead of sysvinit, I can resubmit it as seperate
wishlist bug, if you prefer). Then it checks for a running
usplash and if yes, it stops.

Find the relevant parts below:

diff -pruN 2:1.0.5-2/debian/cryptdisks.functions 2:1.0.5-2ubuntu1/debian/cryptdisks.functions
--- 2:1.0.5-2/debian/cryptdisks.functions	2007-10-03 00:08:07.000000000 +0100
+++ 2:1.0.5-2ubuntu1/debian/cryptdisks.functions	2007-10-03 00:07:57.000000000 +0100
@@ -1,3 +1,8 @@
+#
+# This file is for inclusion with
+#	. /lib/cryptsetup/cryptdisks.functions
+# and should not be executed directly.
+
 PATH="/sbin:/bin"
 TABFILE=/etc/crypttab
 CRYPTDISKS_ENABLE="Yes"
@@ -22,6 +27,12 @@ case "$CRYPTDISKS_ENABLE" in
 	;;
 esac
 
+# Always output to console
+stdin=`readlink /proc/self/fd/0`
+if [ "${stdin#/dev/null}" != "$stdin" ] && [ "$ON_VT" != "yes" ]; then
+    exec env ON_VT=yes /usr/bin/openvt -f -c `fgconsole` -w $0 "$@"
+fi
+
 
 # Parses the option field from the crypttab file
 parse_opts () {
@@ -255,7 +266,17 @@ do_luks () {
 			tried=$(( $tried + 1 ))
 		done
 	else
-		cryptsetup $PARAMS luksOpen "$src" "$dst" <&1 || tried="$TRIES"
+		if test "x$INTERACTIVE" != "xyes" ; then
+			PARAMS="$PARAMS --key-file=$key"
+			cryptsetup $PARAMS luksOpen $src $dst <&1
+		else
+			if [ -x /sbin/usplash_write -a -p /dev/.initramfs/usplash_outfifo ]; then
+			     	/sbin/usplash_write "QUIT"
+				# saftey sleep !
+				sleep 2
+			fi
+			cryptsetup $PARAMS luksOpen $src $dst <&1
+		fi
 	fi
 
 	if [ "$tried" -ge "$TRIES" ]; then


-- System Information:
Debian Release: lenny/sid
  APT prefers gutsy-updates
  APT policy: (500, 'gutsy-updates'), (500, 'gutsy')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-12-generic (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cryptsetup depends on:
ii  dmsetup               2:1.02.20-1ubuntu4 The Linux Kernel Device Mapper use
ii  libc6                 2.6.1-1ubuntu9     GNU C Library: Shared libraries
ii  libdevmapper1.02.1    2:1.02.20-1ubuntu4 The Linux Kernel Device Mapper use
ii  libgcrypt11           1.2.4-2ubuntu2     LGPL Crypto library - runtime libr
ii  libgpg-error0         1.4-2ubuntu1       library for common error values an
ii  libpopt0              1.10-3build1       lib for parsing cmdline parameters
ii  libuuid1              1.40.2-1ubuntu1    universally unique id library

cryptsetup recommends no packages.

-- no debconf information


-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4





More information about the Pkg-cryptsetup-devel mailing list