Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] boot/uboot: add support for u-boot-initial-env install
@ 2023-09-11  6:19 James Hilliard
  2024-03-15 10:38 ` Andreas Naumann
  2024-04-03 19:57 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 4+ messages in thread
From: James Hilliard @ 2023-09-11  6:19 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard

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>
---
 boot/uboot/Config.in | 7 +++++++
 boot/uboot/uboot.mk  | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 21f19db890..d7f2912ebc 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -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
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index dda606a880..491f654cec 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -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
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-03 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11  6:19 [Buildroot] [PATCH 1/1] boot/uboot: add support for u-boot-initial-env install James Hilliard
2024-03-15 10:38 ` Andreas Naumann
2024-03-15 19:37   ` James Hilliard
2024-04-03 19:57 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox