让三个开源模型互相抬杠:多模型辩论实战指南
2026/10/11 4:57:05
Kconfig中定义的配置宏,前缀都没有CONFIG_,只有编译内核时,自动生成autoconf.h才会出现前缀.XX_defconfig板卡配置文件中定义新的宏=y时,而在Kconfig并没有声明它,则内核编译出来的autoconf.h里也不会定义它的.XX_defconfig板卡配置文件中没有设置CONFIG_MODULES=y则编译make modules时将会失败,而make menuconfig时,Kconfig中的tristate参数也会被读写为bool参数(也就是不能设置m)| 名词 | 说明 |
|---|---|
config | 一个选项 |
default | 默认配置项 |
help | help 提示信息专用 |
prompt | 提示信息 |
comment | 相当于一行说明 |
choice | 单选框, choice 中的 config 参数只能b ool 或 tristate |
endchoice | 与choice配对使用 |
depends on | 依赖项 |
select | 反依赖项 |
range | 数据范围range 0 100表述数据范围 0~100 |
if | 判断 |
endif | 与if配对使用 |
menu | 进入下个界面的菜单, 点击Enter键就能够进入这个menu所对应的界面 |
endmenu | 与menu配对使用 |
menuconfig | 可选的菜单,选择它,它就相当于成了一个菜单入口 |
| 类型 | |
|---|---|
bool | y – 默认选中 |
| n – 默认不选 | |
tristate | y – 将驱动编译进内核镜像 |
| n – 不编译 | |
| m – 将驱动编译为ko形式 | |
string | 普通字符串类型 |
hex | 十六进制形式 |
int | 十进制整数 |
config AAA bool "config AAA" default y config BB int "config BB" default 123 config CC string "config CC" default 123 config DD hex "config DD" default 0x123 config EE tristate "config EE" default ytristate没有启用, 所以为默认为了bool类型备注 : 如果退格不能删除 请使用Ctrl + 退格
menu "this is menu info" comment "*** menu config ***" config AAA bool "config AAA" default y config BBB bool "config BBB" default n config CCC bool "config CCC" default n endmenucomment "*** menuconfig config ***" menuconfig AAA bool "using AAA" if AAA config BBB bool "using BBB" default y endifconfig AAA bool "config AAA" select BBB # AAA 被选中后, BBB 也被选中 default y config BBB bool "config BBB" default yconfig XXX bool "config XXX" default y config YYY bool "config YYY" depends on XXX # 表示依赖, XXX 被选中 才会有 YYY default ychoice prompt "choice entry" # 作为该单选框入口点的标签 default y default AAA # 默认选择 AAA 配置项 config AAA bool "config AAA" help AAA help info config BBB bool "config BBB" help BBB help info config CCC bool "config CCC" help CCC help info endchoicedir/Kconfig文件内容config AAA bool "config AAA" select BBB # AAA 被选中后, BBB 也被选中 default y config BBB bool "config BBB" default y./Kconfig文件内容source service/elog/Kconfig