u-boot-2014.10编译xxxx_defconfig

本文深入解读了U-Boot在编译过程中如何使用defconfig配置文件进行自定义设置,以及编译流程中关键步骤的执行顺序。通过分析顶层Makefile和scripts/multiconfig.sh脚本,揭示了如何从xxxx_defconfig生成最终的.config文件,从而实现灵活且高效的内核定制。

编译xxxx_defconfig

在顶层Makefile中,有如下规则编译xxxx_defconfig。这和编译menuconfig的过程是一样的,请参考u-boot-2014.10编译menuconfig
<span style="font-family:Microsoft YaHei;">%config: scripts_basic outputmakefile FORCE
	+$(Q)$(CONFIG_SHELL) $(srctree)/scripts/multiconfig.sh $@</span>

在3个依赖编译完成后,会调用scripts/multiconfig.sh,参数为xxxx_defconfig。multiconfig.sh会调用do_board_defconfig --> run_make_config --> build

在build中会引入scripts/kconfig/Makefile,有如下规则:

<span style="font-family:Microsoft YaHei;">%_defconfig: $(obj)/conf
	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)</span>
这里要注意,我们送给顶层Makefile的目标是xxxx_defconfig,而在multiconfig.sh中,送给scripts/kconfig/Makefile的目标是.tmp_defconfig。为了编译xxxx_defconfig,我们调用了multiconfig.sh,而实际上,最终的输出时.tmp_defconfig --> .config,并没有真正生成xxxx_defconfig。上面的规则最终会输出这样的指令:

scripts/kconfig/conf --defconfig=arch/../configs/.tmp_defconfig Kconfig

我没有去读conf.c的源码,只是看了它的简单描述。

"  --defconfig <file>      New config with default defined in <file>\n"


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值