Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Extracting the kernel configuration from a kernel.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Kream
n00b
n00b


Joined: 19 Apr 2002
Posts: 30
Location: New Delhi, India

PostPosted: Sat Nov 23, 2002 1:01 am    Post subject: Extracting the kernel configuration from a kernel. Reply with quote

I keep changing kernels (gentoo, mandrake, lolo-sources, vanilla, linux-beta) and keeping track of the config options I set in each one of them has been impossible so far.
To find out the options set in any kernel image, the kernel has to be compiled with "Kernel .config support" enabled in General Setup. This corresponds to CONFIG_IKCONFIG.

The documentation in Documentation/Configure.help is not very helpful and after spending a few hours before I was able to find out what I had compiled the kernel with, I thought it'd be useful to other Gentoo-ers if I recorded it here.

This extraction is performed by a scripts/ikconfig-extract which has to be made executable with chmod +x scripts/ikconfig-extract . This tool requires a program called binoffset, the source code for which can be found at http://www.osdl.org/archive/rddunlap/patches/binoffset.c . Compile binoffset by doing gcc -o binoffset binoffset.c and cp the resulting binoffset executable to /usr/local/bin.

Type out the following command from /usr/src/linux/scripts (remember to make ikconfig-extract executable)

ikconfig-extract /path/to/bzImage

you'll find a file called bzImage.oldconfig.XXXX in /path/to . that's the kernel config. If you're like me and don't want to page through the entire thing, go to /usr/src/linux, run make menuconfig, select Load Alternate Configuration File and then enter /path/to/bzImage.oldconfig.XXXX

Cheers!

Aniruddha Shankar
Bangalore, India
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum