From: Marco <marco.stornelli@gmail.com>
To: Linux FS Devel <linux-fsdevel@vger.kernel.org>
Cc: Linux Embedded <linux-embedded@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Daniel Walker <dwalker@soe.ucsc.edu>
Subject: [PATCH 04/14] Pramfs: Mounting as root filesystem
Date: Sat, 13 Jun 2009 15:21:27 +0200 [thread overview]
Message-ID: <4A33A7D7.3040008@gmail.com> (raw)
From: Marco Stornelli <marco.stornelli@gmail.com>
Pramfs can be used even as root filesystem.
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
---
diff -uprN linux-2.6.30-orig/init/do_mounts.c linux-2.6.30/init/do_mounts.c
--- linux-2.6.30-orig/init/do_mounts.c 2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30/init/do_mounts.c 2009-06-13 12:50:36.000000000 +0200
@@ -299,6 +299,17 @@ static int __init mount_nfs_root(void)
}
#endif
+#ifdef CONFIG_ROOT_PRAMFS
+static int __init mount_pramfs_root(void)
+{
+ create_dev("/dev/root", ROOT_DEV);
+ if (do_mount_root("/dev/root", "pramfs",
+ 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, ...)
{
@@ -331,6 +342,15 @@ void __init change_floppy(char *fmt, ...
void __init mount_root(void)
{
+#ifdef CONFIG_ROOT_PRAMFS
+ if (MAJOR(ROOT_DEV) == MEM_MAJOR) {
+ if (mount_pramfs_root())
+ return;
+
+ printk(KERN_ERR "VFS: Unable to mount root fs via PRAMFS, trying floppy.\n");
+ ROOT_DEV = Root_FD0;
+ }
+#endif
#ifdef CONFIG_ROOT_NFS
if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
if (mount_nfs_root())
next reply other threads:[~2009-06-13 13:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-13 13:21 Marco [this message]
2009-06-13 23:04 ` [PATCH 04/14] Pramfs: Mounting as root filesystem Arnd Bergmann
2009-06-14 8:21 ` Marco
2009-06-14 9:07 ` David Woodhouse
2009-06-14 16:05 ` Marco
2009-06-14 16:29 ` Marco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A33A7D7.3040008@gmail.com \
--to=marco.stornelli@gmail.com \
--cc=dwalker@soe.ucsc.edu \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).