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

Bug#370556: initramfs-tools: does not handle cryptroot-on-lvm properly



On Mon, Jun 05, 2006 at 05:05:15PM -0400, Daniel Kahn Gillmor wrote:
> Package: initramfs-tools
> Version: 0.60
> Severity: normal
> 
> 
> i have a system where the root block device is a LUKS device on top of
> a logical volume:
> 
> [0 root@squeak ~]# lvs
>   LV   VG      Attr   LSize   Origin Snap%  Move Log Copy% 
>   rt   squeak0 -wi-ao 500.00M                              
> [0 root@squeak ~]# cat /etc/crypttab
> # <target name>	<source device>		<key file>	<options>
> croot           /dev/mapper/squeak0-rt  none             luks
> [0 root@squeak ~]# cat /proc/cmdline 
> root=/dev/mapper/croot ro

this is obviously wrong,
current cryptsetup scripts expect the cryptoroot to be set by cryptopts,
try
root=/dev/mapper/squeak0 cryptopts=cryptsource=/dev/mapper/croot

i never found the way those cryptopts are specified to be pretty,
README.initramfs is not yet enlighting on the subject,
adding Davic on cc.

> [0 root@squeak ~]# 
> 
> /usr/share/initramfs-tools/scripts/local-top/lvm sees this and
> thinks that it should:
> 
>   vgchange -ay croot
> 
> when in fact, it should do:
> 
>   vgchange -ay squeak0
> 
> because this is necessary before the cryptroot scripts run.
> 
> i looked at this briefly, but i'm not sure exactly how to patch it
> properly for the general case.  Somehow, we need to feed the system
> with information about which vg needs to be activated, even if that vg
> doesn't (directly) contain the root volume as one of its constituent
> LVs.
> 
> at the moment, for this particular machine, i've got it booting by
> adding a local mkinitramfs script:
> 
> [0 root@squeak ~]# cat /etc/mkinitramfs/scripts/local-top/squeak 
> #!/bin/sh
> 
> PREREQ="lvm"
> 
> prereqs()
> {
> 	echo "$PREREQ"
> }
> 
> case $1 in
> # get pre-requisites
> prereqs)
> 	prereqs
> 	exit 0
> 	;;
> esac
> 
> echo Setting up special volume group for squeak.
> vgchange -ay squeak0
> 
> [0 root@squeak ~]# 
> 
> 
> But this obviously doesn't handle the general case properly (and i
> still get an ugly report that the vgchange -ay croot fails).

hehe ok cool that you managed it that easily to workaround
the boot param passing :)
 
> i don't really want to set $ROOT in any of the conf files, because
> that seems like asking for trouble as other scripts should be treating
> ROOT in ways that should apply to /dev/mapper/croot in the example
> above.
> 
> Proposal:
> 
> What if the end user could supply a list of volume groups that need
> activation in some environment variable stored in conf.d/lvm?  if that
> variable was set, it would be the one used, otherwise, the script
> would try to automatically detect the proper vg.
> 
> If this strategy makes sense, let me know and i'll try to cook up a
> patchset.
> 
> Thanks for maintaining this package!
> 
> 	--dkg

regards

-- 
maks



Reply to: