public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] save kernel version in .config file
@ 2004-06-18  5:06 Randy.Dunlap
  2004-06-18  5:34 ` Willy Tarreau
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Randy.Dunlap @ 2004-06-18  5:06 UTC (permalink / raw)
  To: lkml


Is this interesting to anyone besides me?



Save kernel version info when writing .config file.

Signed-off-by: Randy Dunlap <rddunlap@osdl.org>


diffstat:=
 scripts/kconfig/confdata.c |    9 +++++++--
 1 files changed, 7 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-17 22:00:22.000000000 -0700
@@ -301,14 +301,19 @@ int conf_write(const char *name)
 		if (!out_h)
 			return 1;
 	}
+	sym = sym_lookup("KERNELRELEASE", 0);
 	fprintf(out, "#\n"
 		     "# Automatically generated make config: don't edit\n"
-		     "#\n");
+		     "# for Linux kernel version: %s\n"
+		     "#\n",
+		     (char *)sym->curr.val);
 	if (out_h)
 		fprintf(out_h, "/*\n"
 			       " * Automatically generated C config: don't edit\n"
+			       " * for Linux kernel version: %s\n"
 			       " */\n"
-			       "#define AUTOCONF_INCLUDED\n");
+			       "#define AUTOCONF_INCLUDED\n",
+			       (char *)sym->curr.val);
 
 	if (!sym_change_count)
 		sym_clear_all_valid();


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18  5:06 Randy.Dunlap
@ 2004-06-18  5:34 ` Willy Tarreau
  2004-06-18 20:56   ` Sam Ravnborg
  2004-06-18  6:29 ` Felipe Alfaro Solana
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Willy Tarreau @ 2004-06-18  5:34 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: lkml

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 ?

Regards,
Willy


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18  5:06 Randy.Dunlap
  2004-06-18  5:34 ` Willy Tarreau
@ 2004-06-18  6:29 ` Felipe Alfaro Solana
  2004-06-18  6:38 ` Paul Rolland
  2004-06-18 12:32 ` Jesper Juhl
  3 siblings, 0 replies; 21+ messages in thread
From: Felipe Alfaro Solana @ 2004-06-18  6:29 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: lkml

On Thu, 2004-06-17 at 22:06 -0700, Randy.Dunlap wrote:
> Is this interesting to anyone besides me?

Yes. It will help with the hell of config files I have. Thanks.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18  5:06 Randy.Dunlap
  2004-06-18  5:34 ` Willy Tarreau
  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
  3 siblings, 1 reply; 21+ messages in thread
From: Paul Rolland @ 2004-06-18  6:38 UTC (permalink / raw)
  To: 'Randy.Dunlap', 'lkml'

Hello,

> 
> Is this interesting to anyone besides me?
> 
Is it also possible to have this version being displayed during
a make config/make menuconfig/... so that we know we are reading a
config file that may have been generated for another kernel version,
and not yet saved ?

You would have, for make menuconfig :

 Linux Kernel v2.2.13 Configuration, Configuration file version 2.4.20
....

Regards,
Paul


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18  5:06 Randy.Dunlap
                   ` (2 preceding siblings ...)
  2004-06-18  6:38 ` Paul Rolland
@ 2004-06-18 12:32 ` Jesper Juhl
  3 siblings, 0 replies; 21+ messages in thread
From: Jesper Juhl @ 2004-06-18 12:32 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: lkml

On Thu, 17 Jun 2004, Randy.Dunlap wrote:

>
> Is this interesting to anyone besides me?
>
>
>
> Save kernel version info when writing .config file.

I certainly find that to be a nice and useful enhancement - good idea.


--
Jesper Juhl <juhl-lkml@dif.dk>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18  5:34 ` Willy Tarreau
@ 2004-06-18 20:56   ` Sam Ravnborg
  2004-06-18 22:05     ` Randy.Dunlap
  0 siblings, 1 reply; 21+ messages in thread
From: Sam Ravnborg @ 2004-06-18 20:56 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: Randy.Dunlap, lkml

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.

	Sam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18  6:38 ` Paul Rolland
@ 2004-06-18 22:04   ` Randy.Dunlap
  0 siblings, 0 replies; 21+ messages in thread
From: Randy.Dunlap @ 2004-06-18 22:04 UTC (permalink / raw)
  To: rol; +Cc: linux-kernel

On Fri, 18 Jun 2004 08:38:58 +0200 Paul Rolland wrote:

| Hello,
| 
| > 
| > Is this interesting to anyone besides me?
| > 
| Is it also possible to have this version being displayed during
| a make config/make menuconfig/... so that we know we are reading a
| config file that may have been generated for another kernel version,
| and not yet saved ?
| 
| You would have, for make menuconfig :
| 
|  Linux Kernel v2.2.13 Configuration, Configuration file version 2.4.20

Sure, it's possible.  I just don't want to add the kitchen sink.

IOW, I'm not convinced that it's useful most of the time...
only a little bit of the time.

--
~Randy

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18 20:56   ` Sam Ravnborg
@ 2004-06-18 22:05     ` Randy.Dunlap
  2004-06-18 22:30       ` Sam Ravnborg
                         ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Randy.Dunlap @ 2004-06-18 22:05 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: willy, linux-kernel

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();

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18 22:05     ` Randy.Dunlap
@ 2004-06-18 22:30       ` Sam Ravnborg
  2004-06-18 22:42       ` Roman Zippel
  2004-06-19  4:07       ` Willy Tarreau
  2 siblings, 0 replies; 21+ messages in thread
From: Sam Ravnborg @ 2004-06-18 22:30 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Sam Ravnborg, willy, linux-kernel

On Fri, Jun 18, 2004 at 03:05:35PM -0700, Randy.Dunlap wrote:
> 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?

Because date is easier to see in grep.

	Sam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  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
  2 siblings, 1 reply; 21+ messages in thread
From: Roman Zippel @ 2004-06-18 22:42 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Sam Ravnborg, willy, linux-kernel

Hi,

On Fri, 18 Jun 2004, Randy.Dunlap wrote:

Did you test this with anything else than menuconfig?

> +		     (char *)sym->curr.val, ctime(&now));

Try to avoid poking around in that structure. First the value needs to be 
calculated with sym_calc_value() and then it can be accessed with 
sym_get_string_value().

bye, Roman

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18 22:42       ` Roman Zippel
@ 2004-06-18 22:43         ` Randy.Dunlap
  0 siblings, 0 replies; 21+ messages in thread
From: Randy.Dunlap @ 2004-06-18 22:43 UTC (permalink / raw)
  To: Roman Zippel; +Cc: sam, willy, linux-kernel

On Sat, 19 Jun 2004 00:42:19 +0200 (CEST) Roman Zippel wrote:

| Hi,
| 
| On Fri, 18 Jun 2004, Randy.Dunlap wrote:
| 
| Did you test this with anything else than menuconfig?

Nope...

| > +		     (char *)sym->curr.val, ctime(&now));
| 
| Try to avoid poking around in that structure. First the value needs to be 
| calculated with sym_calc_value() and then it can be accessed with 
| sym_get_string_value().

Thanks, will use that info.

--
~Randy

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-18 22:05     ` Randy.Dunlap
  2004-06-18 22:30       ` Sam Ravnborg
  2004-06-18 22:42       ` Roman Zippel
@ 2004-06-19  4:07       ` Willy Tarreau
  2004-06-19  5:02         ` Randy.Dunlap
  2004-06-20  4:47         ` Randy.Dunlap
  2 siblings, 2 replies; 21+ messages in thread
From: Willy Tarreau @ 2004-06-19  4:07 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Sam Ravnborg, linux-kernel

On Fri, Jun 18, 2004 at 03:05:35PM -0700, Randy.Dunlap wrote:
 
> OK, I've added date, based on Sam's comments, but someone tell me,
> when/why does filesystem-timestamp not work for this?

Oh, there may be lots of reasons. The first one which comes to my mind is
when I archive several config files in a same directory, I rarely think
about adding '-a' to cp to preserve the dates. And when you're experimenting
with a kernel and you're at the 20th at the end of the day, the date in the
config file is often more reliable than yourself to keep track of what you
have tried.

Thanks,
Willy

PS: do you think this could be done easily to 2.4 too ?


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  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
  1 sibling, 1 reply; 21+ messages in thread
From: Randy.Dunlap @ 2004-06-19  5:02 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: sam, linux-kernel

On Sat, 19 Jun 2004 06:07:17 +0200 Willy Tarreau wrote:

| On Fri, Jun 18, 2004 at 03:05:35PM -0700, Randy.Dunlap wrote:
|  
| > OK, I've added date, based on Sam's comments, but someone tell me,
| > when/why does filesystem-timestamp not work for this?
| 
| Oh, there may be lots of reasons. The first one which comes to my mind is
| when I archive several config files in a same directory, I rarely think
| about adding '-a' to cp to preserve the dates. And when you're experimenting
| with a kernel and you're at the 20th at the end of the day, the date in the
| config file is often more reliable than yourself to keep track of what you
| have tried.

I see.

| Thanks,
| Willy
| 
| PS: do you think this could be done easily to 2.4 too ?

It's trivial for 'make menuconfig' (bash scripting) [below].
OTOH, I won't look at the tcl/tk 'xconfig' stuff...

--
~Randy



linux-2.4.26

Save kernel version and config file date in config file.

diffstat:=
 scripts/Menuconfig |    5 +++++
 1 files changed, 5 insertions(+)

diff -Naurp ./scripts/Menuconfig~config_version ./scripts/Menuconfig
--- ./scripts/Menuconfig~config_version	2002-08-02 17:39:46.000000000 -0700
+++ ./scripts/Menuconfig	2004-06-18 21:57:47.000000000 -0700
@@ -1275,13 +1275,18 @@ save_configuration () {
 
 	CONFIG=.tmpconfig
 	CONFIG_H=.tmpconfig.h
+	DATTIM=`date`
 
 	echo "#" >$CONFIG
 	echo "# Automatically generated by make menuconfig: don't edit" >>$CONFIG
+	echo "# Linux kernel version: $kernel_version" >>$CONFIG
+	echo "# $DATTIM" >>$CONFIG
 	echo "#" >>$CONFIG
 
 	echo "/*" >$CONFIG_H
 	echo " * Automatically generated by make menuconfig: don't edit" >>$CONFIG_H
+	echo " * Linux kernel version: $kernel_version" >>$CONFIG_H
+	echo " * $DATTIM" >>$CONFIG_H
 	echo " */" >>$CONFIG_H
 	echo "#define AUTOCONF_INCLUDED" >> $CONFIG_H
 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-19  5:02         ` Randy.Dunlap
@ 2004-06-19 18:34           ` Willy Tarreau
  0 siblings, 0 replies; 21+ messages in thread
From: Willy Tarreau @ 2004-06-19 18:34 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: sam, linux-kernel

On Fri, Jun 18, 2004 at 10:02:53PM -0700, Randy.Dunlap wrote:
> | PS: do you think this could be done easily to 2.4 too ?
> 
> It's trivial for 'make menuconfig' (bash scripting) [below].

Cool, thank you very much Randy.

> OTOH, I won't look at the tcl/tk 'xconfig' stuff...

Not my problem either, I haven't used it for 3 or 4 years.

Cheers,
Willy


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-06-19  4:07       ` Willy Tarreau
  2004-06-19  5:02         ` Randy.Dunlap
@ 2004-06-20  4:47         ` Randy.Dunlap
  1 sibling, 0 replies; 21+ messages in thread
From: Randy.Dunlap @ 2004-06-20  4:47 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: sam, linux-kernel, zippel

On Sat, 19 Jun 2004 06:07:17 +0200 Willy Tarreau wrote:

| On Fri, Jun 18, 2004 at 03:05:35PM -0700, Randy.Dunlap wrote:
|  
| > OK, I've added date, based on Sam's comments, but someone tell me,
| > when/why does filesystem-timestamp not work for this?

and then Roman made some very good comments about looking up and
printing symbol values and testing with xconfig and gconfig.
Thanks, Roman.

Having done all of that successfully, here is the updated patch for
2.6.7.



Save kernel version info and date when writing .config file.

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();

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
@ 2004-06-27  9:23 The Viking
  0 siblings, 0 replies; 21+ messages in thread
From: The Viking @ 2004-06-27  9:23 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: viking



-------- Original Message --------
References: <28jXg-7Hw-3@gated-at.bofh.it> <28lmp-jo-9@gated-at.bofh.it>

On Fri, 18 Jun 2004 08:38:58 +0200 Paul Rolland wrote:

| Hello,
|
| >
| > Is this interesting to anyone besides me?
| >
| Is it also possible to have this version being displayed during
| a make config/make menuconfig/... so that we know we are reading a
| config file that may have been generated for another kernel version,
| and not yet saved ?
|
| You would have, for make menuconfig :
|
|  Linux Kernel v2.2.13 Configuration, Configuration file version 2.4.20

 >Sure, it's possible.  I just don't want to add the kitchen sink.

 >IOW, I'm not convinced that it's useful most of the time...
 >only a little bit of the time.

My two cents worth:
I'd show it if it differed in kernel version, otherwise not. If this code is 
all relatively self contained, such as all being within the menuconfig/xconfig 
code, then it won't affect the running of the kernel. And yes, it would mean a 
little more code in place, but we're waiting for keyboard strokes in this 
code, or viewing its output. It's not timing-critical.

Sorry I took so long to get to this, but I've only caught up to this point.

-- 
2,313 messages to read, 2,313 messages to read - damn, Thunderbird just 
refreshed, 2,847 messages to read, ... (ad nauseum vibrum kernel)

The Viking of the Flying Brick System

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH] save kernel version in .config file
@ 2004-08-04  5:57 Randy.Dunlap
  2004-08-08 19:05 ` Sam Ravnborg
  2004-08-09 20:03 ` Bill Davidsen
  0 siblings, 2 replies; 21+ messages in thread
From: Randy.Dunlap @ 2004-08-04  5:57 UTC (permalink / raw)
  To: lkml; +Cc: sam, zippel


(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();



--

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-08-04  5:57 [PATCH] save kernel version in .config file Randy.Dunlap
@ 2004-08-08 19:05 ` Sam Ravnborg
  2004-08-09 20:03 ` Bill Davidsen
  1 sibling, 0 replies; 21+ messages in thread
From: Sam Ravnborg @ 2004-08-08 19:05 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: lkml, sam, zippel

On Tue, Aug 03, 2004 at 10:57:53PM -0700, Randy.Dunlap wrote:
> 
> (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.

Applied - thanks.

	Sam

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-08-04  5:57 [PATCH] save kernel version in .config file Randy.Dunlap
  2004-08-08 19:05 ` Sam Ravnborg
@ 2004-08-09 20:03 ` Bill Davidsen
  2004-08-09 20:05   ` Randy.Dunlap
  1 sibling, 1 reply; 21+ messages in thread
From: Bill Davidsen @ 2004-08-09 20:03 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: lkml, sam, zippel

Randy.Dunlap wrote:
> (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}'.

I don't see "oldconfig" here, I'm sure there are people who don't care 
because they want to roll every kernel fresh, but for the rest of us...
> 
> Signed-off-by: Randy Dunlap <rddunlap@osdl.org>


-- 
    -bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
  last possible moment - but no longer"  -me

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-08-09 20:03 ` Bill Davidsen
@ 2004-08-09 20:05   ` Randy.Dunlap
  2004-08-09 20:33     ` Sam Ravnborg
  0 siblings, 1 reply; 21+ messages in thread
From: Randy.Dunlap @ 2004-08-09 20:05 UTC (permalink / raw)
  To: Bill Davidsen; +Cc: linux-kernel, sam, zippel

On Mon, 09 Aug 2004 16:03:26 -0400 Bill Davidsen wrote:

| Randy.Dunlap wrote:
| > (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}'.
| 
| I don't see "oldconfig" here, I'm sure there are people who don't care 
| because they want to roll every kernel fresh, but for the rest of us...

OK, I'll change the description (above):

Tested with 'make {menuconfig|xconfig|gconfig|oldconfig}'.

In fact, what I posted in the email ('#' above) was from oldconfig.

--
~Randy

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] save kernel version in .config file
  2004-08-09 20:05   ` Randy.Dunlap
@ 2004-08-09 20:33     ` Sam Ravnborg
  0 siblings, 0 replies; 21+ messages in thread
From: Sam Ravnborg @ 2004-08-09 20:33 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Bill Davidsen, linux-kernel, sam, zippel

On Mon, Aug 09, 2004 at 01:05:54PM -0700, Randy.Dunlap wrote:
> 
> OK, I'll change the description (above):
> 
> Tested with 'make {menuconfig|xconfig|gconfig|oldconfig}'.
> 
> In fact, what I posted in the email ('#' above) was from oldconfig.

I have the patch in my local tree - but due to a few pending issues I
not pushed it to linux-sam.bkbits.net/kbuild yet.
Will do so until next -mm

	Sam

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2004-08-09 20:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-04  5:57 [PATCH] save kernel version in .config file Randy.Dunlap
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox