Bug#370556: initramfs-tools: does not handle cryptroot-on-lvm properly
(hi again, David!)
On June 6, maks@sternwelten.at said:
> On Mon, Jun 05, 2006 at 05:05:15PM -0400, Daniel Kahn Gillmor wrote:
>
> > [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.
Is my initial line really so wrong? It seems to me that other systems
besides cryptsetup and lvm might care that the root= kernel param
should be correct. That is, that it should match the block device
that will in fact be mounted as the root filesystem. It seems a bit
odd to me to explicitly specify a device that i *don't* want to use as
my root filesystem in the root= kernel parameter...
Here's a cleaner proposal:
The scripts/local-top/lvm has an order of priorities:
0) If the vgup= parameter is passed to the kernel [0], bring up those
comma-delimited volume groups (potentially more than one), in the
order specified. otherwise,
1) Try sourcing /conf/conf.d/lvm from within the initramfs and test
for the presence of $VGUP. If it is present, bring up the
specified (comma-delimited?) volume groups. otherwise,
2) Try to auto-detect the volume group to bring up based on the root=
parameter, as currently auto-detected.
This scheme would let a sophisticated user bring up arbitrary volume
groups at boot time (pre-root filesystem) from the kernel args without
modifying the initrd.
It would also give the lvm hook script a place to note down the proper
Volume Group. A sufficiently sophisticated hook script could
automatically detect the proper underlying volume group needed and
write it to /conf/conf.d/lvm, in the same manner as the cryptroot hook
script writes /conf/conf.d/cryptroot. This eliminates the need for
user-specified entries in the bootloader.
And in the simple, default case, this proposed lvm local-top script
would would behave as it currently does.
The advantages of this proposal as i see them are:
a) The well-known semantics of the root= kernel parameter are not
disturbed.
b) Given a smart enough hooks/lvm, a common user wouldn't need to
write any configuration files or specify any parameters in the
bootloader to have things Just Work with root-on-crypto-on-lvm.
If you think this is worth pursuing, i'm happy to take a crack at it
for your review. And of course, if i'm terribly misguided, please tell
me!
Thanks for your work on this,
--dkg
[0] i just made up the name of kernel parameter "vgup=". I would be
happy for other, better suggestions. Are kernel parameter names
registered anywhere?
Reply to: