From: eric.ernst@linux.intel.com
To: paul.gortmaker@windriver.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, mark.gross@intel.com
Cc: eric.ernst@linux.intel.com
Subject: [PATCH 1/1] Add kernel parameter for kernel version
Date: Tue, 27 May 2014 12:40:41 -0700 [thread overview]
Message-ID: <1401219641-79301-1-git-send-email-eric.ernst@linux.intel.com> (raw)
From: Eric Ernst <eric.ernst@linux.intel.com>
Create a kernel cmdline parameter, "version_addendum", which can be
used to add text to the kernel version that is reported from
/proc/version.
Signed-off-by: Eric Ernst <eric.ernst@linux.intel.com>
---
fs/proc/version.c | 14 +++++++++++++-
init/version.c | 2 +-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/fs/proc/version.c b/fs/proc/version.c
index d2154eb6d78f..1ea545d471a1 100644
--- a/fs/proc/version.c
+++ b/fs/proc/version.c
@@ -5,12 +5,17 @@
#include <linux/seq_file.h>
#include <linux/utsname.h>
+#define ADDENDUM_LENGTH 20
+static char version_addendum[ADDENDUM_LENGTH];
+
static int version_proc_show(struct seq_file *m, void *v)
{
seq_printf(m, linux_proc_banner,
utsname()->sysname,
utsname()->release,
- utsname()->version);
+ utsname()->version,
+ version_addendum);
+
return 0;
}
@@ -26,6 +31,13 @@ static const struct file_operations version_proc_fops = {
.release = single_release,
};
+static int __init set_version_addendum(char *str)
+{
+ strncpy(version_addendum, str, ADDENDUM_LENGTH);
+ return 0;
+}
+early_param("version_addendum", set_version_addendum);
+
static int __init proc_version_init(void)
{
proc_create("version", 0, NULL, &version_proc_fops);
diff --git a/init/version.c b/init/version.c
index 1a4718e500fe..180059b69b7a 100644
--- a/init/version.c
+++ b/init/version.c
@@ -47,4 +47,4 @@ const char linux_banner[] =
const char linux_proc_banner[] =
"%s version %s"
" (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")"
- " (" LINUX_COMPILER ") %s\n";
+ " (" LINUX_COMPILER ") %s " "%s\n";
--
1.7.9.5
next reply other threads:[~2014-05-27 19:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-27 19:40 eric.ernst [this message]
2014-05-27 19:48 ` [PATCH 1/1] Add kernel parameter for kernel version Josh Boyer
2014-05-27 20:06 ` Randy Dunlap
2014-06-02 18:41 ` eric ernst
2014-06-05 22:09 ` [PATCH v1 " eric.ernst
2014-06-05 22:16 ` Andrew Morton
2014-06-05 22:15 ` eric ernst
2014-06-05 22:29 ` Randy Dunlap
2014-06-05 22:56 ` eric ernst
2014-06-05 23:06 ` Richard Weinberger
2014-06-05 22:30 ` David Rientjes
2014-06-05 22:17 ` Randy Dunlap
2014-06-05 22:16 ` eric ernst
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=1401219641-79301-1-git-send-email-eric.ernst@linux.intel.com \
--to=eric.ernst@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.gross@intel.com \
--cc=paul.gortmaker@windriver.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.