From e65ee485d9d6f257e70231669a13e05cc45acbb3 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Tue, 8 Jun 2010 21:43:08 +0200 Subject: 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 Signed-off-by: maximilian attems --- hook-functions | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hook-functions') 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. -- cgit v1.2.3