Commit 048646ac authored by Randy Dunlap's avatar Randy Dunlap Committed by Sam Ravnborg

kconfig: save kernel version in .config file

Save kernel version info and date when writing .config file.
Tested with 'make {menuconfig|xconfig|gconfig}'.
Signed-off-by: default avatarRandy Dunlap <rddunlap@osdl.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent a66dcfe1
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h>
#include <unistd.h> #include <unistd.h>
#define LKC_DIRECT_LINK #define LKC_DIRECT_LINK
...@@ -268,6 +269,7 @@ int conf_write(const char *name) ...@@ -268,6 +269,7 @@ int conf_write(const char *name)
char dirname[128], tmpname[128], newname[128]; char dirname[128], tmpname[128], newname[128];
int type, l; int type, l;
const char *str; const char *str;
time_t now;
dirname[0] = 0; dirname[0] = 0;
if (name && name[0]) { if (name && name[0]) {
...@@ -301,14 +303,25 @@ int conf_write(const char *name) ...@@ -301,14 +303,25 @@ int conf_write(const char *name)
if (!out_h) if (!out_h)
return 1; return 1;
} }
sym = sym_lookup("KERNELRELEASE", 0);
sym_calc_value(sym);
time(&now);
fprintf(out, "#\n" fprintf(out, "#\n"
"# Automatically generated make config: don't edit\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) if (out_h)
fprintf(out_h, "/*\n" fprintf(out_h, "/*\n"
" * Automatically generated C config: don't edit\n" " * Automatically generated C config: don't edit\n"
" * Linux kernel version: %s\n"
" * %s"
" */\n" " */\n"
"#define AUTOCONF_INCLUDED\n"); "#define AUTOCONF_INCLUDED\n",
sym_get_string_value(sym),
ctime(&now));
if (!sym_change_count) if (!sym_change_count)
sym_clear_all_valid(); sym_clear_all_valid();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment