2

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.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
sergej
  • 17,147
  • 6
  • 52
  • 89

1 Answers1

2

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
pevik
  • 4,523
  • 3
  • 33
  • 44
sergej
  • 17,147
  • 6
  • 52
  • 89