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

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



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
[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).

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



-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages initramfs-tools depends on:
ii  busybox                       1:1.01-4   Tiny utilities for small and embed
ii  cpio                          2.6-11     GNU cpio -- a program to manage ar
ii  klibc-utils                   1.3.19-2   small statically-linked utilities 
ii  module-init-tools             3.2.2-2    tools for managing Linux kernel mo
ii  udev                          0.091-2    /dev/ and hotplug management daemo

initramfs-tools recommends no packages.

-- no debconf information



Reply to: