defconfig、 .config
最近在裁剪內核慢慢關注這個問題
defconfig、 .config
?
defconfig 一般在arch/arm64/configs/目錄下,是一個簡單的內核配置,是沒有展開的。
.config一般是用來執行make menuconfig的基礎配置
從.config到defcong不是簡單的復制操作,而是make arch=arm64 defcong?
通過menuconfig生成的.confg也不是直接拷貝成defcong,而是使用make savedefconfig
?
The?.config?file is not simply copied from your?defconfig?file. The motivation for storing?defconfig?in such a format is next: in?defconfig?we can only specify options with non-default values (i.e. options we changed for our board). This way we can keep it small and clear. Every new kernel version brings a bunch of new options, and this way we don't need to update our?defconfig?file each time the kernel releases. Also, it should be mentioned that kernel build system keeps very specific order of options in?defconfig?file, so it's better to avoid to modify it by hand. Instead you should use?make savedefconfig?rule.
Simplified explanation
When?.config?file is being generated, kernel build system goes through all?Kconfig?files (from all subdirs), checking all options in those?Kconfig?files:
- if option is mentioned in?defconfig, build system puts that option to?.config?with value chosen in?defconfig
- if option isn't mentioned in?defconfig, build system puts that option to?.config?using its default value, specified in corresponding?Kconfig
Check?scripts/kconfig/Makefile?and?scripts/kconfig/conf.c?files to see how it's actually done.
?
具體查看
https://stackoverflow.com/questions/41885015/what-exactly-does-linux-kernels-make-defconfig-do
總結
以上是生活随笔為你收集整理的defconfig、 .config的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: VSCode使用eclipse快捷键
- 下一篇: Linux shell sed awk