[pkg-cryptsetup-devel] Bug#678692: Please add a /usr/share/initramfs-tools/scripts/local-block/ script

Goswin von Brederlow goswin-v-b at web.de
Sat Jun 23 18:58:15 UTC 2012


Package: cryptsetup
Version: 2:1.3.0-3
Severity: wishlist

Hi,

the initramfs has a number of scripts to configure lvm, raid or crypto
devices (provided by their respective packages). Those script are run
once in fixed order allowing for certain combinations of them,
e.g. lvm on crypto. But some combinations won't work, especially
nested setups, e.g. raid on raid.

Another problem is that block devices might take a long time to
appear, specifically USB drivers take so long to load and detect an
USB block device that by that time the scripts for crypto, lvm and
raid have often already been run. Booting from LVM on an USB block
device becomes a game of chance or is simply impossible without
manually adding rootdelay=xx to the boot options.


I'm preparing a patch for initramfs-tools to solve this problem. This
involves a udev rule and a simple loop in /init that waits for new
block devices to appear and then runs all scripts in
/scripts/local-block/ until the devices for $ROOT and $resume appear
or a timeout is reached.

What I would like from your side is to add a script to
    /usr/share/initramfs-tools/scripts/local-block/

The scripts there will be called with the usual initramfs environment
variables set but also with NEWDEVS containing a list of new devices,
all devices discovered since the last time the script was called. The
script should then configure crypto / lvm / md for those devices as
appropriate.

Note: The scripts are called at least once. If udev is broken,
terribly slow or simply not present in the initramfs then NEWDEVS can
be empty. In that case all devices in /dev/ should be considered.

Note2: It is possible to simply copy your local-top script to
local-block, remove the prerequisites of the script and ignore NEWDEVS
completly.

Note3: Please do not delete the local-top script just yet so that you
remain compatible to the old and new version of initramfs. There is
little harm in running the script in local-top an extra time.

MfG
	Goswin

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages cryptsetup depends on:
ii  debconf [debconf-2.0]  1.5.42
ii  dmsetup                2:1.02.67-2
ii  libc6                  2.13-32
ii  libcryptsetup1         2:1.3.0-3
ii  libpopt0               1.16-7

cryptsetup recommends no packages.

Versions of packages cryptsetup suggests:
ii  busybox                                 1:1.19.3-5
ii  dosfstools                              3.0.12-1
ii  initramfs-tools [linux-initramfs-tool]  0.101
ii  liblocale-gettext-perl                  1.05-7+b1
ii  udev                                    175-3.1

-- debconf information excluded





More information about the pkg-cryptsetup-devel mailing list