Makefile: add 'show-info-all'
PATCH v2 1/1 Makefile: add 'show-info-all'
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.
---
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(-)
Makefile +20 -2
@@ -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)" ; \
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/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, ...).
Quoted 75 lines · Thomas Perale via 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.orgThe previous solution relied on
make allyesconfigbut 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_ALLvariable with all the packages present on Buildroot independently of the archicture or any config entries.It forces the
BR2_HAVE_DOT_CONFIGvariable to be set to force the reading of the packages mk files.Signed-off-by Thomas Perale <[email protected]>---
v1 --> v2: removed
TARGETS_ROOTFSand recursive dependencies. It
introduced "host-" package with no name that introduced an empty entry when generating an sbom whenmake show-info-allis 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 overPACKAGES_ALL.Makefile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)Makefile +0
-0@@ -126,7 +126,7 @@ noconfig_targets := menuconfig nconfig gconfigxconfig config oldconfig randconf
defconfig %_defconfig allyesconfig allnoconfig alldefconfig
syncconfig release \Makefile +3
-2randpackageconfig 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. Thisvariable
Makefile +2
-0+# contains a reference to every packages present in Buildroot. +# Since the 'show-info-all' command might be used without actuallyhaving a
Makefile +4
-0+# 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
Makefile show-info: · line 952
Quoted 5 lines
Makefile +2
-0@@ -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.
Quoted 13 lines
Makefile +9
-1+ @: + $(info $(call clean-json, \ + { $(foreach p, \ + $(sort $(PACKAGES_ALL)), \ + $(call json-info,$(call UPPERCASE,$(p)))$(comma) \ + ) } \ + ) \ + ) + .PHONY: pkg-stats pkg-stats: @cd "$(CONFIG_DIR)" ; \ --
Quoted 1 line
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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot