Bug#678696: Event based block device handling (fixes USB and nested devices problem)
Package: initramfs-tools
Version: 0.106 Severity: wishlist Tags: patch Hi, the attached patch adds an event based loop for block devices to the init script. New blockdevices are recorded in /run/initramfs/block-events by an udev rule as they appear. The init script repeadately waits for that and then calls /scripts/local-block/* with a list of new devices storedin NEWDEVS until $ROOT and $resume (if set) exists or a timeout is reached. This fixes the problem that USB devices take too long to be discovered and crypto, raid, lvm or multipath can't be started on them. It also adds support for arbitrary nestings of them, e.g. raid5 over raid1. For the event loop I needed the $resume device translated to the device node earlier. This was previously done in scripts/local-premount/resume. It was essentially the same code used to translate the $ROOT so I created a new function translate_device() in script/functions and used that for both $ROOT and $resume. Note: hooks/block-event and scripts/block-event are executable, not represented in the patch. 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 initramfs-tools depends on: ii cpio 2.11-7 ii klibc-utils 2.0~rc3-1 ii module-init-tools 3.16-1 ii udev 175-3.1 Versions of packages initramfs-tools recommends: ii busybox 1:1.19.3-5 Versions of packages initramfs-tools suggests: ii bash-completion 1:1.99-3 -- no debconf information |
Bug#678696: Event based block device handling (fixes USB and nested devices problem)
Hi,
I filed bugs for cryptsetup, lvm, mdadm and multipath-tools to support this solution (i.e. provide scripts/local-block/ sniplets) [#678688 #678691 #678692 #678693]. If anyone wants to test this prior to those packages being fixed the scriplets below can be used. MfG Goswin ==> scripts/local-block/cryptoroot <== #!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case $1 in # get pre-requisites prereqs) prereqs exit 0 ;; esac if [ -x /scripts/local-top/cryptoroot ]; then exec /scripts/local-top/cryptoroot fi ==> scripts/local-block/lvm2 <== #!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case $1 in # get pre-requisites prereqs) prereqs exit 0 ;; esac if [ -x /scripts/local-top/lvm2 ]; then exec /scripts/local-top/lvm2 fi ==> scripts/local-block/mdadm <== #!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case $1 in # get pre-requisites prereqs) prereqs exit 0 ;; esac if [ -x /scripts/local-top/mdadm ]; then exec /scripts/local-top/mdadm fi -- To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org Archive: http://lists.debian.org/87obo9byp5.fsf@frosties.localnet |
| All times are GMT. The time now is 02:26 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.