summaryrefslogtreecommitdiff
path: root/init/main.c
diff options
context:
space:
mode:
authorJavier Viguera <javier.viguera@digi.com>2010-02-25 14:21:25 +0100
committerJavier Viguera <javier.viguera@digi.com>2010-02-25 14:21:25 +0100
commit0825c0b927e23a06706731c5998b51f090f51727 (patch)
treeed0ba939d449d16ce3b3b8d910d2140d9abac428 /init/main.c
parente414ac041ecab9849715922edc2c0080613bf4af (diff)
init: create some device nodes on boot
Mount a TMPFS onto /dev and create console and null device nodes in it. Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index 11f4f145be3f..4c6c9dbf65bc 100644
--- a/init/main.c
+++ b/init/main.c
@@ -843,6 +843,12 @@ static noinline int init_post(void)
system_state = SYSTEM_RUNNING;
numa_default_policy();
+#ifdef CONFIG_TMPFSDEV
+ sys_mount("tmpfsdev", "/dev", "tmpfs", 0, "size=64k");
+ sys_mknod("/dev/console", S_IFCHR | 0600, new_encode_dev(MKDEV(5, 1)));
+ sys_mknod("/dev/null", S_IFCHR | 0600, new_encode_dev(MKDEV(1, 3)));
+#endif
+
if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
printk(KERN_WARNING "Warning: unable to open an initial console.\n");