Yocto layer for comparing SPDX 3.0 SBOMs between builds.
- Provides
spdx-diffas a native build tool - Adds
do_spdx_difftask to automatically compare SBOMs - Generates timestamped diff reports with symlink to latest
- Yocto/OpenEmbedded with SPDX 3.0 support (Scarthgap 5.1+)
- For Scarthgap: OE-Core commit
a172a0e8d5or later
- Add layer to
bblayers.conf:
git clone https://github.com/bootlin/meta-spdx-diff layers/meta-spdx-diff- In your image recipe:
inherit spdx-diff- Enable SPDX 3.0 metadata (recommended):
SPDX_INCLUDE_KERNEL_CONFIG = "1"
SPDX_INCLUDE_PACKAGECONFIG = "1"- Build:
bitbake core-image-minimalResults are deployed to tmp/deploy/images/${MACHINE}/:
core-image-minimal-qemux86-64-20250123-120000.spdx-diff.json # Timestamped
core-image-minimal-qemux86-64.spdx-diff.json # Symlink to latest
Example output:
Packages - Added:
+ example: 0.1
+ i2c-tools: 4.3
Packages - Changed:
~ openssl: 3.0.13 -> 3.0.14
Kernel Config - Added:
+ CONFIG_SECURITY_SELINUX: y
Default reference: file://reference-sbom.spdx.json
Override in your recipe:
# Local file
SPDX_REF_FILE = "file://my-baseline.spdx.json"
# Or remote
SPDX_REF_FILE = "https://example.com/baseline.spdx.json"
SRC_URI[sha256sum] = "..."# Extra spdx-diff arguments
SPDX_DIFF_EXTRA_ARGS = "--show-packages --summary"
# Verbose output
SPDX_DIFF_EXTRA_ARGS = "-v"See meta-spdx-diff-test for working examples with KAS.