declare -x ARCH="arm"
declare -x CROSS_COMPILE="arm-buildroot-linux-uclibcgnueabihf-"
make infinity6_cardv_defconfig //使用配置infinity6_cardv_defconfig
make
xxx@chejiser:~/ssc323/ssc323bsp/kernel$ cat Kconfig
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux/$ARCH $KERNELVERSION Kernel Configuration"
config SRCARCH
string
option env="SRCARCH"
source "arch/$SRCARCH/Kconfig" //关键代码,$SRCARCH是ARCH目标平台
.config
All config symbol values are saved in a special file called .config . Every time you want to change a kernel compile configuration, you execute a make target, such as menuconfig or xconfig . These read the Kconfig files to create the menus and update the config symbols' values using the values defined in the .config file.
Additionally, these tools update the .config file with the new options you chose and also can generate one if it didn't exist before.
Because the .config file is plain text, you also can change it without needing any specialized tool.
It is very convenient for saving and restoring previous kernel compilation configurations as well.
* .config文件会保存所有的配置,是最终文件。
deconfig
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 modifying it by hand. Instead you should use make savedefconfig rule.
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 into .config with value chosen in defconfig
if option isn't mentioned in defconfig , build system puts that option into .config using its default value, specified in corresponding Kconfig
* 根据上述描述,xxx_deconfig中只保存那些没有默认值的option(但被用户修改过的option除外,如config_xxx默认值为y,但是被用户修改为n,那么config_xxx将被保存进deconfig) ,因为有默认值的option保存在Kconfig中,没必要重复保存。