summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authorEugene Paskevich <eugene@raptor.kiev.ua>2008-12-17 12:43:46 +0100
committermaximilian attems <maks@debian.org>2008-12-17 12:45:32 +0100
commita776485a1cd51b2541877537471e4809889609ef (patch)
tree6aaa088157693ab1d590fb697141a6fec8a59a98 /hook-functions
parent5180b033fc6172c1354647d74754119d6cd94d76 (diff)
downloadinitramfs-tools-a776485a1cd51b2541877537471e4809889609ef.tar.gz
initramfs-tools-a776485a1cd51b2541877537471e4809889609ef.zip
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)
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions3
1 files changed, 2 insertions, 1 deletions
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