From a776485a1cd51b2541877537471e4809889609ef Mon Sep 17 00:00:00 2001 From: Eugene Paskevich Date: Wed, 17 Dec 2008 12:43:46 +0100 Subject: hook-functions: Fix MODULES=dep for lvm LABEL fstab notation The root fs is located on LVM and is described in /etc/fstab with LABEL= notation, which leads to the following mount output for root filesystem: mount | grep "on / " /dev/dm-0 on / type ext3 (rw,noatime,errors=remount-ro) The /dev/dm-0 itself isn't a symlink to /dev/mapper/, therefore root var remains /dev/dm-0 after readlink -f attempt. fix the consequent root detection failure. (closes: #508906) --- hook-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 5b6230a..0863122 100644 --- a/hook-functions +++ b/hook-functions @@ -246,7 +246,8 @@ dep_add_modules() manual_add_modules "${FSTYPE}" # lvm or luks root - if [ "${root#/dev/mapper/}" != "${root}" ]; then + if [ "${root#/dev/mapper/}" != "${root}" ] \ + || [ "${root#/dev/dm-}" != "${root}" ]; then minor=$((0x$(stat --format "%T" ${root}) % 256)) block=$(ls -1 /sys/block/dm-${minor}/slaves | head -n 1) # lvm on luks or luks on lvm -- cgit v1.2.3