aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-11 12:28:46 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-11 14:34:11 -0500
commit8993780a6e44fb4e7ed34e33458506a775356c6e (patch)
treeafa29f461ab5873eb8270d1b077b927feac1a9a7 /init/main.c
parent9202f32558601c2c99ddc438eb3218131d00d413 (diff)
Make SLES9 "get_kernel_version" work on the kernel binary again
As reported by Andy Whitcroft, at least the SLES9 initrd build process depends on getting the kernel version from the kernel binary. It does that by simply trawling the binary and looking for the signature of the "linux_banner" string (the string "Linux version " to be exact. Which is really broken in itself, but whatever..) That got broken when the string was changed to allow /proc/version to change the UTS release information dynamically, and "get_kernel_version" thus returned "%s" (see commit a2ee8649ba6d71416712e798276bf7c40b64e6e5: "[PATCH] Fix linux banner utsname information"). This just restores "linux_banner" as a static string, which should fix the version finding. And /proc/version simply uses a different string. To avoid wasting even that miniscule amount of memory, the early boot string should really be marked __initdata, but that just causes the same bug in SLES9 to re-appear, since it will then find other occurrences of "Linux version " first. Cc: Andy Whitcroft <apw@shadowen.org> Acked-by: Herbert Poetzl <herbert@13thfloor.at> Cc: Andi Kleen <ak@suse.de> Cc: Andrew Morton <akpm@osdl.org> Cc: Steve Fox <drfickle@us.ibm.com> Acked-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c
index 036f97c0c34c..fcd9ddc3ccf5 100644
--- a/init/main.c
+++ b/init/main.c
@@ -483,6 +483,12 @@ void __init __attribute__((weak)) smp_setup_processor_id(void)
483{ 483{
484} 484}
485 485
486static const char linux_banner[] =
487 "Linux version " UTS_RELEASE
488 " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")"
489 " (" LINUX_COMPILER ")"
490 " " UTS_VERSION "\n";
491
486asmlinkage void __init start_kernel(void) 492asmlinkage void __init start_kernel(void)
487{ 493{
488 char * command_line; 494 char * command_line;
@@ -509,7 +515,7 @@ asmlinkage void __init start_kernel(void)
509 boot_cpu_init(); 515 boot_cpu_init();
510 page_address_init(); 516 page_address_init();
511 printk(KERN_NOTICE); 517 printk(KERN_NOTICE);
512 printk(linux_banner, UTS_RELEASE, UTS_VERSION); 518 printk(linux_banner);
513 setup_arch(&command_line); 519 setup_arch(&command_line);
514 unwind_setup(); 520 unwind_setup();
515 setup_per_cpu_areas(); 521 setup_per_cpu_areas();