Correctly Save the. config file generated by the compiled kernel-use make savedefconfig
Correctly Save the. config file generated by the compiled kernel-use make savedefconfig
The. config file generated by the kernel has been saved and compiled by cp. config arch/arm/configs/xxx_defconfig. But this is actually an incorrect method. Let me explain the cause.
I have never cared about this problem until I encountered a difference between. config generated by make xxx_defconfig and the original xxx_defconfig and solved it, which caused my doubts about the Saving Method of. config. The default xxx_defconfig file saved in arch/arm/configs/is not a complete. config file. In fact, after executing make xxx_defconfig, the generated. config will be nearly 2000 rows more than the original configuration. These configurations are automatically added in make xxx_defconfig.
Some general content is not saved. How can I get rid of the general content in. config? The make savedefconfig command is provided in the kernel.
Savedefconfig-Save current config as./defconfig (minimal config)
From: https://www.kernel.org/doc/makehelp.txt
This has many advantages, saving space so that the amount of code in the Linux kernel is not too large. The second difference is better compared. More importantly, this is an orthodox approach. Complete command:
$ Make savedefconfig & mv defconfig arch/arm/configs/xxx_defconfig
The following is a difference between. config generated by make xxx_defconfig and the original xxx_defconfig:
1. Floor
The configuration file specified by the kernel sent by the vendor is xxx_defconfig. The. config generated by the make xxx_defconfig command is different from xxx_defconfig. I have never cared about this problem before. This time, when I develop a kernel from the ground up, this problem occurs. It's weird. What if I want to save this. config after I add my own configuration? Why are there differences when I have not added any configurations. I really don't understand this.
The test method is to use the mini2440 development version to configure mini2440_defconfig. Where did these things be added? I guess it was added in Makefile, but I'm not sure. Has anyone studied it?
2. Floor
In the past, I used to copy mini2440_defconfig. config to generate a. config file when I learned MIni2440. Using make mini2440_defconfig is much more troublesome. As follows:
$ make mini2440_defconfig -nmake -f scripts/Makefile.build obj=scripts/basic:rm -f .tmp_quiet_recordmcountmkdir -p include/linux include/configmake -f scripts/Makefile.build obj=scripts/kconfig mini2440_defconfigset -e; echo ' HOSTLD scripts/kconfig/conf'; gcc -o scripts/kconfig/conf scripts/kconfig/conf.o scripts/kconfig/zconf.tab.o ; echo 'cmd_scripts/kconfig/conf := gcc -o scripts/kconfig/conf scripts/kconfig/conf.o scripts/kconfig/zconf.tab.o ' > scripts/kconfig/.conf.cmdscripts/kconfig/conf --defconfig=arch/arm/configs/mini2440_defconfig Kconfig$
A little tangled. Using this method is still copy, so there is a reason that make xxx_defconfig is the same.
3. Floor
Next, I found the problem. The two implementation results are eventually the same. The following is the verification process, using mini2440_defconfig as an example.
$ cp arch/arm/configs/mini2440_defconfig .config$ make menuconfigscripts/kconfig/mconf arch/arm/Kconfig## configuration written to .config# *** End of Linux kernel configuration.*** Execute 'make' to build the kernel or try 'make help'.$ cp .config .config_bak$ make mini2440_defconfig## configuration written to .config#$ diff .config .config_bak 4c4< # Thu Sep 25 15:23:14 2014---> # Thu Sep 25 15:22:54 2014$
The. config generated by make xxx_defconfig can directly make zImage, which is equivalent to copying mini2440_defconfig. config and then executing make menuconfig.