hey,

On 10/06/2009 Evgeni Golov wrote:
> I have the following setup on my laptop:
> hda1 plain root
> hda2 luks with lvm ontop
> lvm1 swap
> lvm2 home
> 
> I use the passdev script and LABELs/UUIDs everywhere.
> 
> fstab:
> LABEL=root    /               ext3            noatime,errors=remount-ro       
> 0       1
> LABEL=swap    none            swap            sw              0       0
> LABEL=home    /home           ext3            noatime         0       0
> 
> crypttab:
> crypt UUID=44dd50d4-e9a0-4bbf-8ba3-29434e77dba3 \
>       /dev/disk/by-label/usbext3:/keyfile-chiisai.luks \
>       luks,keyscript=/lib/cryptsetup/scripts/passdev,tries=1
> 
> /proc/cmdline:
> BOOT_IMAGE=/boot/vmlinuz-2.6.30-rc8-686 
> root=UUID=be7763cd-158a-4d70-bfb7-557363fb968b ro quiet splash hpet=force
> 
> My swap can be accessed via /dev/mapper/vg--crypt-swap or /dev/dm-1.
> uswsusp enters /dev/dm-1 in /etc/uswsusp.conf and that seems to break 
> cryptsetup
> (I think in canonical_device()). When I manually add /dev/mapper/... to
> /etc/initramfs-tools/conf.d/resume everything is ok, and my system can resume,
> but when it's not there, cryptsetup thinks it has nothing to do, does not copy
> passdev and conf.d/cryptroot to the initramfs and my system cant resume.
> 
> Is there anything cryptsetup could do about this?

please test the attached (yet untested) patch and see whether that fixes
the bug for you.

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