From: "Randy.Dunlap" <rddunlap@osdl.org>
To: lkml <linux-kernel@vger.kernel.org>
Cc: sam@ravnborg.org, zippel@linux-m68k.org
Subject: [PATCH] save kernel version in .config file
Date: Tue, 3 Aug 2004 22:57:53 -0700 [thread overview]
Message-ID: <20040803225753.15220897.rddunlap@osdl.org> (raw)
(from June/2004 email thread:
http://marc.theaimsgroup.com/?t=108753573200001&r=1&w=2
)
Several people found this useful, none opposed (afaik).
Saves kernel version in .config file, e.g.:
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.8-rc3
# Tue Aug 3 22:55:57 2004
#
Please merge.
---
Save kernel version info and date when writing .config file.
Tested with 'make {menuconfig|xconfig|gconfig}'.
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
diffstat:=
scripts/kconfig/confdata.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff -Naurp ./scripts/kconfig/confdata.c~config_version ./scripts/kconfig/confdata.c
--- ./scripts/kconfig/confdata.c~config_version 2004-06-15 22:20:21.000000000 -0700
+++ ./scripts/kconfig/confdata.c 2004-06-19 21:14:24.000000000 -0700
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#define LKC_DIRECT_LINK
@@ -268,6 +269,7 @@ int conf_write(const char *name)
char dirname[128], tmpname[128], newname[128];
int type, l;
const char *str;
+ time_t now;
dirname[0] = 0;
if (name && name[0]) {
@@ -301,14 +303,25 @@ int conf_write(const char *name)
if (!out_h)
return 1;
}
+ sym = sym_lookup("KERNELRELEASE", 0);
+ sym_calc_value(sym);
+ time(&now);
fprintf(out, "#\n"
"# Automatically generated make config: don't edit\n"
- "#\n");
+ "# Linux kernel version: %s\n"
+ "# %s"
+ "#\n",
+ sym_get_string_value(sym),
+ ctime(&now));
if (out_h)
fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n"
+ " * Linux kernel version: %s\n"
+ " * %s"
" */\n"
- "#define AUTOCONF_INCLUDED\n");
+ "#define AUTOCONF_INCLUDED\n",
+ sym_get_string_value(sym),
+ ctime(&now));
if (!sym_change_count)
sym_clear_all_valid();
--
next reply other threads:[~2004-08-04 6:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-04 5:57 Randy.Dunlap [this message]
2004-08-08 19:05 ` Sam Ravnborg
2004-08-09 20:03 ` Bill Davidsen
2004-08-09 20:05 ` Randy.Dunlap
2004-08-09 20:33 ` Sam Ravnborg
-- strict thread matches above, loose matches on Subject: below --
2004-06-27 9:23 The Viking
2004-06-18 5:06 Randy.Dunlap
2004-06-18 5:34 ` Willy Tarreau
2004-06-18 20:56 ` Sam Ravnborg
2004-06-18 22:05 ` Randy.Dunlap
2004-06-18 22:30 ` Sam Ravnborg
2004-06-18 22:42 ` Roman Zippel
2004-06-18 22:43 ` Randy.Dunlap
2004-06-19 4:07 ` Willy Tarreau
2004-06-19 5:02 ` Randy.Dunlap
2004-06-19 18:34 ` Willy Tarreau
2004-06-20 4:47 ` Randy.Dunlap
2004-06-18 6:29 ` Felipe Alfaro Solana
2004-06-18 6:38 ` Paul Rolland
2004-06-18 22:04 ` Randy.Dunlap
2004-06-18 12:32 ` Jesper Juhl
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=20040803225753.15220897.rddunlap@osdl.org \
--to=rddunlap@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=zippel@linux-m68k.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
all inboxes | Powered by JetHome®