summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Michlmayr <tbm@cyrius.com>2010-06-08 21:43:08 +0200
committermaximilian attems <maks@debian.org>2010-06-13 21:03:54 +0200
commite65ee485d9d6f257e70231669a13e05cc45acbb3 (patch)
tree2737369aac83ebe5742b59267dfc81c352a97012
parentcc6077aa62a510e6ce3d72c8a195bb33d141f904 (diff)
downloadinitramfs-tools-e65ee485d9d6f257e70231669a13e05cc45acbb3.tar.gz
initramfs-tools-e65ee485d9d6f257e70231669a13e05cc45acbb3.zip
Produce an error when root cannot be determined with MODULES=dep
A lot of code in dep_add_modules() uses $root. Therefore, produce an error message if we cannot determine the root device. [ error out on this condtion too. -maks ] Signed-off-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: maximilian attems <maks@debian.org>
-rw-r--r--hook-functions6
1 files changed, 6 insertions, 0 deletions
diff --git a/hook-functions b/hook-functions
index 6a6e233..0a6c9b7 100644
--- a/hook-functions
+++ b/hook-functions
@@ -226,6 +226,12 @@ dep_add_modules()
# findout root block device + fstype
eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')"
+ if [ -z "$root" ]; then
+ echo "mkinitramfs: failed to determine root device"
+ echo "mkinitramfs: workaround is MODULES=most"
+ echo "Error please report bug on initramfs-tools and include the output of 'mount'"
+ exit 1
+ fi
# handle ubifs and return since ubifs root is a char device but
# most of the commands below only work with block devices.