package/uboot-tools: use uboot host tool printinitialenv to extract env
PATCH 1/1 package/uboot-tools: use uboot host tool printinitialenv to extract env
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.
---
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(-)
boot/uboot/uboot.mk +4 -0
@@ -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
package/uboot-tools/uboot-tools.mk +1 -4
@@ -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
Signature · 6 lines
2.39.5 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
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 <[email protected]>:
Quoted 54 lines
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 commit486aef08de09[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.
Signed-off-by Heiko Thiery <[email protected]>---
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(-)boot/uboot/uboot.mk +4
-0@@ -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_ENVpackage/uboot-tools/uboot-tools.mk +1
-5@@ -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 --
Quoted 2 lines
2.39.5
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi,
Quoted 11 lines · Heiko Thiery
Quoted 11 lines
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 commit486aef08de09[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.
Signed-off-by Heiko Thiery <[email protected]>
Is there any update on this? This really blocks us using the stock buildroot with CONFIG_LTO in the bootloader (which is the default for the TI SoCs now) and BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE.
-michael
Quoted 5 lines
Quoted 5 lines
---
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.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 8 lines · Heiko Thiery
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 commit486aef08de09[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.
Quoted 8 lines
Signed-off-by Heiko Thiery <[email protected]>---
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.
See below.
Quoted 25 lines
boot/uboot/uboot.mk | 4 ++++ package/uboot-tools/uboot-tools.mk | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-)boot/uboot/uboot.mk +4
-0@@ -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_ENVpackage/uboot-tools/uboot-tools.mk +0
-0
package/uboot-tools/uboot-tools.mk HOST_UBOOT_TOOLS_DEPENDENCIES += uboot · line 157
Quoted 8 lines
package/uboot-tools/uboot-tools.mk +1
-4@@ -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)
You can use a shell condition here to choose one or the other based on existence:
if [ -x $(UBOOT_SRCDIR)/tools/printinitialenv ]; then ... Use pintinitialenv ... else ... Use get_default_envs.sh ... fi
Regards,
Arnout
package/uboot-tools/uboot-tools.mk HOST_UBOOT_TOOLS_DEPENDENCIES += uboot · line 160
Quoted 3 lines
package/uboot-tools/uboot-tools.mk +0
-0endef endif # UBOOT_TOOLS_GENERATE_ENV_FILE endif # BR2_TARGET_UBOOT
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot