]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - init/do_mounts_initrd.c
kernel/do_mount_initrd: move real_root_dev sysctls to its own file
[thirdparty/linux.git] / init / do_mounts_initrd.c
index 533d81ed74d4af1db197ad9c8ae10e54c0493d20..327962ea354c096fd56e4b7aa03cc5928440279f 100644 (file)
 
 unsigned long initrd_start, initrd_end;
 int initrd_below_start_ok;
-unsigned int real_root_dev;    /* do_proc_dointvec cannot handle kdev_t */
+static unsigned int real_root_dev;     /* do_proc_dointvec cannot handle kdev_t */
 static int __initdata mount_initrd = 1;
 
 phys_addr_t phys_initrd_start __initdata;
 unsigned long phys_initrd_size __initdata;
 
+#ifdef CONFIG_SYSCTL
+static struct ctl_table kern_do_mounts_initrd_table[] = {
+       {
+               .procname       = "real-root-dev",
+               .data           = &real_root_dev,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = proc_dointvec,
+       },
+       { }
+};
+
+static __init int kernel_do_mounts_initrd_sysctls_init(void)
+{
+       register_sysctl_init("kernel", kern_do_mounts_initrd_table);
+       return 0;
+}
+late_initcall(kernel_do_mounts_initrd_sysctls_init);
+#endif /* CONFIG_SYSCTL */
+
 static int __init no_initrd(char *str)
 {
        mount_initrd = 0;