/*1* init/noinitramfs.c2*3* Copyright (C) 2006, NXP Semiconductors, All Rights Reserved4* Author: Jean-Paul Saman <[email protected]>5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License as published by8* the Free Software Foundation; version 2 of the License.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA18*/19#include <linux/init.h>20#include <linux/stat.h>21#include <linux/kdev_t.h>22#include <linux/syscalls.h>2324/*25* Create a simple rootfs that is similar to the default initramfs26*/27static int __init default_rootfs(void)28{29int err;3031err = sys_mkdir((const char __user __force *) "/dev", 0755);32if (err < 0)33goto out;3435err = sys_mknod((const char __user __force *) "/dev/console",36S_IFCHR | S_IRUSR | S_IWUSR,37new_encode_dev(MKDEV(5, 1)));38if (err < 0)39goto out;4041err = sys_mkdir((const char __user __force *) "/root", 0700);42if (err < 0)43goto out;4445return 0;4647out:48printk(KERN_WARNING "Failed to create a rootfs\n");49return err;50}51rootfs_initcall(default_rootfs);525354