[pkg-cryptsetup-devel] Bug#546610: cryptsetup: root= cmdline call is not honoured by initrd in crypto+lvm (Was initramfs-tools: ...)

Agustin Martin agmartin at debian.org
Tue Sep 7 14:50:05 UTC 2010


On Mon, Nov 16, 2009 at 04:26:31PM +0100, Agustin Martin wrote:
> On Fri, Sep 25, 2009 at 04:31:27PM +0200, Agustin Martin wrote:
> > On Thu, Sep 24, 2009 at 09:29:58PM +0200, Jonas Meurer wrote:
> > > 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.
> 
> Played a bit more with this. See attached patch. It is only tested in my
> box, and not extensively (that is, fully untested under lilo+lvm), but it
> may be useful.

I noticed a typo with the patch that will add extra comma (checks for
cmdline_cryptopts, not for $cmdline_cryptopts) but, besides of that I 
have been used mentioned patch for a while and seems to have worked well
in my grub-booted box.

I recently bought a netbook and thought it was time to play with lilo and 
see how it behaves when lilo is used as boot loader. And it fails, not 
finding root partition.

The problem is as follows: 

lilo passes root argument to command line in major/minor codes form 
(e.g., root=fd01), which current script cannot parse and associate to a 
real device. Furthermore, these major/minor numbers may sometimes change 
(See #398957) breaking things more.

More details about this problem in
    
  http://bugs.debian.org/398957

I have been thinking about how to modify my previous changes to work around 
this problem for simple lilo-booted systems using crypto. 
    
This change implements a check in root argument. If it seems to contain an
absolute path (starts by '/'), is passed to the script for further 
processing. Otherwise is ignored.
    
People wanting lilo to really use full path mechanism for root should pass 
it by means of the append option, that is, in /etc/lilo.conf, instead of
    
 root=/dev/mapper/vg-root
    
use
    
 append="root=/dev/mapper/vg-root"
    
so full absolute path is preserved.

Patch with my current changes is attached. Seems to work in a basic
lilo-booted box and in my usual grub-booted box. Not tested in syslinux.

Cheers,

-- 
Agustin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initramfs_cryptroot-script.diff
Type: text/x-diff
Size: 1392 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20100907/e4cb7e2e/attachment.diff>


More information about the pkg-cryptsetup-devel mailing list