1873e65bcSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 2c33df4eaSJean-Paul Saman /* 3c33df4eaSJean-Paul Saman * init/noinitramfs.c 4c33df4eaSJean-Paul Saman * 5c33df4eaSJean-Paul Saman * Copyright (C) 2006, NXP Semiconductors, All Rights Reserved 6c33df4eaSJean-Paul Saman * Author: Jean-Paul Saman <jean-paul.saman@nxp.com> 7c33df4eaSJean-Paul Saman */ 8c33df4eaSJean-Paul Saman #include <linux/init.h> 9c33df4eaSJean-Paul Saman #include <linux/stat.h> 10c33df4eaSJean-Paul Saman #include <linux/kdev_t.h> 11c33df4eaSJean-Paul Saman #include <linux/syscalls.h> 1283ff98c3SChristoph Hellwig #include <linux/init_syscalls.h> 13*b234ed6dSRasmus Villemoes #include <linux/umh.h> 14c33df4eaSJean-Paul Saman 15c33df4eaSJean-Paul Saman /* 16c33df4eaSJean-Paul Saman * Create a simple rootfs that is similar to the default initramfs 17c33df4eaSJean-Paul Saman */ default_rootfs(void)18c33df4eaSJean-Paul Samanstatic int __init default_rootfs(void) 19c33df4eaSJean-Paul Saman { 20c33df4eaSJean-Paul Saman int err; 21c33df4eaSJean-Paul Saman 22*b234ed6dSRasmus Villemoes usermodehelper_enable(); 2383ff98c3SChristoph Hellwig err = init_mkdir("/dev", 0755); 24c33df4eaSJean-Paul Saman if (err < 0) 25c33df4eaSJean-Paul Saman goto out; 26c33df4eaSJean-Paul Saman 275fee64fcSChristoph Hellwig err = init_mknod("/dev/console", S_IFCHR | S_IRUSR | S_IWUSR, 28c33df4eaSJean-Paul Saman new_encode_dev(MKDEV(5, 1))); 29c33df4eaSJean-Paul Saman if (err < 0) 30c33df4eaSJean-Paul Saman goto out; 31c33df4eaSJean-Paul Saman 3283ff98c3SChristoph Hellwig err = init_mkdir("/root", 0700); 33c33df4eaSJean-Paul Saman if (err < 0) 34c33df4eaSJean-Paul Saman goto out; 35c33df4eaSJean-Paul Saman 36c33df4eaSJean-Paul Saman return 0; 37c33df4eaSJean-Paul Saman 38c33df4eaSJean-Paul Saman out: 39c33df4eaSJean-Paul Saman printk(KERN_WARNING "Failed to create a rootfs\n"); 40c33df4eaSJean-Paul Saman return err; 41c33df4eaSJean-Paul Saman } 42c33df4eaSJean-Paul Saman rootfs_initcall(default_rootfs); 43