如果只有一个内核映像文件,想要获取他的 .config 配置,有如下两个方法
前提是内核中选择了:
General setup --->
<*> Kernel .config support
[*] Enable access to .config through /proc/config.gz
─────────────────Kernel .config support ────────────────
│ CONFIG_IKCONFIG: │
│ │
│ This option enables the complete Linux kernel ".config" file │
│ contents to be saved in the kernel. It provides documentation │
│ of which kernel options are used in a running kernel or in an │
│ on-disk kernel. This information can be extracted from the kernel │
│ image file with the script scripts/extract-ikconfig and used as │
│ input to rebuild the current kernel or to build another kernel. │
│ It can also be extracted from a running kernel by reading │
│ /proc/config.gz if enabled (below).
1. 运行此内核,在 /proc/config.gz 中的 config.gz 就是此内核的config了,将其copy 出来就可以了
2. 相比上一个方法,这个要方便许多,进入 内核源码目录:
# scripts/extract-ikconfig zImage
会在终上端打印出此kenrel 的.config
阅读(1864) | 评论(0) | 转发(1) |