summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--documentation/overview-manual/yp-intro.rst10
-rw-r--r--documentation/ref-manual/yocto-project-supported-features.rst10
-rw-r--r--meta/classes-recipe/crosssdk.bbclass1
-rw-r--r--meta/classes/create-spdx-2.2.bbclass9
-rw-r--r--meta/classes/spdx-common.bbclass3
-rw-r--r--meta/conf/bitbake.conf2
-rw-r--r--meta/lib/oe/spdx30_tasks.py10
-rw-r--r--meta/lib/oe/spdx_common.py41
8 files changed, 76 insertions, 10 deletions
diff --git a/documentation/overview-manual/yp-intro.rst b/documentation/overview-manual/yp-intro.rst
index 11e6d99e32..15dfb3a6b6 100644
--- a/documentation/overview-manual/yp-intro.rst
+++ b/documentation/overview-manual/yp-intro.rst
@@ -47,10 +47,12 @@ Here are features and advantages of the Yocto Project:
47 see the "COMMUNITY" and "ECOSYSTEM" tabs on the 47 see the "COMMUNITY" and "ECOSYSTEM" tabs on the
48 :yocto_home:`Yocto Project <>` home page. 48 :yocto_home:`Yocto Project <>` home page.
49 49
50- *Architecture Agnostic:* Yocto Project supports Intel, ARM, MIPS, 50- *Architecture Agnostic:* Yocto Project supports Intel, ARM, MIPS, AMD, PPC,
51 AMD, PPC and other architectures. Most ODMs, OSVs, and chip vendors 51 RISC-V and other architectures. Most ODMs, OSVs, and chip vendors create and
52 create and supply BSPs that support their hardware. If you have 52 supply BSPs that support their hardware. If you have custom silicon, you can
53 custom silicon, you can create a BSP that supports that architecture. 53 create a BSP that supports that architecture. See
54 :doc:`ref-manual/yocto-project-supported-features` for details on the level
55 of support for some of these architectures.
54 56
55 Aside from broad architecture support, the Yocto Project fully 57 Aside from broad architecture support, the Yocto Project fully
56 supports a wide range of devices emulated by the Quick EMUlator 58 supports a wide range of devices emulated by the Quick EMUlator
diff --git a/documentation/ref-manual/yocto-project-supported-features.rst b/documentation/ref-manual/yocto-project-supported-features.rst
index bc1a813938..345280d67d 100644
--- a/documentation/ref-manual/yocto-project-supported-features.rst
+++ b/documentation/ref-manual/yocto-project-supported-features.rst
@@ -78,7 +78,7 @@ Below is a list of primary tested features, their maintainer(s) and builder(s):
78 - meta-agl-core 78 - meta-agl-core
79 * - `meta-arm <https://git.yoctoproject.org/meta-arm>`__ 79 * - `meta-arm <https://git.yoctoproject.org/meta-arm>`__
80 - meta-arm layer testing 80 - meta-arm layer testing
81 - TBD 81 - meta-arm mailing list <meta-arm@lists.yoctoproject.org>
82 - meta-arm 82 - meta-arm
83 * - `meta-aws <https://github.com/aws4embeddedlinux/meta-aws>`__ 83 * - `meta-aws <https://github.com/aws4embeddedlinux/meta-aws>`__
84 - meta-aws layer testing 84 - meta-aws layer testing
@@ -88,6 +88,10 @@ Below is a list of primary tested features, their maintainer(s) and builder(s):
88 - meta-intel layer testing 88 - meta-intel layer testing
89 - TBD 89 - TBD
90 - meta-intel 90 - meta-intel
91 * - `meta-exein <https://github.com/exein-io/meta-exein>`__
92 - meta-exein layer testing
93 - TBD
94 - meta-exein
91 * - `meta-virtualization <https://git.yoctoproject.org/meta-virtualization/>`__ 95 * - `meta-virtualization <https://git.yoctoproject.org/meta-virtualization/>`__
92 - meta-virtualization layer testing 96 - meta-virtualization layer testing
93 - TBD 97 - TBD
@@ -244,10 +248,6 @@ it is on a best effort only basis.
244 - Description 248 - Description
245 - Maintainer(s) 249 - Maintainer(s)
246 - Builder(s) 250 - Builder(s)
247 * - `meta-exein <https://github.com/exein-io/meta-exein>`__
248 - meta-exein layer testing
249 - TBD
250 - meta-exein
251 * - :wikipedia:`MIPS <MIPS_architecture>` 251 * - :wikipedia:`MIPS <MIPS_architecture>`
252 - MIPS architecture testing 252 - MIPS architecture testing
253 - No maintainers 253 - No maintainers
diff --git a/meta/classes-recipe/crosssdk.bbclass b/meta/classes-recipe/crosssdk.bbclass
index 824b1bcff4..3541c2c393 100644
--- a/meta/classes-recipe/crosssdk.bbclass
+++ b/meta/classes-recipe/crosssdk.bbclass
@@ -4,6 +4,7 @@
4# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
5# 5#
6 6
7BB_DEFER_BBCLASSES:remove = "cross"
7inherit cross 8inherit cross
8 9
9CLASSOVERRIDE = "class-crosssdk" 10CLASSOVERRIDE = "class-crosssdk"
diff --git a/meta/classes/create-spdx-2.2.bbclass b/meta/classes/create-spdx-2.2.bbclass
index 7e8f8b9ff5..6fc60a1d97 100644
--- a/meta/classes/create-spdx-2.2.bbclass
+++ b/meta/classes/create-spdx-2.2.bbclass
@@ -137,6 +137,11 @@ def add_package_files(d, doc, spdx_pkg, topdir, get_spdxid, get_types, *, archiv
137 spdx_files = [] 137 spdx_files = []
138 138
139 file_counter = 1 139 file_counter = 1
140
141 check_compiled_sources = d.getVar("SPDX_INCLUDE_COMPILED_SOURCES") == "1"
142 if check_compiled_sources:
143 compiled_sources, types = oe.spdx_common.get_compiled_sources(d)
144 bb.debug(1, f"Total compiled files: {len(compiled_sources)}")
140 for subdir, dirs, files in os.walk(topdir): 145 for subdir, dirs, files in os.walk(topdir):
141 dirs[:] = [d for d in dirs if d not in ignore_dirs] 146 dirs[:] = [d for d in dirs if d not in ignore_dirs]
142 if subdir == str(topdir): 147 if subdir == str(topdir):
@@ -147,6 +152,10 @@ def add_package_files(d, doc, spdx_pkg, topdir, get_spdxid, get_types, *, archiv
147 filename = str(filepath.relative_to(topdir)) 152 filename = str(filepath.relative_to(topdir))
148 153
149 if not filepath.is_symlink() and filepath.is_file(): 154 if not filepath.is_symlink() and filepath.is_file():
155 # Check if file is compiled
156 if check_compiled_sources:
157 if not oe.spdx_common.is_compiled_source(filename, compiled_sources, types):
158 continue
150 spdx_file = oe.spdx.SPDXFile() 159 spdx_file = oe.spdx.SPDXFile()
151 spdx_file.SPDXID = get_spdxid(file_counter) 160 spdx_file.SPDXID = get_spdxid(file_counter)
152 for t in get_types(filepath): 161 for t in get_types(filepath):
diff --git a/meta/classes/spdx-common.bbclass b/meta/classes/spdx-common.bbclass
index 713a7fc651..ca0416d1c7 100644
--- a/meta/classes/spdx-common.bbclass
+++ b/meta/classes/spdx-common.bbclass
@@ -26,6 +26,7 @@ SPDX_TOOL_VERSION ??= "1.0"
26SPDXRUNTIMEDEPLOY = "${SPDXDIR}/runtime-deploy" 26SPDXRUNTIMEDEPLOY = "${SPDXDIR}/runtime-deploy"
27 27
28SPDX_INCLUDE_SOURCES ??= "0" 28SPDX_INCLUDE_SOURCES ??= "0"
29SPDX_INCLUDE_COMPILED_SOURCES ??= "0"
29 30
30SPDX_UUID_NAMESPACE ??= "sbom.openembedded.org" 31SPDX_UUID_NAMESPACE ??= "sbom.openembedded.org"
31SPDX_NAMESPACE_PREFIX ??= "http://spdx.org/spdxdocs" 32SPDX_NAMESPACE_PREFIX ??= "http://spdx.org/spdxdocs"
@@ -40,6 +41,8 @@ SPDX_MULTILIB_SSTATE_ARCHS ??= "${SSTATE_ARCHS}"
40python () { 41python () {
41 from oe.cve_check import extend_cve_status 42 from oe.cve_check import extend_cve_status
42 extend_cve_status(d) 43 extend_cve_status(d)
44 if d.getVar("SPDX_INCLUDE_COMPILED_SOURCES") == "1":
45 d.setVar("SPDX_INCLUDE_SOURCES", "1")
43} 46}
44 47
45def create_spdx_source_deps(d): 48def create_spdx_source_deps(d):
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 50aec4befc..54d6bebc39 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -947,7 +947,7 @@ BB_DEFAULT_UMASK ??= "022"
947BB_CONSOLELOG ?= "${LOG_DIR}/cooker/${MACHINE}/${DATETIME}.log" 947BB_CONSOLELOG ?= "${LOG_DIR}/cooker/${MACHINE}/${DATETIME}.log"
948BB_DEFAULT_EVENTLOG ?= "${LOG_DIR}/eventlog/${DATETIME}.json" 948BB_DEFAULT_EVENTLOG ?= "${LOG_DIR}/eventlog/${DATETIME}.json"
949 949
950BB_DEFER_BBCLASSES = "native nativesdk" 950BB_DEFER_BBCLASSES = "native nativesdk cross crosssdk"
951 951
952# Setup our default hash policy 952# Setup our default hash policy
953BB_SIGNATURE_HANDLER ?= "OEBasicHash" 953BB_SIGNATURE_HANDLER ?= "OEBasicHash"
diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py
index 61d7ba45e3..beeafc2bb7 100644
--- a/meta/lib/oe/spdx30_tasks.py
+++ b/meta/lib/oe/spdx30_tasks.py
@@ -156,6 +156,11 @@ def add_package_files(
156 bb.note(f"Skip {topdir}") 156 bb.note(f"Skip {topdir}")
157 return spdx_files 157 return spdx_files
158 158
159 check_compiled_sources = d.getVar("SPDX_INCLUDE_COMPILED_SOURCES") == "1"
160 if check_compiled_sources:
161 compiled_sources, types = oe.spdx_common.get_compiled_sources(d)
162 bb.debug(1, f"Total compiled files: {len(compiled_sources)}")
163
159 for subdir, dirs, files in os.walk(topdir, onerror=walk_error): 164 for subdir, dirs, files in os.walk(topdir, onerror=walk_error):
160 dirs[:] = [d for d in dirs if d not in ignore_dirs] 165 dirs[:] = [d for d in dirs if d not in ignore_dirs]
161 if subdir == str(topdir): 166 if subdir == str(topdir):
@@ -171,6 +176,11 @@ def add_package_files(
171 filename = str(filepath.relative_to(topdir)) 176 filename = str(filepath.relative_to(topdir))
172 file_purposes = get_purposes(filepath) 177 file_purposes = get_purposes(filepath)
173 178
179 # Check if file is compiled
180 if check_compiled_sources:
181 if not oe.spdx_common.is_compiled_source(filename, compiled_sources, types):
182 continue
183
174 spdx_file = objset.new_file( 184 spdx_file = objset.new_file(
175 get_spdxid(file_counter), 185 get_spdxid(file_counter),
176 filename, 186 filename,
diff --git a/meta/lib/oe/spdx_common.py b/meta/lib/oe/spdx_common.py
index 4caefc7673..c2dec65563 100644
--- a/meta/lib/oe/spdx_common.py
+++ b/meta/lib/oe/spdx_common.py
@@ -242,3 +242,44 @@ def fetch_data_to_uri(fd, name):
242 uri = uri + "@" + fd.revision 242 uri = uri + "@" + fd.revision
243 243
244 return uri 244 return uri
245
246def is_compiled_source (filename, compiled_sources, types):
247 """
248 Check if the file is a compiled file
249 """
250 import os
251 # If we don't have compiled source, we assume all are compiled.
252 if not compiled_sources:
253 return True
254
255 # We return always true if the file type is not in the list of compiled files.
256 # Some files in the source directory are not compiled, for example, Makefiles,
257 # but also python .py file. We need to include them in the SPDX.
258 basename = os.path.basename(filename)
259 ext = basename.partition(".")[2]
260 if ext not in types:
261 return True
262 # Check that the file is in the list
263 return filename in compiled_sources
264
265def get_compiled_sources(d):
266 """
267 Get list of compiled sources from debug information and normalize the paths
268 """
269 import itertools
270 source_info = oe.package.read_debugsources_info(d)
271 if not source_info:
272 bb.debug(1, "Do not have debugsources.list. Skipping")
273 return [], []
274
275 # Sources are not split now in SPDX, so we aggregate them
276 sources = set(itertools.chain.from_iterable(source_info.values()))
277 # Check extensions of files
278 types = set()
279 for src in sources:
280 basename = os.path.basename(src)
281 ext = basename.partition(".")[2]
282 if ext not in types and ext:
283 types.add(ext)
284 bb.debug(1, f"Num of sources: {len(sources)} and types: {len(types)} {str(types)}")
285 return sources, types