summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2010-03-24 04:51:49 +0100
committermaximilian attems <maks@debian.org>2010-03-24 04:58:54 +0100
commit2a49aa8a48994806b96003b7ef702d8b5d3f4825 (patch)
tree668d2b05c9ce289d71cc0c3249cbea4304bc35e3 /hook-functions
parenta069caef21d2456a17d2df77f1ab2e84b31074dd (diff)
downloadinitramfs-tools-2a49aa8a48994806b96003b7ef702d8b5d3f4825.tar.gz
initramfs-tools-2a49aa8a48994806b96003b7ef702d8b5d3f4825.zip
hook-functions: let dep_add_modules() recurse into lvm slave devices
When searching for the root block device, there may be multiple device mapper indirections. Fixes MODULES=dep if crypto-root fs has snapshot. (closes: 573761) Signed-off-by: Nikolaus Schulz <microschulz@web.de> Signed-off-by: maximilian attems <maks@debian.org>
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions6
1 files changed, 3 insertions, 3 deletions
diff --git a/hook-functions b/hook-functions
index c5c3f05..189ad78 100644
--- a/hook-functions
+++ b/hook-functions
@@ -284,10 +284,10 @@ dep_add_modules()
|| [ "${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
- if [ "${block#dm-}" != "${block}" ]; then
+ # lvm on luks or luks on lvm, possibly lvm snapshots
+ while [ "${block#dm-}" != "${block}" ]; do
block=$(ls -1 /sys/block/${block}/slaves | head -n 1)
- fi
+ done
# lvm on md or luks on md
if [ "${block#md}" != "${block}" ]; then
block=$(awk "/^${block}/{print substr(\$5, 1, 4); exit}" \