public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
* [Buildroot] [v2, PATCH] Makefile: add 'show-info-all'
@ 2026-03-11 13:15 Thomas Perale via buildroot
  2026-03-28 20:51 ` Julien Olivain via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Perale via buildroot @ 2026-03-11 13:15 UTC (permalink / raw)
  To: buildroot

The maintainance and testing workflow sometimes requires to output a
list of every existing packages on Buildroot:

- Generating an SBOM of the whole Buildroot tree for
  security.buildroot.org
- List every sources for every packages for source.buildroot.org

The previous solution relied on `make allyesconfig` but always ran into
conflicts that needed manual resolution. Also some packages would not be
present because they are archicture dependant.

To avoid having to manually modify the 'show-info' command this commit
adds the 'show-info-all' command. It accesses the PACKAGES_ALL variable
with all the packages present on Buildroot independently of the
archicture or any config entries.

It forces the `BR2_HAVE_DOT_CONFIG` variable to be set to force the
reading of the packages mk files.

Signed-off-by: Thomas Perale <thomas.perale@mind.be>
---

v1 --> v2: removed TARGETS_ROOTFS and recursive dependencies. It
  introduced "host-" package with no name that introduced an empty
  entry when generating an sbom when `make show-info-all` is ran without
  defconfig.
  Checked the diff between the previous version and the new one and
  except the empty entry nothing is changed by just iterating over
  PACKAGES_ALL.

 Makefile | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f51155b0ed..bd037cc834 100644
--- a/Makefile
+++ b/Makefile
@@ -126,7 +126,7 @@ noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconf
 	defconfig %_defconfig allyesconfig allnoconfig alldefconfig syncconfig release \
 	randpackageconfig allyespackageconfig allnopackageconfig \
 	print-version olddefconfig distclean manual manual-% check-package \
-	check-package-external
+	check-package-external show-info-all
 
 # Some global targets do not trigger a build, but are used to collect
 # metadata, or do various checks. When such targets are triggered,
@@ -142,7 +142,7 @@ nobuild_targets := source %-source \
 	clean distclean help show-targets graph-depends \
 	%-graph-depends %-show-depends %-show-version \
 	graph-build graph-size list-defconfigs \
-	savedefconfig update-defconfig printvars show-vars
+	savedefconfig update-defconfig printvars show-vars show-info-all
 ifeq ($(MAKECMDGOALS),)
 BR_BUILDING = y
 else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
@@ -236,6 +236,13 @@ BR2_CONFIG = $(CONFIG_DIR)/.config
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 -include $(BR2_CONFIG)
 endif
+# show-info-all needs to access the PACKAGES_ALL variable. This variable
+# contains a reference to every packages present in Buildroot.
+# Since the 'show-info-all' command might be used without actually having a
+# dotconfig this condition is forced to be set true.
+ifeq ($(MAKECMDGOALS),show-info-all)
+BR2_HAVE_DOT_CONFIG = y
+endif
 
 ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),)
 # Disable top-level parallel build if per-package directories is not
@@ -941,6 +948,17 @@ show-info:
 		) \
 	)
 
+.PHONY: show-info-all
+show-info-all:
+	@:
+	$(info $(call clean-json, \
+			{ $(foreach p, \
+				$(sort $(PACKAGES_ALL)), \
+				$(call json-info,$(call UPPERCASE,$(p)))$(comma) \
+			) } \
+		) \
+	)
+
 .PHONY: pkg-stats
 pkg-stats:
 	@cd "$(CONFIG_DIR)" ; \
-- 
2.53.0

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

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

* Re: [Buildroot] [v2, PATCH] Makefile: add 'show-info-all'
  2026-03-11 13:15 [Buildroot] [v2, PATCH] Makefile: add 'show-info-all' Thomas Perale via buildroot
@ 2026-03-28 20:51 ` Julien Olivain via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Olivain via buildroot @ 2026-03-28 20:51 UTC (permalink / raw)
  To: Thomas Perale; +Cc: buildroot

Hi Thomas,

Thanks for the patch.

This new "show-info-all" should be documented in the
"make help" target, in the misc section:
https://gitlab.com/buildroot.org/buildroot/-/blob/2026.02/Makefile?ref_type=tags#L1204
saying it will show all packages available in Buildroot (not only
the selected ones). And possibly also in the manual:
https://gitlab.com/buildroot.org/buildroot/-/blob/2026.02/docs/manual/common-usage.adoc
in which you can say it is intended for Buildroot maintenance (sbom, 
cve, ...).

On 11/03/2026 14:15, Thomas Perale via buildroot wrote:
> The maintainance and testing workflow sometimes requires to output a
> list of every existing packages on Buildroot:
> 
> - Generating an SBOM of the whole Buildroot tree for
>   security.buildroot.org
> - List every sources for every packages for source.buildroot.org
> 
> The previous solution relied on `make allyesconfig` but always ran into
> conflicts that needed manual resolution. Also some packages would not 
> be
> present because they are archicture dependant.
> 
> To avoid having to manually modify the 'show-info' command this commit
> adds the 'show-info-all' command. It accesses the PACKAGES_ALL variable
> with all the packages present on Buildroot independently of the
> archicture or any config entries.
> 
> It forces the `BR2_HAVE_DOT_CONFIG` variable to be set to force the
> reading of the packages mk files.
> 
> Signed-off-by: Thomas Perale <thomas.perale@mind.be>
> ---
> 
> v1 --> v2: removed TARGETS_ROOTFS and recursive dependencies. It
>   introduced "host-" package with no name that introduced an empty
>   entry when generating an sbom when `make show-info-all` is ran 
> without
>   defconfig.
>   Checked the diff between the previous version and the new one and
>   except the empty entry nothing is changed by just iterating over
>   PACKAGES_ALL.
> 
>  Makefile | 22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index f51155b0ed..bd037cc834 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -126,7 +126,7 @@ noconfig_targets := menuconfig nconfig gconfig 
> xconfig config oldconfig randconf
>  	defconfig %_defconfig allyesconfig allnoconfig alldefconfig 
> syncconfig release \
>  	randpackageconfig allyespackageconfig allnopackageconfig \
>  	print-version olddefconfig distclean manual manual-% check-package \
> -	check-package-external
> +	check-package-external show-info-all
> 
>  # Some global targets do not trigger a build, but are used to collect
>  # metadata, or do various checks. When such targets are triggered,
> @@ -142,7 +142,7 @@ nobuild_targets := source %-source \
>  	clean distclean help show-targets graph-depends \
>  	%-graph-depends %-show-depends %-show-version \
>  	graph-build graph-size list-defconfigs \
> -	savedefconfig update-defconfig printvars show-vars
> +	savedefconfig update-defconfig printvars show-vars show-info-all
>  ifeq ($(MAKECMDGOALS),)
>  BR_BUILDING = y
>  else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),)
> @@ -236,6 +236,13 @@ BR2_CONFIG = $(CONFIG_DIR)/.config
>  ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
>  -include $(BR2_CONFIG)
>  endif
> +# show-info-all needs to access the PACKAGES_ALL variable. This 
> variable
> +# contains a reference to every packages present in Buildroot.
> +# Since the 'show-info-all' command might be used without actually 
> having a
> +# dotconfig this condition is forced to be set true.
> +ifeq ($(MAKECMDGOALS),show-info-all)
> +BR2_HAVE_DOT_CONFIG = y
> +endif
> 
>  ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),)
>  # Disable top-level parallel build if per-package directories is not
> @@ -941,6 +948,17 @@ show-info:
>  		) \
>  	)
> 
> +.PHONY: show-info-all
> +show-info-all:

On my Fedora 43 system, running "make show-info-all" with this patch
shows the errors:

support/dependencies/check-host-cmake.sh: line 35: [: cmake: integer 
expected
support/dependencies/check-host-cmake.sh: line 38: [: cmake: integer 
expected

but the expected output is generated after.

When running in the reference docker image, it works as expected:
utils/docker-run make show-info-all

For some reasons, on Fedora 43, the script is called with:

support/dependencies/check-host-cmake.sh cmake cmake3

It should be called with $(BR2_CMAKE_VERSION_MIN).
See:
https://gitlab.com/buildroot.org/buildroot/-/blob/2026.02/support/dependencies/check-host-cmake.mk#L11

for example:
support/dependencies/check-host-cmake.sh 3.18 cmake cmake

I believe in your case of show-info-all, those dependencies checks
should not be called at all.

> +	@:
> +	$(info $(call clean-json, \
> +			{ $(foreach p, \
> +				$(sort $(PACKAGES_ALL)), \
> +				$(call json-info,$(call UPPERCASE,$(p)))$(comma) \
> +			) } \
> +		) \
> +	)
> +
>  .PHONY: pkg-stats
>  pkg-stats:
>  	@cd "$(CONFIG_DIR)" ; \
> --
> 2.53.0

Could you add the small documentation description and improve
the srcipt to avoid the errors, please?

Best regards,

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

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

end of thread, other threads:[~2026-03-28 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 13:15 [Buildroot] [v2, PATCH] Makefile: add 'show-info-all' Thomas Perale via buildroot
2026-03-28 20:51 ` Julien Olivain via buildroot

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