Kernel configuration in kernel, kernel 2.4.20
PATCH 1/1 Kernel configuration in kernel, kernel 2.4.20
Hello,
Tired of keeping copy of the kernel .config file, I decided to create a kernel patch to have a/proc/config/config.gz
entry that would be created at boot time and that would
allow a :
zcat /proc/config/config.gz
to recover the .config file used to create the kernel.
Juste below is a patch, created against a 2.4.19, but that can also be applied to a 2.4.20 (with a few warning).
Result is :
1 [17:53] rol@donald:~> ls -l /proc/config/
total 0
-r--r--r-- 1 root root 0 Dec 29 18:00 config.gz -r--r--r-- 1 root root 0 Dec 29 18:00 version
Feedback welcome,
Regards,
Paul Rolland, [email protected]
drivers/char/Config.in Thu Dec 19 13:47:19 2002 renamed from drivers/char/Config.in Thu Dec 19 13:48:19 2002 +1 -0
@@ -4,6 +4,7 @@ mainmenu_option next_comment comment 'Character devices' +bool 'Linux Kernel Configuration Driver' CONFIG_CONFIG bool 'Virtual terminal' CONFIG_VT if [ "$CONFIG_VT" = "y" ]; then bool ' Support for console on virtual terminal' CONFIG_VT_CONSOLE
drivers/char/Makefile Thu Dec 19 15:17:31 2002 renamed from drivers/char/Makefile Thu Dec 19 13:48:32 2002 +12 -0
@@ -136,6 +136,7 @@ KEYBD = dummy_keyb.o endif +obj-$(CONFIG_CONFIG) += config.o obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o obj-$(CONFIG_SERIAL) += $(SERIAL) obj-$(CONFIG_SERIAL_HCDP) += hcdp_serial.o
@@ -287,3 +288,14 @@ qtronixmap.c: qtronixmap.map set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@ + +config.o: config.h + +config.h: config.txt.gz + @cc -o dotHmaker dotHmaker.c + @./dotHmaker + +config.txt.gz:: + @cp ../../.config config.txt + @gzip -f config.txt +
drivers/char/config.c Thu Dec 19 13:47:24 2002 renamed from drivers/char/config.c Thu Jan 1 00:00:00 1970 +156 -0
156 lines not on this page · raw message
drivers/char/dotHmaker.c Thu Dec 19 13:47:24 2002 renamed from drivers/char/dotHmaker.c Thu Jan 1 00:00:00 1970 +57 -0
57 lines not on this page · raw message
Quoted 5 lines · On 2002.12.29 Paul Rolland wrote:
Hello,
Tired of keeping copy of the kernel .config file, I decided to create a kernel patch to have a
/proc/config/config.gz
Why people does not read the archives before doing anything ?
http://www.it.uc3m.es/~ptb/proconfig/
Signature · 4 lines
J.A. Magallon <[email protected]> \ Software is like sex: werewolf.able.es \ It's better when it's free Mandrake Linux release 9.1 (Cooker) for i586 Linux 2.4.21-pre2-jam2 (gcc 3.2.1 (Mandrake Linux 9.1 3.2.1-2mdk))
Hello,
Quoted 6 lines
Quoted 1 line
Tired of keeping copy of the kernel .config file, I decided
to create
Quoted 1 line
a kernel patch to have a
/proc/config/config.gzWhy people does not read the archives before doing anything ?
Maybe because they consider that there is not only one way to do things... ;-)
OK, you don't like mine, no problem. I'm just expecting this functionnality in the kernel, not MY solution.
On a technical basis, I prefer to have a solution that is using full compression from gzip rather than relying on a set of keyword that will need to be updated with kernel dev and growth.
But, I'm second...
Regards,
Paul