diff options
-rw-r--r-- | fs/proc/proc_misc.c | 12 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 1 | ||||
-rw-r--r-- | include/linux/init.h | 1 | ||||
-rw-r--r-- | include/linux/kernel.h | 2 | ||||
-rw-r--r-- | init/initramfs.c | 6 | ||||
-rw-r--r-- | init/main.c | 15 | ||||
-rw-r--r-- | init/version.c | 5 |
7 files changed, 23 insertions, 19 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index dc3e580d1dc..92ea7743fe8 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c @@ -47,6 +47,7 @@ #include <linux/vmalloc.h> #include <linux/crash_dump.h> #include <linux/pid_namespace.h> +#include <linux/compile.h> #include <asm/uaccess.h> #include <asm/pgtable.h> #include <asm/io.h> @@ -253,8 +254,15 @@ static int version_read_proc(char *page, char **start, off_t off, { int len; - len = sprintf(page, linux_banner, - utsname()->release, utsname()->version); + /* FIXED STRING! Don't touch! */ + len = snprintf(page, PAGE_SIZE, + "%s version %s" + " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")" + " (" LINUX_COMPILER ")" + " %s\n", + utsname()->sysname, + utsname()->release, + utsname()->version); return proc_calc_metrics(page, start, off, count, eof, len); } diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 6e9fcebbf89..7437ccaada7 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -242,6 +242,7 @@ *(.initcall4s.init) \ *(.initcall5.init) \ *(.initcall5s.init) \ + *(.initcallrootfs.init) \ *(.initcall6.init) \ *(.initcall6s.init) \ *(.initcall7.init) \ diff --git a/include/linux/init.h b/include/linux/init.h index 5eb5d24b768..5a593a1dec1 100644 --- a/include/linux/init.h +++ b/include/linux/init.h @@ -111,6 +111,7 @@ extern void setup_arch(char **); #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) #define fs_initcall(fn) __define_initcall("5",fn,5) #define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) +#define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs) #define device_initcall(fn) __define_initcall("6",fn,6) #define device_initcall_sync(fn) __define_initcall("6s",fn,6s) #define late_initcall(fn) __define_initcall("7",fn,7) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e8bfac34d2b..b0c4a05a4b0 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -17,8 +17,6 @@ #include <asm/byteorder.h> #include <asm/bug.h> -extern const char linux_banner[]; - #define INT_MAX ((int)(~0U>>1)) #define INT_MIN (-INT_MAX - 1) #define UINT_MAX (~0U) diff --git a/init/initramfs.c b/init/initramfs.c index 85f04037ade..4fa0f7977de 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -526,7 +526,7 @@ static void __init free_initrd(void) #endif -void __init populate_rootfs(void) +static int __init populate_rootfs(void) { char *err = unpack_to_rootfs(__initramfs_start, __initramfs_end - __initramfs_start, 0); @@ -544,7 +544,7 @@ void __init populate_rootfs(void) unpack_to_rootfs((char *)initrd_start, initrd_end - initrd_start, 0); free_initrd(); - return; + return 0; } printk("it isn't (%s); looks like an initrd\n", err); fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700); @@ -565,4 +565,6 @@ void __init populate_rootfs(void) #endif } #endif + return 0; } +rootfs_initcall(populate_rootfs); diff --git a/init/main.c b/init/main.c index 036f97c0c34..e3f0bb20b4d 100644 --- a/init/main.c +++ b/init/main.c @@ -94,7 +94,6 @@ extern void pidmap_init(void); extern void prio_tree_init(void); extern void radix_tree_init(void); extern void free_initmem(void); -extern void populate_rootfs(void); extern void driver_init(void); extern void prepare_namespace(void); #ifdef CONFIG_ACPI @@ -483,6 +482,12 @@ void __init __attribute__((weak)) smp_setup_processor_id(void) { } +static const char linux_banner[] = + "Linux version " UTS_RELEASE + " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")" + " (" LINUX_COMPILER ")" + " " UTS_VERSION "\n"; + asmlinkage void __init start_kernel(void) { char * command_line; @@ -509,7 +514,7 @@ asmlinkage void __init start_kernel(void) boot_cpu_init(); page_address_init(); printk(KERN_NOTICE); - printk(linux_banner, UTS_RELEASE, UTS_VERSION); + printk(linux_banner); setup_arch(&command_line); unwind_setup(); setup_per_cpu_areas(); @@ -739,12 +744,6 @@ static int init(void * unused) cpuset_init_smp(); - /* - * Do this before initcalls, because some drivers want to access - * firmware files. - */ - populate_rootfs(); - do_basic_setup(); /* diff --git a/init/version.c b/init/version.c index 2a5dfcd1c2e..9d96d36501c 100644 --- a/init/version.c +++ b/init/version.c @@ -33,8 +33,3 @@ struct uts_namespace init_uts_ns = { }, }; EXPORT_SYMBOL_GPL(init_uts_ns); - -const char linux_banner[] = - "Linux version %s (" LINUX_COMPILE_BY "@" - LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") %s\n"; - |