[Pkg-cryptsetup-devel] Bug#445189: cryptsetup: Please support UUIDs in /etc/fstab and /etc/crypttab

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


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

Hi there,

In ubuntu we generally use UUIDs only in /etc/fstab. This currently
breaks the cryptroot hook in a way, that the initramfs-tool hook fails
to detect the root filesystem in the debian package.

In related change, I modified partman-crypto to write out the 2nd cloumn
using UUIDs. You can look at that patch here:

http://patches.ubuntu.com/p/partman-crypto/partman-crypto_21ubuntu2.patch

Martin Pitt and myself have worked this week on this issue in
ubuntu, so that you can have UUIDs in both /etc/fstab and
/etc/crypttab!

You can find the complete patch to the ubuntu package here:
http://patches.ubuntu.com/c/cryptsetup/cryptsetup_2:1.0.5-2ubuntu1.patch

Find the relevant parts for this issue below:

diff -pruN 2:1.0.5-2/debian/initramfs/cryptroot-hook 2:1.0.5-2ubuntu1/debian/initramfs/cryptroot-hook
--- 2:1.0.5-2/debian/initramfs/cryptroot-hook	2007-10-03 00:08:07.000000000 +0100
+++ 2:1.0.5-2ubuntu1/debian/initramfs/cryptroot-hook	2007-10-03 00:07:57.000000000 +0100
@@ -66,7 +66,7 @@ get_resume_devices() {
 
 	# initramfs-tools
 	if [ -e /etc/initramfs-tools/conf.d/resume ]; then
-		device=$(sed -rn 's/^RESUME[[:space:]]+=[[:space:]]+// p' /etc/initramfs-tools/conf.d/resume)
+		device=$(sed -rn 's/^RESUME[[:space:]]*=[[:space:]]*// p' /etc/initramfs-tools/conf.d/resume)
 		if [ -n "$device" ]; then
 			candidates="$candidates $device"
 		fi
@@ -123,6 +123,11 @@ get_lvm_deps() {
 	local node deps maj min depnode
 	node="$1"
 
+	uuid_resolv="/dev/disk/by-uuid/${node#UUID=}"
+	if [ -L "$uuid_resolv" ]; then
+		node=$(readlink -f "$uuid_resolv")
+	fi
+
 	if [ -z $node ]; then
 		echo "cryptsetup: WARNING: get_lvm_deps - invalid arguments" >&2
 		return 1
@@ -289,7 +300,10 @@ add_device() {
 	# Check that it is a node under /dev/mapper/
 	nodes="${nodes#/dev/mapper/}"
 	if [ "$nodes" = "$1" ]; then
-		return 0
+		# check that it is a UUID
+		if [ "${nodes#UUID=}" = "$nodes" ]; then
+			return 0
+		fi
 	fi
 
 	# Can we find this node in crypttab


-- 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