Skip to contentSkip to conversation

package/uboot-tools: depend on u-boot when selected

PATCH New Thomas De Schampheleire 3 participants 4 messages Feb 16, 2021 – Feb 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/uboot-tools: depend on u-boot when selected

From: Thomas De Schampheleire <[email protected]>

The envimage creation logic only depended on u-boot when the user did not specify a custom envimage source via BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE . This assumes that a user-provided envimage source is never coming from the u-boot source tree.

But especially given the fact that the envimage creation logic used to be part of the u-boot package, this is a realistic scenario: users may have provided a value of BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE based on $(UBOOT_DIR), e.g.:

    $(UBOOT_DIR)/board/foo-vendor/bar-board/env.txt

Therefore, always add the u-boot dependency if u-boot is selected, for either case of custom or default envimage source.

---
 package/uboot-tools/uboot-tools.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/uboot-tools/uboot-tools.mk +7 -1
index a0cdcafd4e..8d902863b4 100644
@@ -121,9 +121,15 @@ define HOST_UBOOT_TOOLS_GENERATE_ENV_DEFAULTS
 		$(UBOOT_SRCDIR) \
 		> $(UBOOT_TOOLS_GENERATE_ENV_FILE)
 endef
-HOST_UBOOT_TOOLS_DEPENDENCIES += uboot
 endif #UBOOT_TOOLS_GENERATE_ENV_FILE:BR2_TARGET_UBOOT
 
+ifeq ($(BR2_TARGET_UBOOT),y)
+# a user provided BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE may be located in
+# the u-boot sources, via $(UBOOT_DIR), so we need this dependency in either
+# case.
+HOST_UBOOT_TOOLS_DEPENDENCIES += uboot
+endif #BR2_TARGET_UBOOT
+
 ifeq ($(BR_BUILDING),y)
 ifeq ($(call qstrip,$(BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE)),)
 $(error Please provide U-Boot environment size (BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE setting))
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/1 package/uboot-tools: depend on u-boot when selected

Quoted 15 lines · On Tue, 16 Feb 2021 15:20:07 +0100 Thomas De Schampheleire…

From: Thomas De Schampheleire <[email protected]>

The envimage creation logic only depended on u-boot when the user did not specify a custom envimage source via BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE . This assumes that a user-provided envimage source is never coming from the u-boot source tree.

But especially given the fact that the envimage creation logic used to be part of the u-boot package, this is a realistic scenario: users may have provided a value of BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE based on $(UBOOT_DIR), e.g.:

    $(UBOOT_DIR)/board/foo-vendor/bar-board/env.txt
Quoted 7 lines

Therefore, always add the u-boot dependency if u-boot is selected, for either case of custom or default envimage source.

---
 package/uboot-tools/uboot-tools.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

I've applied to master, after slightly reworking the logic. Indeed you had this:

ifeq ($(env):$(uboot),:y)
...
endif

ifeq ($(uboot),y)
...
endif

Which I modified to:

ifeq ($(uboot),y)
...

ifeq ($env),)
...
endif
endif

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/uboot-tools: depend on u-boot when selected

Quoted 40 lines · On Tue, Feb 16, 2021, 21:23 Thomas Petazzoni <[email protected]>…
Quoted 13 lines · On Tue, 16 Feb 2021 15:20:07 +0100 Thomas De Schampheleire…

From: Thomas De Schampheleire <[email protected]>

The envimage creation logic only depended on u-boot when the user did not specify a custom envimage source via BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE . This assumes that a user-provided envimage source is never coming from the u-boot source tree.

But especially given the fact that the envimage creation logic used to be part of the u-boot package, this is a realistic scenario: users may have provided a value of BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE based on $(UBOOT_DIR), e.g.:

Quoted 6 lines
    $(UBOOT_DIR)/board/foo-vendor/bar-board/env.txt

Therefore, always add the u-boot dependency if u-boot is selected, for either case of custom or default envimage source.

Signed-off-by Thomas De Schampheleire <

thomas.de_schampheleire at nokia.com>

Quoted 3 lines
---
 package/uboot-tools/uboot-tools.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

I've applied to master, after slightly reworking the logic. Indeed you had this:

ifeq ($(env):$(uboot),:y)
...
endif

ifeq ($(uboot),y)
...
endif

Which I modified to:

Quoted 7 lines

ifeq ($(uboot),y)
...

ifeq ($env),)
...
endif
endif

Ok, perfect, thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210216/a4e40095/attachment.html>

#3 lore raw

PATCH 1/1 package/uboot-tools: depend on u-boot when selected

In reply to Thomas De Schampheleire
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

From: Thomas De Schampheleire <[email protected]> The envimage creation logic only depended on u-boot when the user did not specify a custom envimage source via BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE . This assumes that a user-provided envimage source is never coming from the u-boot source tree.

But especially given the fact that the envimage creation logic used to be part of the u-boot package, this is a realistic scenario: users may have provided a value of BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE based on $(UBOOT_DIR), e.g.:

Quoted 6 lines
    $(UBOOT_DIR)/board/foo-vendor/bar-board/env.txt

Therefore, always add the u-boot dependency if u-boot is selected, for either case of custom or default envimage source.

Committed to 2020.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard