I have a Linux kernel image in elf format and I want to find out what .config
file was used to build this kernel. When I do an objdump of the image, I see a section called kernel_config_data
that contains text but does not look like the config file. Is there a way to retrieve this information?
Asked
Active
Viewed 2.6k times
31

Ciro Santilli OurBigBook.com
- 347,512
- 102
- 1,199
- 985

user2050283
- 562
- 1
- 4
- 9
2 Answers
46
Assuming your kernel was built with the IKCONFIG option, you can use the scripts/extract-ikconfig
tool to extract the original .config
file.
Alternately, you can boot that kernel and find the embedded configuration in /proc/config.gz
.

Frédéric Hamidi
- 258,201
- 41
- 486
- 479
-
7And how to check if it was built w/ IKCONFIG ? I guess if ikconfig just fail : like scripts/extract-ikconfig $file extract-ikconfig: Cannot find kernel config. – RzR Jan 05 '14 at 19:35
-
@Frederic Hamidi I have some `.img` files which are `arm-eabi-gcc` cross compiled and I want to get the `.config` file of that images. Is it possible to do so? – GShaik Aug 25 '16 at 13:03