diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2025-11-18 13:09:48 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-11-26 07:50:35 -0800 |
| commit | e77289e9a4c9960fad9cf15ff9ac8787a6c350aa (patch) | |
| tree | f8b9b71ca1f6c969f11ad4b16a30e9a6aea3af01 /meta/lib | |
| parent | c06e4e6e609892f3c121893a0e02e9765bafcaff (diff) | |
| download | poky-e77289e9a4c9960fad9cf15ff9ac8787a6c350aa.tar.gz | |
spdx30: Provide software_packageUrl field in SPDX 3.0 SBOM
Define var-SPDX_PACKAGE_URL to provide software_packageUrl field [1][2]
in SPDX 3.0 SBOM, support to override with package name
SPDX_PACKAGE_URL:<pkgname>
Currently, the format of purl is not defined in Yocto, set empty for now
until we have a comprehensive plan for what Yocto purls look like.
But users could customize their own purl by setting var-SPDX_PACKAGE_URL
[1] https://spdx.github.io/spdx-spec/v3.0.1/model/Software/Properties/packageUrl/
[2] https://spdx.github.io/spdx-spec/v3.0.1/annexes/pkg-url-specification/
(From OE-Core rev: c8e6953a0b6f59ffca994c440069db39e60b12d2)
(From OE-Core rev: 60724efdb3a243bc796b390ad0c478584a0fb7fa)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oe/spdx30_tasks.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index 8115088ab8..a2d316301f 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py | |||
| @@ -632,6 +632,14 @@ def create_spdx(d): | |||
| 632 | set_var_field("SUMMARY", spdx_package, "summary", package=package) | 632 | set_var_field("SUMMARY", spdx_package, "summary", package=package) |
| 633 | set_var_field("DESCRIPTION", spdx_package, "description", package=package) | 633 | set_var_field("DESCRIPTION", spdx_package, "description", package=package) |
| 634 | 634 | ||
| 635 | if d.getVar("SPDX_PACKAGE_URL:%s" % package) or d.getVar("SPDX_PACKAGE_URL"): | ||
| 636 | set_var_field( | ||
| 637 | "SPDX_PACKAGE_URL", | ||
| 638 | spdx_package, | ||
| 639 | "software_packageUrl", | ||
| 640 | package=package | ||
| 641 | ) | ||
| 642 | |||
| 635 | pkg_objset.new_scoped_relationship( | 643 | pkg_objset.new_scoped_relationship( |
| 636 | [oe.sbom30.get_element_link_id(build)], | 644 | [oe.sbom30.get_element_link_id(build)], |
| 637 | oe.spdx30.RelationshipType.hasOutput, | 645 | oe.spdx30.RelationshipType.hasOutput, |
