[Buildroot] [PATCH] package/uboot-tools: use uboot host tool printinitialenv to extract env

Heiko Thiery heiko.thiery at gmail.com
Mon Sep 8 13:02:38 UTC 2025


Hi,

I add Arnout here with the actual address, since I used his old mail address.

Am Fr., 5. Sept. 2025 um 14:38 Uhr schrieb Heiko Thiery
<heiko.thiery at gmail.com>:
>
> If u-boot is compiled with the LTO option, it is no longer possible to
> use the script 'get_default_envs.sh'. The problem was already observed
> and a solution available upstream u-boot since the commit 486aef08de09 [1].
> This was first available in release v2023.04.
>
> Instead of using the script the new tool 'printinitialenv' is used. The
> tool is build with u-boot that is a dependency of this package.
>
> [1] https://source.denx.de/u-boot/custodians/u-boot-tegra/-/commit/486aef08de091ca35386f32fe961a201c3cfa9d4
>
> Signed-off-by: Heiko Thiery <heiko.thiery at gmail.com>
> ---
>
> The question I ask myself is, how can this problem be solved for older
> U-Boot versions, or how can both options be supported? With the proposed
> option, old U-Boats will no longer build.
>
>  boot/uboot/uboot.mk                | 4 ++++
>  package/uboot-tools/uboot-tools.mk | 5 +----
>  2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 2796b0a310..66264bb3f0 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -144,6 +144,10 @@ UBOOT_MAKE_TARGET += u-boot.stm32
>  endif
>  endif
>
> +ifeq ($(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE),y)
> +UBOOT_MAKE_TARGET += u-boot-initial-env
> +endif
> +
>  ifeq ($(BR2_TARGET_UBOOT_INITIAL_ENV),y)
>  UBOOT_MAKE_TARGET += u-boot-initial-env
>  define UBOOT_INSTALL_UBOOT_INITIAL_ENV
> diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
> index 1925047ccd..25d7b26c6a 100644
> --- a/package/uboot-tools/uboot-tools.mk
> +++ b/package/uboot-tools/uboot-tools.mk
> @@ -154,10 +154,7 @@ HOST_UBOOT_TOOLS_DEPENDENCIES += uboot
>  ifeq ($(UBOOT_TOOLS_GENERATE_ENV_FILE),)
>  UBOOT_TOOLS_GENERATE_ENV_FILE = $(@D)/boot-env-defaults.txt
>  define HOST_UBOOT_TOOLS_GENERATE_ENV_DEFAULTS
> -       CROSS_COMPILE="$(TARGET_CROSS)" \
> -               $(UBOOT_SRCDIR)/scripts/get_default_envs.sh \
> -               $(UBOOT_SRCDIR) \
> -               > $(UBOOT_TOOLS_GENERATE_ENV_FILE)
> +       $(UBOOT_SRCDIR)/tools/printinitialenv > $(UBOOT_TOOLS_GENERATE_ENV_FILE)
>  endef
>  endif # UBOOT_TOOLS_GENERATE_ENV_FILE
>  endif # BR2_TARGET_UBOOT
> --
> 2.39.5
>


More information about the buildroot mailing list