Blame view
init/noinitramfs.c
813 Bytes
873e65bc0 treewide: Replace... |
1 |
// SPDX-License-Identifier: GPL-2.0-only |
c33df4eaa [PATCH] disable i... |
2 3 4 5 6 |
/* * init/noinitramfs.c * * Copyright (C) 2006, NXP Semiconductors, All Rights Reserved * Author: Jean-Paul Saman <jean-paul.saman@nxp.com> |
c33df4eaa [PATCH] disable i... |
7 8 9 10 11 |
*/ #include <linux/init.h> #include <linux/stat.h> #include <linux/kdev_t.h> #include <linux/syscalls.h> |
83ff98c3e init: add an init... |
12 |
#include <linux/init_syscalls.h> |
c33df4eaa [PATCH] disable i... |
13 14 15 16 17 18 19 |
/* * Create a simple rootfs that is similar to the default initramfs */ static int __init default_rootfs(void) { int err; |
83ff98c3e init: add an init... |
20 |
err = init_mkdir("/dev", 0755); |
c33df4eaa [PATCH] disable i... |
21 22 |
if (err < 0) goto out; |
5fee64fcd init: add an init... |
23 |
err = init_mknod("/dev/console", S_IFCHR | S_IRUSR | S_IWUSR, |
c33df4eaa [PATCH] disable i... |
24 25 26 |
new_encode_dev(MKDEV(5, 1))); if (err < 0) goto out; |
83ff98c3e init: add an init... |
27 |
err = init_mkdir("/root", 0700); |
c33df4eaa [PATCH] disable i... |
28 29 30 31 32 33 34 35 36 37 38 |
if (err < 0) goto out; return 0; out: printk(KERN_WARNING "Failed to create a rootfs "); return err; } rootfs_initcall(default_rootfs); |