Skip to content
Advertisement

How to extract the config from a kernel image file when CONFIG_IKCONFIG is set as a module (=m)?

How do I extract the kernel configuration from a kernel image file?

The kernel image file type is:

/boot/kernel7.img: Linux kernel ARM boot executable zImage (little-endian)

The kernel has been compiled with CONFIG_IKCONFIG enabled. However,

scripts/extract-ikconfig /boot/kernel7.img

returns

extract-ikconfig: Cannot find kernel config.

Note: I am trying the get the config without booting the kernel.

Advertisement

Answer

If the kernel has been compiled with CONFIG_IKCONFIG=m (note the m), the configuration in stored in a module (configs.ko) and not in the kernel itself. That’s the reason why running extract-ikconfig on the kernel image fails.

In this case, we can extract the config from the configuration module:

/usr/src/$(uname -r)/scripts/extract-ikconfig  
   /lib/modules/$(uname -r)/kernel/kernel/configs.ko
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement