I'm currently trying to rebuild the kernel for a proprietary device. In order to do this I will need to produce a kernel config for the device. While I could likely do this through trial and error, it would be better to see if I can extract the config from the running host.
That being said the running kernel was not compiled with CONFIG_IKCONFIG
(and thus not CONFIG_IKCONFIG_PROC
either). This means that there is no /proc/config.gz
to extract.
In addition, they didn't bother to package the config in /boot
either. Thus, the two common places where a kernel config is generally stored are out of luck.
Most everything was compiled statically into this kernel:
# cat /proc/modules
linux_user_bde 12327 0 - Live 0xf8536000 (PO)
linux_kernel_bde 29225 1 linux_user_bde, Live 0xf8524000 (PO)
pciDrv 1448 0 - Live 0xf8510000 (O)
iTCO_wdt 4456 0 - Live 0xf83fb000
iTCO_vendor_support 2003 1 iTCO_wdt, Live 0xf83f7000
i2c_dev 5443 0 - Live 0xf83f2000
i2c_i801 9421 0 - Live 0xf83eb000
i2c_core 20859 3 i2cscan,i2c_dev,i2c_i801, Live 0xf83e0000
igb 148294 0 - Live 0xf83ae000 (O)
dca 4665 0 - Live 0xf804c000
# ls -l /proc/conf*
ls: /proc/conf*: No such file or directory
# find /boot/ -name "conf*"
# modprobe configs
modprobe: module 'configs' not found
#
Best Answer
One, arguably silly, idea that comes to mind is to see if you can pull the kernel's symbol table from the image or from
/proc/kallsyms
or somewhere, and reverse engineer at least the included drivers based on that. Though with something like 35000 symbols shown bykallsyms
on a stock distribution kernel, that would require some scripting.