使用buildroot自定义u-boot环境变量

时间:2018-11-19 12:48:47

标签: u-boot buildroot

如何使用buildroot作为操作系统构建系统向u-boot添加一组新的自定义环境变量?

我尝试使用外部树形补丁对include / configs / rpi.h进行补丁,以添加新变量,但kconfig脾气暴躁(抱怨后显示了补丁):

The following new ad-hoc CONFIG options were detected:
CONFIG_XXXXXX_ENV_SETTINGS

Please add these via Kconfig instead. Find a suitable Kconfig
file and add a 'config' or 'menuconfig' option.
Makefile:871: recipe for target 'all' failed



--- a/include/configs/rpi.h 2018-03-13 12:02:19.000000000 +0000
+++ b/include/configs/rpi.h 2018-11-19 12:32:15.728000000 +0000
@@ -140,0 +141,7 @@
+#define CONFIG_XXXXXX_ENV_SETTINGS \
+   "newboard=true" \
+   "hasFailedBoot=false" \
+   "hasFailedBootCount=0" \
+   "maximumFailedBootCount=3"  
+
+
@@ -145 +152,2 @@
-   BOOTENV
+   BOOTENV \
+   CONFIG_XXXXXX_ENV_SETTINGS

我可以使用uboot-menuconfig来设置特定于u-boot的内容,但不确定如何创建环境变量

1 个答案:

答案 0 :(得分:1)

您可以在uboot-menuconfig中设置CONFIG_USE_DEFAULT_ENV_FILE并将其指向包含完整默认环境的文件。

由于您使用的是Buildroot,所以请不要忘记通过更改其位置(Buildroot选项BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE)并运行make uboot-update-defconfig来保存修改后的U-Boot配置。