LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Herbert Poetzl <herbert@13thfloor.at>
To: "Eric W. Biederman" <ebiederm@xmission.com>,
	Andrew Morton <akpm@osdl.org>,
	Linux Containers <containers@lists.osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fix linux banner utsname information
Date: Wed, 6 Dec 2006 19:32:21 +0100	[thread overview]
Message-ID: <20061206183221.GB16927@MAIL.13thfloor.at> (raw)
In-Reply-To: <20061205172407.GA15450@MAIL.13thfloor.at>

On Tue, Dec 05, 2006 at 06:24:09PM +0100, Herbert Poetzl wrote:
> On Mon, Dec 04, 2006 at 11:32:48PM +0100, Herbert Poetzl wrote:
> > 
> > utsname information is shown in the linux banner, which
> > also is used for /proc/version (which can have different
> > utsname values inside a uts namespaces). this patch
> > makes the varying data arguments and changes the string
> > to a format string, using those arguments.
> > 
> > best,
> > Herbert
> 
> d'oh! just figured I lost the two new includes required
> in main.c, will send an updated version shortly

okay, here is the complete and tested version ...

Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>

--- linux-2.6.19/fs/proc/proc_misc.c	2006-11-30 21:19:28 +0100
+++ linux-2.6.19-banner/fs/proc/proc_misc.c	2006-12-06 07:10:41 +0100
@@ -252,8 +252,8 @@ static int version_read_proc(char *page,
 {
 	int len;
 
-	strcpy(page, linux_banner);
-	len = strlen(page);
+	len = sprintf(page, linux_banner,
+		utsname()->release, utsname()->version);
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
--- linux-2.6.19/init/Makefile	2006-09-20 16:58:44 +0200
+++ linux-2.6.19-banner/init/Makefile	2006-12-06 07:10:41 +0100
@@ -15,6 +15,7 @@ clean-files := ../include/linux/compile.
 
 # dependencies on generated files need to be listed explicitly
 
+$(obj)/main.o: include/linux/compile.h
 $(obj)/version.o: include/linux/compile.h
 
 # compile.h changes depending on hostname, generation number, etc,
--- linux-2.6.19/init/main.c	2006-11-30 21:19:43 +0100
+++ linux-2.6.19-banner/init/main.c	2006-12-06 07:10:41 +0100
@@ -49,6 +49,8 @@
 #include <linux/buffer_head.h>
 #include <linux/debug_locks.h>
 #include <linux/lockdep.h>
+#include <linux/utsrelease.h>
+#include <linux/compile.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -501,7 +503,7 @@ asmlinkage void __init start_kernel(void
 	boot_cpu_init();
 	page_address_init();
 	printk(KERN_NOTICE);
-	printk(linux_banner);
+	printk(linux_banner, UTS_RELEASE, UTS_VERSION);
 	setup_arch(&command_line);
 	unwind_setup();
 	setup_per_cpu_areas();
--- linux-2.6.19/init/version.c	2006-11-30 21:19:43 +0100
+++ linux-2.6.19-banner/init/version.c	2006-12-06 07:10:41 +0100
@@ -35,5 +35,6 @@ struct uts_namespace init_uts_ns = {
 EXPORT_SYMBOL_GPL(init_uts_ns);
 
 const char linux_banner[] =
-	"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
-	LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
+	"Linux version %s (" LINUX_COMPILE_BY "@"
+	LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") %s\n";
+

      reply	other threads:[~2006-12-06 18:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27  4:59 [PATCH 0/4] Fix the binary ipc and uts namespace sysctls Eric W. Biederman
2006-11-27  5:05 ` [PATCH 1/4] sysctl: Simplify sysctl_uts_string Eric W. Biederman
2006-11-27  5:05 ` [PATCH 2/4] sysctl: Implement sysctl_uts_string Eric W. Biederman
2006-11-27  5:05 ` [PATCH 3/4] sysctl: Simplify ipc ns specific sysctls Eric W. Biederman
2006-11-29  4:56   ` Serge E. Hallyn
2006-11-27  5:05 ` [PATCH 4/4] sysctl: Fix sys_sysctl interface of ipc sysctls Eric W. Biederman
2006-11-27 20:22 ` [PATCH 0/4] Fix the binary ipc and uts namespace sysctls Herbert Poetzl
2006-11-27 22:40   ` Eric W. Biederman
2006-11-28 14:32     ` Herbert Poetzl
2006-11-28 15:38       ` Eric W. Biederman
2006-11-28 16:21         ` Herbert Poetzl
2006-12-04 22:32         ` [PATCH] Fix linux banner utsname information Herbert Poetzl
2006-12-05 17:24           ` Herbert Poetzl
2006-12-06 18:32             ` Herbert Poetzl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061206183221.GB16927@MAIL.13thfloor.at \
    --to=herbert@13thfloor.at \
    --cc=akpm@osdl.org \
    --cc=containers@lists.osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] Fix linux banner utsname information' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).