从 5.2+ Linux 内核开始,CONFIG 可以接收第二个文件.config
并将它们自动合并到最终的.config
.
但首先,在关于配置文件差异的稍微相关的注释中,为了显示您的旧.config
版本与 Linux 内核新发布的版本之间的差异,请执行:
make listnewconfig
(outputs a list of CONFIG_* that are newly added over old .config)
配置文件列表
使用包含文件列表的实用程序KCONFIG_DEFCONFIG_LIST
读取 ' ' shell 定义,每个文件由空格分隔。make
config.network
将与Makefile
Linux 内核位于同一目录中。
CONFIG_BRIDGE=y
CONFIG_ARP=y
CONFIG_IP=y
CONFIG_IP6=y
并且config.notebook-toshiba
可能有
CONFIG_SCSI=y
CONFIG_AHCI=y
CONFIG_RTC_INTF_DEV=y
然后执行:
KCONFIG_DEFCONFIG_LIST="config.network config.notebook-toshiba" make bzImage modules
Miniconfig 方法
(部分基于来自/来自 Rob Landley 的 lkml 电子邮件,re: miniconfig)
///变体还可以将环境变量用作标志allyesconfig
或文件名allmodconfig
,其中包含用户需要设置为特定值的配置符号。allnoconfig
randconfig
KCONFIG_ALLCONFIG
如果KCONFIG_ALLCONFIG
在没有文件名的情况下使用 whereKCONFIG_ALLCONFIG == “”</code> or KCONFIG_ALLCONFIG == “1”</code>, make *config checks for a file named “<code>all{yes/mod/no/def/random}.config
” (corresponding to the *config command that was used) for symbol values that are to be forced.
If this file is not found, it checks for a file named “all.config” to contain forced values.
This enables you to create “miniature” config (miniconfig
) or custom config files containing just the config symbols that you are interested in. Then the kernel config system generates the full .config
file, including symbols of your miniconfig file.
This ‘<code>KCONFIG_ALLCONFIG
' 文件是一个配置文件,其中包含(通常是所有的子集)预设配置符号。这些变量设置仍需接受正常的依赖性检查。
例子:
KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig
或者:
KCONFIG_ALLCONFIG=mini.config make allnoconfig
或者:
make KCONFIG_ALLCONFIG=mini.config allnoconfig
这些示例将禁用大多数选项 (allnoconfig),但启用或禁用在指定 mini-config 文件中明确列出的选项。
参考