summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:24:48 -0600
committerQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:24:48 -0600
commitb4d071c2e403c2279e9e1b7216e22cdbe12d43c7 (patch)
tree108527ad66e42338e481edbdd3876dbc227cc4aa /init
parentcfaf263c60e94bf4fe4005bb7281df144636ba42 (diff)
Bugzilla 776 - FS-001 XIP from cramfs - Community patch
Patch for Bugzilla 776 - FS-001 XIP from cramfs Origin: http://lwn.net/Articles/235532/ Description: Venerable cramfs fs Linear XIP patch originally from MontaVista, used in the embedded Linux community for years, updated for 2.6.21. Tested on several systems with NOR Flash. PXA270, TI OMAP2430, ARM Versatile and Freescale iMX31ADS. Portions Copyright Shane Nay and Robert Leslie <rob@mars.org> http://www.bitshrine.org/gpp/linux-2.6.22-mx-Bugzilla-776-FS-001-XIP-from-cramfs-Commun.patch
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 4efa1e5385e3..cf317e04bbcf 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -360,6 +360,16 @@ static int __init mount_nfs_root(void)
}
#endif
+#ifdef CONFIG_ROOT_CRAMFS_LINEAR
+static int __init mount_cramfs_linear_root(void)
+{
+ create_dev("/dev/root", ROOT_DEV);
+ if (do_mount_root("/dev/root","cramfs",root_mountflags,root_mount_data) == 0)
+ return 1;
+ return 0;
+}
+#endif
+
#if defined(CONFIG_BLK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD)
void __init change_floppy(char *fmt, ...)
{
@@ -392,6 +402,13 @@ void __init change_floppy(char *fmt, ...)
void __init mount_root(void)
{
+#ifdef CONFIG_ROOT_CRAMFS_LINEAR
+ if (ROOT_DEV == MKDEV(0, 0)) {
+ if (mount_cramfs_linear_root())
+ return;
+ printk (KERN_ERR "VFS: Unable to mount linear cramfs root.\n");
+ }
+#endif
#ifdef CONFIG_ROOT_NFS
if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
if (mount_nfs_root())