[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#499666: Allow encrypted loop device as root partition



Package: initramfs-tools
Version: 0.92j
Severity: wishlist
Tags: patch

hi,
i've set up an encrypted loop-AES device as the root partition (boot
paramter dev=/dev/loopX) and update-initramfs fails with :

mkinitramfs: missing loop root /dev/loop2 /sys entry
mkinitramfs: workaround is MODULES=most
mkinitramfs: Error please report the bug

The attached patch resolves this issue.

Regards,
Serkan

--- hook-functions	2008-09-21 07:36:56.000000000 +0200
+++ hook-functions.new	2008-09-21 08:12:45.000000000 +0200
@@ -269,6 +269,10 @@ dep_add_modules()
 		root=${root#/dev/}
 		block=$(awk "/^${root}/{print substr(\$5, 1, 3); exit}" \
 			/proc/mdstat)
+	# loop root /dev/loopX
+	elif [ "${root#/dev/loop}" != "${root}" ]; then
+		root=${root#/dev/}
+		block=$(losetup -a | awk "/${root}/{print substr(\$3, 7, 3); exit}")
 	# classical root device
 	else
 		block=${root#/dev/}

Reply to: