On Sat, Feb 23, 2002 at 08:02:24AM +0100, Andreas Ferber wrote: > At the moment I'm just writing a tool which does all parts in one turn > (using zlib), to make it faster and more robust (the script above may > fail for example if the kernel image has more than one block of gzip > compressed data embedded). (It's actually working already, but the > code needs some heavy cleanup before it can be released to the public > ;-) Come back in a few days for news... Here we go again. Attached to this mail you find the announced kernel config extractor. It is also available via HTTP: http://www.myipv6.de/patches/kconfig/dumpkconfig.c It requires zlib to do the decompression stuff. As it is currently lacking a Makefile, you have to compile it by hand (maybe you have to add -I or -L parameters if you don't have zlib installed in the standard search path): gcc -o dumpkconfig dumpkconfig.c -lz If you call it without arguments, it tries to read the kernel image from stdin. Alternatively, you can give it a filename at the command line. It works on compressed kernel images as well as on uncompressed ones (e.g. vmlinux or /proc/kcore). Obviously, CONFIG_PROC_CONFIG has to be enabled for dumpkconfig to work, and you have to choose GZIP compression for /proc/config. bzip2 compression is not yet supported (and probably never will be, at least not by me), as is "none" compression (Which has no magic to search for and no "end of data" marker like gzip data, so it would be rather difficult to do. One could add some to the kernel code, but I don't think it's worth it). The code (and especially the error handling[1]) is still a bit wacky and is missing documentation, but it is working fine here, so I release it anyways. If you experience any problems, please let me know. Andreas [1] Although this might turn out to be a feature in some cases, as gzip decompression errors are currently handled by ending the gzip stream and searching for the next gzip magic, which should make things more robust against spurious gzip magics in the kernel code. -- Andreas Ferber - dev/consulting GmbH - Bielefeld, FRG --------------------------------------------------------- +49 521 1365800 - af@devcon.net - www.devcon.net