From: Bernhard Walle <bwalle@suse.de>
To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Cc: Dan Aloni <da-x@monatomic.org>
Subject: [PATCH] Add ELF note with Linux version
Date: Tue, 4 Sep 2007 17:00:18 +0200 [thread overview]
Message-ID: <20070904150018.GA4357@suse.de> (raw)
This patch adds version information to the ELF kernel file. Together
with the bzImage version information, this allows distributions to
identify the kernel version based on the file name.
Signed-off-by: Dan Aloni <da-x@monatomic.org>
Signed-off-by: Bernhard Walle <bwalle@suse.de>
---
include/linux/elfnote.h | 9 +++++++++
init/version.c | 3 +++
2 files changed, 12 insertions(+)
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -93,6 +93,15 @@
#define ELFNOTE32(name, type, desc) ELFNOTE(32, name, type, desc)
#define ELFNOTE64(name, type, desc) ELFNOTE(64, name, type, desc)
+
+#ifdef CONFIG_64BIT
+#define ELFNOTE_C(params...) ELFNOTE64(params)
+#else
+#define ELFNOTE_C(params...) ELFNOTE32(params)
+#endif
+
#endif /* __ASSEMBLER__ */
+#define LINUX_ELFNOTE_UTS_RELEASE 0
+
#endif /* _LINUX_ELFNOTE_H */
--- a/init/version.c
+++ b/init/version.c
@@ -11,6 +11,7 @@
#include <linux/uts.h>
#include <linux/utsname.h>
#include <linux/utsrelease.h>
+#include <linux/elfnote.h>
#include <linux/version.h>
#define version(a) Version_ ## a
@@ -42,3 +43,5 @@ const char linux_proc_banner[] =
"%s version %s"
" (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")"
" (" LINUX_COMPILER ") %s\n";
+
+ELFNOTE_C("LINUX", LINUX_ELFNOTE_UTS_RELEASE, UTS_RELEASE);
next reply other threads:[~2007-09-04 15:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-04 15:00 Bernhard Walle [this message]
2007-09-06 10:36 ` [PATCH] Add ELF note with Linux version Jeremy Fitzhardinge
2007-09-13 21:42 ` Andrew Morton
2007-09-13 21:56 ` Jeremy Fitzhardinge
2007-09-14 7:52 ` Bernhard Walle
2007-09-14 20:00 ` Jeremy Fitzhardinge
2007-09-13 22:13 ` Sam Ravnborg
2007-09-13 22:44 ` Jeremy Fitzhardinge
2007-09-14 6:08 ` Sam Ravnborg
2007-09-14 19:47 ` Jeremy Fitzhardinge
2007-09-14 21:07 ` Sam Ravnborg
2007-09-14 21:15 ` Roland McGrath
2007-09-14 21:31 ` Jeremy Fitzhardinge
2007-09-15 1:30 ` Roland McGrath
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=20070904150018.GA4357@suse.de \
--to=bwalle@suse.de \
--cc=akpm@linux-foundation.org \
--cc=da-x@monatomic.org \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox