有哪些方法可以恢复 Linux 内核配置?

Bri*_*ard 5 kernel-modules linux-kernel kernel-parameters

我目前正在尝试为专有设备重建内核。为此,我需要为设备生成内核配置。虽然我可以通过反复试验来做到这一点,但最好看看我是否可以从正在运行的主机中提取配置。

话虽如此,正在运行的内核不是用编译的CONFIG_IKCONFIG(因此也不CONFIG_IKCONFIG_PROC是)。这意味着没有/proc/config.gz提取。

此外,他们也没有费心将配置打包/boot。因此,通常存储内核配置的两个常见位置是不走运的。

大多数东西都是静态编译到这个内核中的:

 # 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
 #
Run Code Online (Sandbox Code Playgroud)

ilk*_*chu 5

想到的一个可以说是愚蠢的想法是,看看是否可以从映像或/proc/kallsyms某处提取内核的符号表,并基于此至少对所包含的驱动程序进行逆向工程。尽管kallsyms在股票发行内核上显示了 35000 个符号,但这需要一些脚本。