boot/uboot: add support for u-boot-initial-env install

This file is needed by libubootenv for fw_printenv/fw_setenv and
library API's to function when the environment is empty.

See details:
https://github.com/sbabic/libubootenv/tree/v0.3.4#replacement-old-tools

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Reviewed-by: Andreas Naumann <anaumann@ultratronik.de>
Tested-by: Andreas Naumann <anaumann@ultratronik.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
James Hilliard 2023-09-11 00:19:40 -06:00 committed by Thomas Petazzoni
parent 3807f906c9
commit 399deb6764
2 changed files with 15 additions and 0 deletions

View File

@ -506,6 +506,13 @@ config BR2_TARGET_UBOOT_SPL_NAME
and TPL name is tpl/u-boot-tpl.bin but not always. SPL name is
MLO on OMAP and SPL on i.MX6 for example.
config BR2_TARGET_UBOOT_INITIAL_ENV
bool "Install u-boot-initial-env"
help
Install the U-Boot u-boot-initial-env on the target.
This file is typically required by libubootenv.
config BR2_TARGET_UBOOT_ZYNQMP
bool "Boot on the Xilinx ZynqMP SoCs"
depends on BR2_aarch64

View File

@ -138,6 +138,14 @@ UBOOT_MAKE_TARGET += u-boot.stm32
endif
endif
ifeq ($(BR2_TARGET_UBOOT_INITIAL_ENV),y)
UBOOT_MAKE_TARGET += u-boot-initial-env
define UBOOT_INSTALL_UBOOT_INITIAL_ENV
$(INSTALL) -D -m 0644 $(@D)/u-boot-initial-env $(TARGET_DIR)/etc/u-boot-initial-env
endef
UBOOT_POST_INSTALL_TARGET_HOOKS += UBOOT_INSTALL_UBOOT_INITIAL_ENV
endif
ifeq ($(BR2_TARGET_UBOOT_FORMAT_CUSTOM),y)
UBOOT_BINS += $(call qstrip,$(BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME))
endif