From 2a0fee1aa8aa8dabc69380f861e7d1c8d35ec5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Delawarde?= Date: Wed, 25 Feb 2009 14:04:53 +0100 Subject: hook-functions: MODULES=dep fix for luks over cciss devices I needed to run update-initramfs w/ MODULES=dep (for some 15M BIOS size limitation w/ lilo on an HP server), turns out that I found the same bug as #507619 (please refer to it for details), except that I have a LUKS format over the cciss device. As bug #507619 describes: "dep_add_modules() expects to find a /sys/block/cciss/c0d0p file, but it should be trying /sys/block/cciss!c0d0" It also mentions: "fyi, I suspect this may also apply to old-style smart array devices, where device names are similar, but use 'ida' intead of 'cciss' - e.g. /dev/ida/c0d0p1." The following patch fixes it for me (on cciss) and should also fix it for ida devices. [ patch got checked and tested life on #debian-boot channel, see below -maks ] fixed warning: mkinitramfs: missing cciss!c0d0p2 root /dev/mapper/quakelive-root /sys entry of course, since the new value of block comes out of /sys/block/dm-${minor}/slaves, it makes sense that it would already be in sysfs syntax. Tested-by: Timothee Besset --- hook-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 4b69827..2368b8d 100644 --- a/hook-functions +++ b/hook-functions @@ -259,7 +259,13 @@ dep_add_modules() block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \ /proc/mdstat) fi - block=${block%%[0-9]*} + # luks or lvm on cciss or ida + if [ "${block#cciss}" != "${block}" ] \ + || [ "${block#ida}" != "${block}" ]; then + block="${block%p*}" + else + block=${block%%[0-9]*} + fi # md root new naming scheme /dev/md/X elif [ "${root#/dev/md/}" != "${root}" ]; then root=${root#/dev/md/} -- cgit v1.2.3