Generate SBOM with Yocto on Linux
Generate your .zst file using Yocto on Linux
Inherit
create-spdxclass: Ensure that your Yocto configuration file inherits thecreate-spdxclass by adding the following line:INHERIT += "create-spdx"Build the image: Proceed with building the image using the standard Yocto build process.
Locate the SBOM files: After the build process, you'll see three different outputs. All are provided here to guide you, but you must only use the third one (in bold). These items are copied directly from Yocto documentation.
SPDX output in JSON format as in
IMAGE-MACHINE.spdx.jsonintmp/deploy/images/MACHINEin your build directory.This top-level file also has an
IMAGE-MACHINE.spdx.index.jsoncontaining an index of SPDX files for individual recipesThe compressed archive
IMAGE-MACHINE.spdx.tar.zst, which contains the index and files for the single recipes.
Convert your .zst file to a zipped format (.tar.gz or .zip)
Navigate to the directory that has the .zst file.
Run this command to unzip this file, which contains your individual SBOM files. Replace
filenamewith your actual file name (in the bullets above from Yocto's docs, this is theirIMAGE-MACHINE).
tar --zstd -xvf filename.zst
Create a directory with the name of what you want to name your zip file.
Navigate into that directory, then create the subdirectory,
packages, in this directory.Copy the individual SBOM files into this directory.
Run this command to zip the parent directory. In this example, we've used
zst_sbomas the file name.
Create .tar.gz
COPYFILE_DISABLE=1 tar -zcvf zst_sbom.tar.gz zst_sbom -x Create .zip
zip -r zst_sbom.zip zst_sbom -x '**/.*'When creating a .zip for Mac, add: -x '**/__MACOSX' after the command. This does not work for creating a .tar.gz.
Once you've converted the file to either
.tar.gzor.zip, you can upload your SBOM to Helm.
Last updated
Was this helpful?

