[v7,2/7] feat: add license information to SBOM as well

Message ID 20260121150719.2719579-3-felix.moessbauer@siemens.com
State Under Review
Headers show
Series Add SBOM generation with debsbom | expand

Commit Message

MOESSBAUER, Felix Jan. 21, 2026, 3:07 p.m. UTC
We now have support in debsbom to also extract the license
information from the packages. We now add a parameter
SBOM_DEBSBOM_EXTRA_ARGS to add extra arguments to the sbom and set the
default to --with-licenses. By that license information is added. If
this is not wanted, the user can overwrite the bitbake variable.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/sbom.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/sbom.bbclass b/meta/classes/sbom.bbclass
index 3ed755d9..a16f6ea0 100644
--- a/meta/classes/sbom.bbclass
+++ b/meta/classes/sbom.bbclass
@@ -15,6 +15,7 @@  SBOM_DISTRO_VERSION ?= "1"
 SBOM_DISTRO_SUMMARY ?= "Linux distribution built with ISAR"
 SBOM_BASE_DISTRO_VENDOR ??= "debian"
 SBOM_DOCUMENT_UUID ?= ""
+SBOM_DEBSBOM_EXTRA_ARGS ?= "--with-licenses"
 
 # SPDX specific user variables
 SBOM_SPDX_NAMESPACE_PREFIX ?= "https://spdx.org/spdxdocs"
@@ -55,7 +56,7 @@  generate_sbom() {
             --base-distro-vendor '${SBOM_BASE_DISTRO_VENDOR}' \
             --cdx-serialnumber '${SBOM_DOCUMENT_UUID}' \
             --spdx-namespace '${SBOM_SPDX_NAMESPACE_PREFIX}'-'${SBOM_DOCUMENT_UUID}' \
-            --timestamp $TIMESTAMP
+            --timestamp $TIMESTAMP ${SBOM_DEBSBOM_EXTRA_ARGS}
 }
 
 do_generate_sbom[dirs] += "${DEPLOY_DIR_SBOM}"