On Fri, Feb 22, 2002 at 11:56:31AM -0800, Randy.Dunlap wrote:
>
> | Note that you also need some way to keep the config symbols which are
> | set to "n" and commented out in the .config. Otherwise you will have
> | to answer a lot of questions on "make oldconfig" ("yes n | make
> | oldconfig" isn't an option, as this doesn't tell you which config
> | symbols have been added).
> Will
> yes n | make oldconfig
> build a kernel with the current y/m options still intact,
> but any new or missing options set to 'n'?
Yes. "make oldconfig" will only ask for options not contained in the old
.config, and options it doesn't ask for don't take any input ;-)
> | I have actually done my own patch to include the .config into the
[...]
> I looked. It does nicely if that's where you want to store and find
> the .config. I'd rather have it associated with a kernel image file
> and accessible even if the kernel isn't running.
You can extract it. One possibility is to disable compression for
/proc/config and apply your "strings" magic.
The other way works if the config is GZIP compressed. Find the GZIP
magic in the vmlinuz, decompress the compressed part of the image (up
here it is like your "strings" variant), then search for GZIP magic
again and decompress.
Quick&dirty script for the latter (using your "binoffset" tool):
---------- snip ----------
#!/bin/sh
set -e
tmp=/tmp/$$
gziphdr=`binoffset $1 0x1f 0x8b 0x08 2>/dev/null`
dd if=$1 bs=1 skip=$gziphdr 2>/dev/null | gunzip > $tmp
gziphdr=`binoffset $tmp 0x1f 0x8b 0x08 2>/dev/null`
dd if=$tmp bs=1 skip=$gziphdr 2>/dev/null | gunzip
rm -f $tmp
---------- snip ----------
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...
Andreas
-- Andreas Ferber - dev/consulting GmbH - Bielefeld, FRG --------------------------------------------------------- +49 521 1365800 - af@devcon.net - www.devcon.net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:49 EST