Express + expert help

View pricing →
Skip to main content
tutorialCRA5 min read

Generate and Check an SPDX SBOM with Yocto

Prepare a pinned Yocto 5.0.13 workflow that emits SPDX 2.2, capture build provenance and review package coverage before using the SBOM as evidence.

By CenitiaUpdated

Fact-checked against the law as of Reviewed by Vladimír Vician on How we check

Yocto can generate SPDX documents from the build, but useful evidence requires a pinned configuration and a coverage review. Enabling the class is the beginning of the workflow; it does not prove that every software element in your finished device is inventoried.

This workflow targets Yocto 5.0.13 (scarthgap) and a QEMU demo image. At that release the create-spdx class produces SPDX 2.2. We have not executed this build for the article: the commands follow the 5.0.13 documentation and the class source at the release tag. Use the run record to capture your checkout, configuration, actual outputs and coverage checks.

Why the release pin matters

SBOM behaviour differs between Yocto releases, and even between the guides for point releases of the same series. We checked the documentation and the class source for three releases:

ReleaseWhat create-spdx producesWhat the SBOM guide says about enabling it
5.0.13SPDX 2.2 (create-spdx inherits create-spdx-2.2); image output IMAGE-MACHINE.spdx.tar.zstAdd INHERIT += "create-spdx"
5.0.21SPDX 2.2 by the same class; a create-spdx-3.0 class is also presentInherited by default through INHERIT_DISTRO; SPDX 3 is available but disabled by default
6.0SPDX 3.0 (create-spdx inherits create-spdx-3.0); image output IMAGE-MACHINE.spdx.jsonInherited by default through INHERIT_DISTRO

Two consequences for this tutorial:

  • It stays on 5.0.13, because the 5.0.21 guide already describes different defaults and assumes SPDX 3. As of 21 November 2026 the documentation site lists point releases up to 5.0.21, so 5.0.13 is not the latest security level of the series. For a product build, repeat the workflow on the point release you ship and read the guide for that release.
  • At the 5.0.13 tag, the default distro settings (meta/conf/distro/defaultsetup.conf) already list create-spdx in INHERIT_DISTRO, although the 5.0.13 SBOM guide tells you to add it. The configuration below follows the guide and makes the setting explicit. Record the effective configuration of your own build instead of relying on either statement.

SPDX 2.2 is an older format line than some recipients accept. Germany's BSI TR-03183-2 (version 2.1.0), a technical guideline and not EU law, asks for SPDX 3.0.1 or higher or CycloneDX 1.6 or higher. If a recipient requires that guideline, the output of this workflow does not meet its format clause as it stands; plan for a release whose class emits SPDX 3.0, or for a validated conversion.

Use the supported Linux host and dependencies described in the matching Yocto system requirements, and plan sufficient disk space and build time.

Pin the source and initialise a clean build

The commands assume a fresh working directory on a configured Linux host. Record the resolved commit, the host distribution, the dependency versions and the available storage.

git clone --branch yocto-5.0.13 --single-branch https://git.yoctoproject.org/poky
cd poky
git rev-parse HEAD
source oe-init-build-env build-sbom-demo

git rev-parse HEAD should print f16cffd030d21d12dd57bb95cfc310bda41f8a1f, the commit that the yocto-5.0.13 tag points to (checked on 21 November 2026). The tag itself is an annotated tag object with a different hash, 529843b1c189ab7b133b7fdf197d4b2a4b71a6db; do not compare the two.

Do not run the remaining steps inside a production build directory without reviewing the configuration. A separate demo build makes its assumptions easier to inspect and avoids silently changing a product's release settings.

Enable SPDX for the selected demo

Edit conf/local.conf and keep a copy of the final effective configuration. Use the following configuration for the demo:

MACHINE = "qemux86-64"
INHERIT += "create-spdx"
SPDX_PRETTY = "1"
bitbake core-image-minimal
find tmp/deploy/images/qemux86-64 -name '*.spdx*' -type f
find tmp/deploy/spdx -name '*.json' -type f

SPDX_PRETTY makes the JSON files easier to read. According to the 5.0.13 guide and the class source, the image-level result is the compressed archive IMAGE-MACHINE.spdx.tar.zst in tmp/deploy/images/MACHINE/, which contains an index and the SPDX JSON documents; the individual documents are also under tmp/deploy/spdx. The 5.0.13 reference manual page for the class names an IMAGE-MACHINE.spdx.json file instead. That is one more reason to preserve the BitBake log, list what the build actually produced, and enter the real filenames in the run record instead of expected ones.

Open one of the generated documents and confirm the spdxVersion field. For this tag it should read SPDX-2.2.

Optional source and package archives (SPDX_INCLUDE_SOURCES, SPDX_ARCHIVE_SOURCES, SPDX_ARCHIVE_PACKAGED) increase detail and storage requirements. Review distribution permissions and whether the exported bundle contains proprietary source before making it available outside your organisation. A useful internal SBOM can contain information that needs a separate disclosure review.

Compare the output with the image

Begin with the image package manifest and the generated recipe and package documents. Select several known packages and trace them through identifiers and relationships. The default image does not demonstrate coverage of your own software, so include a custom application recipe when you repeat the workflow on a product build.

Coverage boundaryWhat to check
Packages installed in the root filesystemManifest entries map to the generated inventory
Static librariesLinked dependencies are considered, not only runtime package names
Bootloader and recovery softwareSeparate artefacts are included or recorded as gaps
Radio or coprocessor firmwareVendor binaries have explicit identities and limitations
Software added after the image buildPost-processing and field installation do not escape inventory

The table is our review method. The generated SPDX archive cannot, by itself, establish coverage of software that was never part of the configured build.

Keep provenance alongside the SBOM

Record layer commits, bblayers.conf, local.conf, the build command, the generator configuration, image and SBOM hashes, warnings and the manifest comparison. If the build fails, keep the failure and the corrective action in the record. A failed attempt that is documented is more useful than a transcript that only shows success.

If your project uses a different Yocto release, repeat the workflow with the documentation for that release and describe the differences. The resulting SBOM is an inventory. It is not a security assessment and not evidence of complete CRA conformity.

Validate the result on your target

Complete a clean build, keep actual output excerpts and hashes, and have an embedded engineer review the coverage. A successful QEMU run checks the demo procedure; evidence about your product requires a build and coverage review for that product. For structural and identity checks on the output, see how to validate an SBOM beyond the JSON schema.

CRA applicability and timing

Most Cyber Resilience Act obligations apply to products placed on the market from 11 December 2027; a product placed on the market earlier becomes subject to them only if it is substantially modified from that date (Article 69(2)). Article 14 reporting is already a current duty: it has applied since 11 September 2026 to every in-scope product, including products placed on the market before 11 December 2027 (Article 69(3)), and it continues after the support period ends. Check the product’s scope, your role and the transitional provisions. See the Commission page for manufacturers, the Commission page on reporting and the Commission guidance on the application of the Cyber Resilience Act (C/2026/6013).

Continue reading

Related guides

Put this into practice

Free tools & references

New to the terminology? Browse the compliance glossary — plain-English, citation-backed definitions of every term above.