summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authorS. Sakar <serkan.sakar@gmx.net>2008-09-21 08:55:09 +0200
committermaximilian attems <maks@debian.org>2008-12-18 17:41:46 +0100
commitce1c64736aa741df012e93ca0bae5a9399c58909 (patch)
tree52ef8a797a55c7717e78f3f0d8bf82845adeb430 /hook-functions
parent3ad23cbea9da45fecb931b2fec9c79edc23004a1 (diff)
downloadinitramfs-tools-ce1c64736aa741df012e93ca0bae5a9399c58909.tar.gz
initramfs-tools-ce1c64736aa741df012e93ca0bae5a9399c58909.zip
hook-functions: MODULES=dep fix encrypted loop device
i've set up an encrypted loop-AES device as the root partition (boot paramter dev=/dev/loopX) and update-initramfs fails with : mkinitramfs: missing loop root /dev/loop2 /sys entry
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions5
1 files changed, 5 insertions, 0 deletions
diff --git a/hook-functions b/hook-functions
index 0863122..6a68910 100644
--- a/hook-functions
+++ b/hook-functions
@@ -278,6 +278,11 @@ dep_add_modules()
elif [ "${root#/dev/ida/}" != "${root}" ]; then
block=${root#/dev/ida/*}
block="ida!${block%p*}"
+ # loop root /dev/loopX
+ elif [ "${root#/dev/loop}" != "${root}" ]; then
+ root=${root#/dev/}
+ block=$(losetup -a \
+ | awk "/${root}/{print substr(\$3, 7, 3); exit}")
# classical root device
else
block=${root#/dev/}