1 From: Peter Korsgaard <jacmet@sunsite.dk>
3 Make devtmpfs available on (embedded) configurations without SHMEM/TMPFS,
8 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
9 Acked-by: Kay Sievers <kay.sievers@vrfy.org>
10 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
11 --- a/drivers/base/Kconfig
12 +++ b/drivers/base/Kconfig
13 @@ -18,9 +18,9 @@ config UEVENT_HELPER_PATH
16 bool "Maintain a devtmpfs filesystem to mount at /dev"
17 - depends on HOTPLUG && SHMEM && TMPFS
20 - This creates a tmpfs filesystem instance early at bootup.
21 + This creates a tmpfs/ramfs filesystem instance early at bootup.
22 In this filesystem, the kernel driver core maintains device
23 nodes with their default names and permissions for all
24 registered devices with an assigned major/minor number.
25 @@ -33,6 +33,9 @@ config DEVTMPFS
26 functional /dev without any further help. It also allows simple
27 rescue systems, and reliably handles dynamic major/minor numbers.
29 + Notice: if CONFIG_TMPFS isn't enabled, the simpler ramfs
30 + file system will be used instead.
33 bool "Automount devtmpfs at /dev, after the kernel mounted the rootfs"
35 --- a/drivers/base/devtmpfs.c
36 +++ b/drivers/base/devtmpfs.c
38 #include <linux/namei.h>
40 #include <linux/shmem_fs.h>
41 +#include <linux/ramfs.h>
42 #include <linux/cred.h>
43 #include <linux/sched.h>
44 #include <linux/init_task.h>
45 @@ -45,7 +46,11 @@ __setup("devtmpfs.mount=", mount_param);
46 static int dev_get_sb(struct file_system_type *fs_type, int flags,
47 const char *dev_name, void *data, struct vfsmount *mnt)
50 return get_sb_single(fs_type, flags, data, shmem_fill_super, mnt);
52 + return get_sb_single(fs_type, flags, data, ramfs_fill_super, mnt);
56 static struct file_system_type dev_fs_type = {
57 --- a/fs/ramfs/inode.c
58 +++ b/fs/ramfs/inode.c
59 @@ -214,7 +214,7 @@ static int ramfs_parse_options(char *data, struct ramfs_mount_opts *opts)
63 -static int ramfs_fill_super(struct super_block * sb, void * data, int silent)
64 +int ramfs_fill_super(struct super_block *sb, void *data, int silent)
66 struct ramfs_fs_info *fsi;
67 struct inode *inode = NULL;
68 --- a/include/linux/ramfs.h
69 +++ b/include/linux/ramfs.h
70 @@ -20,4 +20,6 @@ extern const struct file_operations ramfs_file_operations;
71 extern const struct vm_operations_struct generic_file_vm_ops;
72 extern int __init init_rootfs(void);
74 +int ramfs_fill_super(struct super_block *sb, void *data, int silent);