On Thu, Sep 24, 2009 at 09:29:58PM +0200, Jonas Meurer wrote:
> hello,
> 
> On 17/09/2009 Agustin Martin wrote:
> > Rebuilt 2.6.29 initrd in current sid and problem reappeared.
> > 
> > However seems I found the package responsible for the problem, cryptsetup.
> > If I install lenny cryptsetup (1.0.6-7) and rebuild he initrd things work
> > again as expected. However, if I install previous (1.0.7-1) or current
> > (1.0.7-2) cryptsetup problem reappears.
> > 
> > Reassigning,
> 
> first, thanks for the bugreport. the reason for change of bahaviour is a
> line in /usr/share/initramfs/scripts/local-top/cryptroot that sets $ROOT
> to $NEWROOT in /conf/params.conf in the initramfs:
> 
> 302:                  if [ "$cryptrootdev" = "yes" ]; then
> 303:                          # required for lilo to find the root device
> 304:                          echo "ROOT=$NEWROOT" >> /conf/param.conf
> 305:                  fi
> 
> commenting out these lines and regenerating the initramfs
> (update-initramfs -u) afterwards should fix it. could you verify that?

Working well with that change. Thanks for debugging.

> unfortunately these lines are required in order to support setups with
> cryptroot on lvm and lilo as bootloader. thus i don't know what to do
> about that bug yet. will have to do further investigation and testing
> with lilo as bootloader first.

I have been playing with attached patch. However, I have just noticed that
it does not play nicely with more than one cryptopts= entry in cmdline. 
Since I am not familiar with the code, I cannot discard other drawbacks.

I am thinking about putting another cmdline parsing loop for root=
before your pristine current loop for crypopts=. Another possibility may
be keep a single loop and assign cryptopts match if $cryptopts is empty
or concatenate to its previous value with a separating whitespace
otherwise, or simply use again $found to signal crypopts= presence. But you
know the code much better than me.

Hope this helps,

-- 
Agustin
--- cryptroot.orig	2009-09-25 12:06:15.000000000 +0200
+++ cryptroot	2009-09-25 15:45:47.000000000 +0200
@@ -298,7 +298,7 @@
 				return 1
 			fi
 
-			NEWROOT="/dev/mapper/$cryptlvm"
+			NEWROOT=${cmdline_root=/dev/mapper/$cryptlvm}
 			if [ "$cryptrootdev" = "yes" ]; then
 				# required for lilo to find the root device
 				echo "ROOT=$NEWROOT" >> /conf/param.conf
@@ -326,18 +326,22 @@
 #
 
 # Do we have any kernel boot arguments?
-found=''
+cmdline_cryptopts=''
+cmdline_root=''
 for opt in $(cat /proc/cmdline); do
 	case $opt in
 	cryptopts=*)
-		found=yes
-		setup_mapping "${opt#cryptopts=}"
+	        cmdline_cryptopts="${opt#cryptopts=}"
 		;;
+	root=*)
+	        cmdline_root="${opt#root=}"
+	        ;;
 	esac
 done
 
-if [ -n "$found" ]; then
-	exit 0
+if [ -n "$cmdline_cryptopts" ]; then
+    setup_mapping "$cmdline_cryptopts"
+    exit 0
 fi
 
 # Do we have any settings from the /conf/conf.d/cryptroot file?

Reply via email to