Messages in this thread Patch in this message | | | Date | Fri, 18 Jun 2004 15:05:35 -0700 | From | "Randy.Dunlap" <> | Subject | Re: [PATCH] save kernel version in .config file |
| |
On Fri, 18 Jun 2004 22:56:02 +0200 Sam Ravnborg wrote:
| On Fri, Jun 18, 2004 at 07:34:55AM +0200, Willy Tarreau wrote: | > On Thu, Jun 17, 2004 at 10:06:51PM -0700, Randy.Dunlap wrote: | > > | > > Is this interesting to anyone besides me? | > > Save kernel version info when writing .config file. | > | > Very good idea Randy ! I've already used some wrong config picked out of 20, | > and having a simple way to do a quick check is really an enhancement. BTW, | > does KERNELRELEASE include the build number ? and could we include the | > config date in the file too ? | | Date seems worthwhile. buildnumber does not make sense since we do not | generate a new .config for each build.
OK, I've added date, based on Sam's comments, but someone tell me, when/why does filesystem-timestamp not work for this?
Thanks for the replies.
-- ~Randy
Save kernel version info and date when writing .config file.
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
diffstat:= scripts/kconfig/confdata.c | 14 ++++++++++++-- 1 files changed, 12 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-18 14:27:25.414950216 -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,22 @@ int conf_write(const char *name) if (!out_h) return 1; } + sym = sym_lookup("KERNELRELEASE", 0); + time(&now); fprintf(out, "#\n" "# Automatically generated make config: don't edit\n" - "#\n"); + "# Linux kernel version: %s\n" + "# %s" + "#\n", + (char *)sym->curr.val, 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", + (char *)sym->curr.val, ctime(&now)); if (!sym_change_count) sym_clear_all_valid(); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |