summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@debian.org>2008-10-14 18:04:09 -0400
committermaximilian attems <maks@debian.org>2009-02-17 15:25:56 +0100
commit13df18822a697053e10e8f42397e5237a15590f6 (patch)
tree28ef8a28d1d256dd96c820cb6e3c0ad72246b3af /scripts
parent06f880229b8f632cbfa699c7af9beee13d0dddea (diff)
downloadinitramfs-tools-13df18822a697053e10e8f42397e5237a15590f6.tar.gz
initramfs-tools-13df18822a697053e10e8f42397e5237a15590f6.zip
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 <dilinger@debian.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/local14
1 files changed, 12 insertions, 2 deletions
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