[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#582858: initramfs-tools: MODULES=dep fails when / is ubifs

* Martin Michlmayr <tbm@cyrius.com> [2010-06-08 21:31]:
> This is the output from 'mount', and here's what i-t does:
>     eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')"
> it looks for something with /dev/ in it.  In your case, this does't
> match so root= and FSTYPE= are empty.  I think we should simply add a
> check to i-t at this point to produce an error when $root is empty.

[PATCH] 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.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>

diff --git a/hook-functions b/hook-functions
index 6a6e233..154ae3e 100644
--- a/hook-functions
+++ b/hook-functions
@@ -226,6 +226,11 @@ 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'"
+	fi
 	# handle ubifs and return since ubifs root is a char device but
 	# most of the commands below only work with block devices.

Martin Michlmayr

Reply to: