Kconfig之 .config和defconfig的区别

news/2024/10/18 10:15:07/

在Linux内核里,编译内核文件时,先要配置.config文件,然后Makefile在编译时通过读取.config文件的配置来选择要编译的文件,选择驱动的加载方式。
 
defconfig 一般在arch/arm64/configs/目录下,是一个没有展开的内核配置,需要配合Kconfig展开成.config
从defconfig到.config不是简单的复制操作,而是make ARCH=arm64 defconfig
.confg也不是直接拷贝成defconfig,而是使用make ARCH=arm64 savedefconfig
 
 
正确使用和保存deconfig的流程:
1. 要修改在arch/arm/configs下的文件xxx_defconfig
2. make ARCH=arm64 xxx_defconfig 会生成.config文件
3. make ARCH=arm64 menuconfig 修改配置后保存
4. make ARCH=arm64 savedefconfig 生成defconfg文件
5. cp defconfig arch/arm/configs/xxx_defconfig 保存
这样保存的defconfig文件,配置最小化,且日后能恢复成.config。
 
 
.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.
 
 
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中,没必要重复保存。
 


http://www.ppmy.cn/news/383904.html

相关文章

西门子PPI协议开发

目录 西门子PPI协议开发 1 协议介绍 2 仿真环境 2.1 安装修改仿真软件 2.2 设置PPI串口 3 报文示例 西门子PPI协议开发 西门子PPI协议适用S7-200、S7-200SMART PLC。 1 协议介绍 仔细读下,用于开发是满足的,不用再去找其他文章了。网上找了不少&a…

(AMD)笔记本报DRIVER_POWER_STATE_FAILURE蓝屏重启后无法调整亮度问题的解决方法

前因 我个人是在看番的时候突然屏幕卡住不动了,然后屏幕开始逐渐变花,直到蓝屏跳出这个报错代码。 重启后然后我用DirectX诊断工具看了一下,发现这里红色框中的内容都没有正常显示,显示没有相关信息(下图是正常的&am…

amd显卡驱动linux 卸载,AMD Clean Uninstall Utility

AMD Clean Uninstall Utility是由AMD官方出品的一款简单易用,完全的AMD显卡驱动卸载工具。不仅可以删除任何以前安装的AMD Catalyst™显示器和音频驱动程序,还可以清除系统中的剩余文件和注册表项,对于需要重新安装显卡驱动或更换显卡硬件的用…

【问题解决】AMD驱动安装出现182错误

问题描述 AMD驱动安装时出现提示:错误182 - Radeon Software 安装在系统配置中检测到不受此软件安装支持的AMD图形硬件 问题解决 卸载当前驱动(控制面板 -> 卸载程序 -> 选择AMD Software右键卸载)重启电脑根据显卡型号下载并安装最…

ARM和AMD区别

【x86和x64】 1、泛指一系列由英特尔公司开发的处理器的架构,最早为1978年面世的“Intel 8086”CPU。早期的处理器均是以此格式来命名,如Intel 8086,80186,80286,80386,80486,这些架构被统称为x86。由于数字不能被注册成为商标,因此公司每当…

网络计算机amd,AMD多屏显示设置指南_计算机硬件和网络_IT /计算机_信息

AMD多屏显示设置指南界面介绍?左图显示了盈通图形卡,并且每个接口定义都在边框(红色圆圈)上标记。右图显示了HIS图形卡,从上到下有两个miniDP和HDMI,DVI-I(左),DVI-D(右)?其中,D-sub是模拟信号&…

amd显卡linux命令,在deepin系统动态切换intel+amd笔记本显卡运行应用的方法

本文介绍在deepin系统动态切换intelamd笔记本显卡运行应用,最初的想法是使用amd显卡玩steam上的游戏,现在分享具体的方法。 第一步、首先查看一下双显卡方案是否支持新动态切换方案-ATI动态可切换图形方案 终端执行命令:“sudo cat /sys/kern…

图形调试工具收集

Intel GPA, RenderDoc, NVIDIA NSight或者 AMD GPU PerfStudio运