Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional
@ 2026-10-24 21:53 Fiona Klute via buildroot
  2026-10-24 21:53 ` [Buildroot] [PATCH v2 2/2] configs/engicam_px30_core_defconfig: require pkg_resources for binman Fiona Klute via buildroot
  2026-10-25 14:01 ` [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Klute via buildroot @ 2026-10-24 21:53 UTC (permalink / raw)
  To: buildroot; +Cc: Meena Murthy, James Hilliard, Thomas Petazzoni, Fiona Klute

Binman needs pkg_resources only in U-Boot versions before 2025.10,
otherwise the dependency is unnecessary and best avoided.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
Tested with engicam_px30_core_defconfig, which uses U-Boot
2025.04. With BR2_TARGET_UBOOT_BINMAN_NEEDS_PKG_RESOURCES=y the build
works, without it binman fails because it cannot import pkg_resources.

engicam_px30_core_defconfig appears to be the only defconfig that uses
binman *and* a U-Boot version < 2025.10 according to output of:

grep UBOOT_CUSTOM $(grep -R -l BR2_TARGET_UBOOT_USE_BINMAN configs/)

Nonetheless, if any defconfigs you care about use binman, please
verify and if needed (preferably) update U-Boot or enable
BR2_TARGET_UBOOT_BINMAN_NEEDS_PKG_RESOURCES=y.

 boot/uboot/Config.in | 14 ++++++++++++++
 boot/uboot/uboot.mk  |  4 +++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 381a12197d..3e46293796 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -379,6 +379,20 @@ config BR2_TARGET_UBOOT_USE_BINMAN
 
 	  https://docs.u-boot.org/en/v2026.10/develop/package/binman.html
 
+if BR2_TARGET_UBOOT_USE_BINMAN
+
+config BR2_TARGET_UBOOT_BINMAN_NEEDS_PKG_RESOURCES
+	bool "Binman needs pkg-resources (U-Boot version < 2025.10)"
+	depends on BR2_TARGET_UBOOT_USE_BINMAN
+	help
+	  In U-Boot versions before 2025.10 binman uses the Python
+	  module pkg_resources, which used to be provided by
+	  python-setuptools before version 82.0.0. Select this option
+	  to use backported pkg_resources when building old U-Boot
+	  versions.
+
+endif
+
 menu "U-Boot binary format"
 
 config BR2_TARGET_UBOOT_FORMAT_AIS
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index a7e831f6c3..ed66feafd1 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -312,10 +312,12 @@ ifeq ($(BR2_TARGET_UBOOT_USE_BINMAN),y)
 # https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt
 UBOOT_DEPENDENCIES += \
 	host-python-jsonschema \
-	host-python-pkg-resources \
 	host-python-pyyaml \
 	host-python-yamllint
 UBOOT_MAKE_OPTS += BINMAN_INDIRS=$(BINARIES_DIR)
+ifeq ($(BR2_TARGET_UBOOT_BINMAN_NEEDS_PKG_RESOURCES),y)
+UBOOT_DEPENDENCIES += host-python-pkg-resources
+endif
 endif
 
 # prior to u-boot 2013.10 the license info was in COPYING. Copy it so
-- 
2.55.0

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

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

* [Buildroot] [PATCH v2 2/2] configs/engicam_px30_core_defconfig: require pkg_resources for binman
  2026-10-24 21:53 [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional Fiona Klute via buildroot
@ 2026-10-24 21:53 ` Fiona Klute via buildroot
  2026-10-25 14:01 ` [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Fiona Klute via buildroot @ 2026-10-24 21:53 UTC (permalink / raw)
  To: buildroot; +Cc: Meena Murthy, James Hilliard, Thomas Petazzoni, Fiona Klute

The defconfig uses U-Boot 2025.04, so binman fails without
pkg_resources.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
Compile-tested only to verify the U-Boot option, I do not have the
board.

Changes v1 -> v2:
* drop kernel version bump

 configs/engicam_px30_core_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/engicam_px30_core_defconfig b/configs/engicam_px30_core_defconfig
index be5c56e19f..b25d536488 100644
--- a/configs/engicam_px30_core_defconfig
+++ b/configs/engicam_px30_core_defconfig
@@ -36,6 +36,7 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y
 BR2_TARGET_UBOOT_USE_BINMAN=y
+BR2_TARGET_UBOOT_BINMAN_NEEDS_PKG_RESOURCES=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
 BR2_TARGET_UBOOT_SPL=y
-- 
2.55.0

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

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

* Re: [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional
  2026-10-24 21:53 [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional Fiona Klute via buildroot
  2026-10-24 21:53 ` [Buildroot] [PATCH v2 2/2] configs/engicam_px30_core_defconfig: require pkg_resources for binman Fiona Klute via buildroot
@ 2026-10-25 14:01 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-25 14:01 UTC (permalink / raw)
  To: Fiona Klute; +Cc: buildroot, Meena Murthy, James Hilliard

Hello,

Some very weak/minor suggestion below. Honestly not super important.

On Sat, Oct 24, 2026 at 11:53:29PM +0200, Fiona Klute wrote:
> +if BR2_TARGET_UBOOT_USE_BINMAN
> +
> +config BR2_TARGET_UBOOT_BINMAN_NEEDS_PKG_RESOURCES

I would prefer: BR2_TARGET_UBOOT_BINMAN_NEEDS_HOST_PYTHON_PKG_RESOURCES

> +	bool "Binman needs pkg-resources (U-Boot version < 2025.10)"

And here:

    bool "binman needs host-python-pkg-resources"

i.e:

- not uppercase binman
- mention the full package name instead of just pkg-resources
- keep the U-Boot < 2025.10 info in the help text only

> +	depends on BR2_TARGET_UBOOT_USE_BINMAN

"depends on" redundant with the fact that we are inside a "if
BR2_TARGET_UBOOT_USE_BINMAN...endif" block.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2026-10-25 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24 21:53 [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional Fiona Klute via buildroot
2026-10-24 21:53 ` [Buildroot] [PATCH v2 2/2] configs/engicam_px30_core_defconfig: require pkg_resources for binman Fiona Klute via buildroot
2026-10-25 14:01 ` [Buildroot] [PATCH v2 1/2] boot/uboot: make binman dependency on host-python-pkg-resources optional 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