summaryrefslogtreecommitdiffstats
path: root/meta/classes/create-spdx.bbclass
diff options
context:
space:
mode:
authorAndres Beltran <abeltran@linux.microsoft.com>2021-11-04 16:48:56 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-05 11:41:00 (GMT)
commitd313f5312644223e349d9754266297b5dcd519fe (patch)
tree8cc4dd526b4bb785f6f8b0c33de5e47a643049ed /meta/classes/create-spdx.bbclass
parent993b6ec2c206a5f24ab5e41611c5a168ce505915 (diff)
downloadpoky-d313f5312644223e349d9754266297b5dcd519fe.tar.gz
create-spdx: Set the Organization field via a variable
Currently, the "Organization" field for SBOMs is hard-coded in create-spdx. Create a new variable SPDX_ORG to make this field more generic. (From OE-Core rev: f239814f3f5d9bd54de54b0f2a5081067336e32b) Signed-off-by: Andres Beltran <abeltran@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/create-spdx.bbclass')
-rw-r--r--meta/classes/create-spdx.bbclass10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass
index c35dbe1..eb1d446 100644
--- a/meta/classes/create-spdx.bbclass
+++ b/meta/classes/create-spdx.bbclass
@@ -28,6 +28,8 @@ SPDX_NAMESPACE_PREFIX ??= "http://spdx.org/spdxdoc"
28 28
29SPDX_LICENSES ??= "${COREBASE}/meta/files/spdx-licenses.json" 29SPDX_LICENSES ??= "${COREBASE}/meta/files/spdx-licenses.json"
30 30
31SPDX_ORG ??= "OpenEmbedded ()"
32
31do_image_complete[depends] = "virtual/kernel:do_create_spdx" 33do_image_complete[depends] = "virtual/kernel:do_create_spdx"
32 34
33def get_doc_namespace(d, doc): 35def get_doc_namespace(d, doc):
@@ -415,7 +417,7 @@ python do_create_spdx() {
415 doc.creationInfo.comment = "This document was created by analyzing recipe files during the build." 417 doc.creationInfo.comment = "This document was created by analyzing recipe files during the build."
416 doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"] 418 doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"]
417 doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass") 419 doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass")
418 doc.creationInfo.creators.append("Organization: OpenEmbedded ()") 420 doc.creationInfo.creators.append("Organization: %s" % d.getVar("SPDX_ORG"))
419 doc.creationInfo.creators.append("Person: N/A ()") 421 doc.creationInfo.creators.append("Person: N/A ()")
420 422
421 recipe = oe.spdx.SPDXPackage() 423 recipe = oe.spdx.SPDXPackage()
@@ -519,7 +521,7 @@ python do_create_spdx() {
519 package_doc.creationInfo.comment = "This document was created by analyzing packages created during the build." 521 package_doc.creationInfo.comment = "This document was created by analyzing packages created during the build."
520 package_doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"] 522 package_doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"]
521 package_doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass") 523 package_doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass")
522 package_doc.creationInfo.creators.append("Organization: OpenEmbedded ()") 524 package_doc.creationInfo.creators.append("Organization: %s" % d.getVar("SPDX_ORG"))
523 package_doc.creationInfo.creators.append("Person: N/A ()") 525 package_doc.creationInfo.creators.append("Person: N/A ()")
524 package_doc.externalDocumentRefs.append(recipe_ref) 526 package_doc.externalDocumentRefs.append(recipe_ref)
525 527
@@ -653,7 +655,7 @@ python do_create_runtime_spdx() {
653 runtime_doc.creationInfo.comment = "This document was created by analyzing package runtime dependencies." 655 runtime_doc.creationInfo.comment = "This document was created by analyzing package runtime dependencies."
654 runtime_doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"] 656 runtime_doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"]
655 runtime_doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass") 657 runtime_doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass")
656 runtime_doc.creationInfo.creators.append("Organization: OpenEmbedded ()") 658 runtime_doc.creationInfo.creators.append("Organization: %s" % d.getVar("SPDX_ORG"))
657 runtime_doc.creationInfo.creators.append("Person: N/A ()") 659 runtime_doc.creationInfo.creators.append("Person: N/A ()")
658 660
659 package_ref = oe.spdx.SPDXExternalDocumentRef() 661 package_ref = oe.spdx.SPDXExternalDocumentRef()
@@ -813,7 +815,7 @@ python image_combine_spdx() {
813 doc.creationInfo.comment = "This document was created by analyzing the source of the Yocto recipe during the build." 815 doc.creationInfo.comment = "This document was created by analyzing the source of the Yocto recipe during the build."
814 doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"] 816 doc.creationInfo.licenseListVersion = d.getVar("SPDX_LICENSE_DATA")["licenseListVersion"]
815 doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass") 817 doc.creationInfo.creators.append("Tool: OpenEmbedded Core create-spdx.bbclass")
816 doc.creationInfo.creators.append("Organization: OpenEmbedded ()") 818 doc.creationInfo.creators.append("Organization: %s" % d.getVar("SPDX_ORG"))
817 doc.creationInfo.creators.append("Person: N/A ()") 819 doc.creationInfo.creators.append("Person: N/A ()")
818 820
819 image = oe.spdx.SPDXPackage() 821 image = oe.spdx.SPDXPackage()