本文继续简单了解一下,uboot的图形化配置原理。具体了解 Kconfig语法。
之前文章了解了几个 Kconfig语法。地址如下:
顶层 Kconfig 中的 “General setup” 子菜单内容如下:
- menu "General setup"
- config LOCALVERSION
- string "Local version - append to U-Boot release"
- ...................
- config LOCALVERSION_AUTO
- bool "Automatically append version information to the version string"
- default y
- ...................
- config SYS_MALLOC_F_LEN
- hex "Size of malloc() pool before relocation"
- ...................
- endif
- endmenu # General setup
顶层 Kconfig中,第 1行中,以 config 关键字开头,后面跟着 LOCALVERSION,LOCALVERSION就是配置项名字。
config 条目都是以 config条目开头的。后面紧跟着配置项名,例如,LOCALVERSION,使能了条目以后,就会在 .config文件 里面添加 CONFIG_LOCALVERSION=y。
config 关键字下面的这几行是配置项属性,3~5 行是 LOCALVERSION 的属性。
source "arch/Kconfig"
顶层 Kconfig 读取 uboot根目录下的 arch/目录下的 Kconfig。
- choice
- prompt "Architecture select"
- default SANDBOX
- config ARC
- bool "ARC architecture"
- .................
-
- config ARM
- bool "ARM architecture"
- .................
- config X86
- bool "x86 architecture"
- .................
- endchoice
- config HAVE_GENERIC_BOARD
- bool
-
- config SYS_GENERIC_BOARD
- bool
- depends on HAVE_GENERIC_BOARD
-
- choice
- prompt "Architecture select"
- default SANDBOX
-
- config ARC
- bool "ARC architecture"
- select HAVE_PRIVATE_LIBGCC
- select HAVE_GENERIC_BOARD
- select SYS_GENERIC_BOARD
- select SUPPORT_OF_CONTROL
- config NAND_ARASAN
- bool "Configure Arasan Nand"
- help
- This enables Nand driver support for Arasan nand flash
- controller. This uses the hardware ECC for read and
- write operations.
-
- comment "Generic NAND options"
-> Device Drivers-> NAND Device Support
如下图所示: