Bug#397651: [Pkg-cryptsetup-devel] Bug#397651: cryptsetup: failed to determine cipher modules to load for /dev/mapper/bee--sata-root

David Härdeman david at hardeman.nu
Wed Nov 8 22:25:40 CET 2006


Hi,

and thanks for the bug reports.

On Wed, Nov 08, 2006 at 05:16:56PM +0100, Loïc Minier wrote:
> I'm getting this warning during "update-initramfs -u":
> cryptsetup: failed to determine cipher modules to load for /dev/mapper/bee--sata-root
>...
> I only use cryptsetup for crypted partitions on USB keys (LUKS), but I
> do have a regular LVM setup for swap, /, and other partitions.
>
> I attach an "update-initramfs -u" run with set -x in the hook.
>
> The failure is caused by add_device() calling get_lvm_deps() which
> returns 1.
>
> The misleading comment "is it lvm?" suggests that "get_lvm_deps
> "$nodes"" on line 222 is a test for LVM devices.  I think it is a test
> on whether $nodes is (are) *backed up* by a LVM device, but I'm not
> sure.

It checks whether the "$nodes" device (which is a 
/dev/mapper/<something> device but not listed in /etc/crypttab) depends 
on other device-mapper devices (i.e. whether it is a lvm device backed 
by dm-crypt devices).

> It would be nice if you could pass a testsuite for cryptsetup to
> prevent regressions.

Yes it would. But since the initramfs hook/script looks at details of 
the running system, it'd be quite hard to do. I usually try to do a 
couple of different test runs (esp. using qemu and d-i), but the 
2:1.0.4-3 to 2:1.0.4-4 upgrade included pretty big changes to the 
initramfs scripts to allow for more than one device (to support 
resume-from-encrypted swap). So unfortunately some bugs crept in...sorry 
about that.

Would you be willing to test the attached patch? It should solve both 
bugs you reported today.

-- 
David Härdeman
-------------- next part --------------
Index: initramfs-cryptroot-hook
===================================================================
--- initramfs-cryptroot-hook	(revision 325)
+++ initramfs-cryptroot-hook	(working copy)
@@ -218,10 +218,11 @@
 
 	# Can we find this node in crypttab
 	if ! node_is_in_crypttab "$nodes"; then
-		# It is a /dev/mapper node but not in crypttab, is it lvm?
-		lvmnodes=$(get_lvm_deps "$nodes") || return 1
+		# It is a /dev/mapper node but not in crypttab,
+		# perhaps it is a crypto-backed lvm device?
+		lvmnodes=$(get_lvm_deps "$nodes") || return 0
 
-		# It is a lvm device!
+		# Yep
 		lastopts="lvm=$nodes"
 		nodes="$lvmnodes"
 	fi
@@ -297,8 +298,7 @@
 	modules=$(add_device "$dev")
 
 	if [ -z "$modules" ]; then
-		echo "cryptsetup: failed to determine cipher modules to load for $dev" >&2
-		exit 1
+		continue
 	fi
 
 	for mod in $modules; do


More information about the Pkg-cryptsetup-devel mailing list