On 06/09/2009 Jonas Meurer wrote:
> so i guess that canonical_devie() needs to check whether the device is
> something like /dev/dm-* and transform that into the corresponding
> /dev/mapper/* device/symlink before returning.

please try the attached (yet untested) patch and see whether that fixes
your problem.

greetings,
 jonas
--- /usr/share/initramfs-tools/hooks/cryptroot.orig
+++ /usr/share/initramfs-tools/hooks/cryptroot
@@ -301,6 +301,15 @@
 		dev=$(readlink -e "$dev")
 	fi
 
+	if [ "x${dev%/dev/dm-*}" = "x" ]; then
+		# try to detect corresponding symlink in /dev/mapper/
+		for dmdev in /dev/mapper/*; do
+			if [ "$(readlink -e "$dmdev")" = "$dev" ]; then
+				dev="$dmdev"
+			fi
+		done
+	fi
+
 	altdev="${dev#/dev/mapper/}"
 	if [ "$altdev" != "$dev" ]; then
 		echo "$altdev"

Attachment: signature.asc
Description: Digital signature

Reply via email to