aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 74cc96bffbdd7..be6d14733ba02 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -591,6 +591,10 @@ void __init mount_root(char *root_device_name)
case Root_CIFS:
mount_cifs_root();
break;
+ case Root_Generic:
+ mount_root_generic(root_device_name, root_device_name,
+ root_mountflags);
+ break;
case 0:
if (root_device_name && root_fs_names &&
mount_nodev_root(root_device_name) == 0)
@@ -602,6 +606,14 @@ void __init mount_root(char *root_device_name)
}
}
+static dev_t __init parse_root_device(char *root_device_name)
+{
+ if (!strncmp(root_device_name, "mtd", 3) ||
+ !strncmp(root_device_name, "ubi", 3))
+ return Root_Generic;
+ return name_to_dev_t(root_device_name);
+}
+
/*
* Prepare the namespace - decide what/where to mount, load ramdisks, etc.
*/
@@ -624,15 +636,8 @@ void __init prepare_namespace(void)
md_run_setup();
- if (saved_root_name[0]) {
- if (!strncmp(saved_root_name, "mtd", 3) ||
- !strncmp(saved_root_name, "ubi", 3)) {
- mount_root_generic(saved_root_name, saved_root_name,
- root_mountflags);
- goto out;
- }
- ROOT_DEV = name_to_dev_t(saved_root_name);
- }
+ if (saved_root_name[0])
+ ROOT_DEV = parse_root_device(saved_root_name);
if (initrd_load(saved_root_name))
goto out;