Re: [PATCH] save kernel version in .config file

From: Randy.Dunlap
Date: Sat Jun 19 2004 - 00:09:21 EST


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/