From 13df18822a697053e10e8f42397e5237a15590f6 Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Tue, 14 Oct 2008 18:04:09 -0400 Subject: allow root=mtd0 to be used; skip root checks if ROOT doesn't start with /dev. The attached patch is needed for booting with root=mtd0. Basically, the init scripts assume the root device should have a special device file somewhere, and if not will wait for it to appear. This patch changes it so that it only waits for a device file to appear if $ROOT starts with "/dev". In the case of things like ROOT=LABEL=foo, the init scripts will translate that to a device. With ROOT=mtd0, the init scripts will not check for a device, and will successfully mount the root filesystem. Signed-off-by: Andres Salomon --- scripts/local | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/local b/scripts/local index 85d62af..b6bd192 100644 --- a/scripts/local +++ b/scripts/local @@ -24,8 +24,7 @@ get_fstype () return ${RET} } -# Parameter: Where to mount the filesystem -mountroot () +pre_mountroot() { [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top" run_scripts /scripts/local-top @@ -33,6 +32,12 @@ mountroot () wait_for_udev 10 + # Don't wait for a root device that doesn't have a corresponding + # device in /dev (ie, mtd0) + if [ "${ROOT#/dev}" = "${ROOT}" ]; then + return + fi + # If the root device hasn't shown up yet, give it a little while # to deal with removable devices if [ ! -e "${ROOT}" ] || ! $(get_fstype "${ROOT}" >/dev/null); then @@ -94,6 +99,11 @@ mountroot () echo " - Missing modules (cat /proc/modules; ls /dev)" panic "ALERT! ${ROOT} does not exist. Dropping to a shell!" done +} + +mountroot() +{ + pre_mountroot # Get the root filesystem type if not set if [ -z "${ROOTFSTYPE}" ]; then -- cgit v1.2.3