summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorKamel Bouhara (Schneider Electric) <kamel.bouhara@bootlin.com>2025-12-15 16:54:22 +0100
committerSteve Sakoman <steve@sakoman.com>2025-12-31 07:49:31 -0800
commit6d222750d5c3254c200259a1ff6ac7c691a7cd7d (patch)
tree5c739108ecd54718d3ce549d9488cdd3904bd90e /meta/classes
parentf327b4da741f9c4e47f621ec125dabdccfcb1d6f (diff)
downloadpoky-6d222750d5c3254c200259a1ff6ac7c691a7cd7d.tar.gz
kernel.bbclass: Add task to export kernel configuration to SPDX
Introduce a new bitbake task do_create_kernel_config_spdx that extracts the kernel configuration from ${B}/.config and exports it into the recipe's SPDX document as a separate build_Build object. The kernel config parameters are stored as SPDX DictionaryEntry objects and linked to the main kernel build using an ancestorOf relationship. This enables the kernel build's configuration to be explicitly captured in the SPDX document for compliance, auditing, and reproducibility. The task is gated by SPDX_INCLUDE_KERNEL_CONFIG (default = "0"). Reviewed-by: Joshua Watt <JPEWhacker@gmail.com> (From OE-Core rev: 1fff29a0428778929ffa530482ebf7db95f1e0ae) Signed-off-by: Kamel Bouhara (Schneider Electric) <kamel.bouhara@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 228a968e7c47d811c06143279bdb0f9c5f374bef) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/create-spdx-3.0.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/create-spdx-3.0.bbclass b/meta/classes/create-spdx-3.0.bbclass
index c0a5436ad6..15c31ba9a3 100644
--- a/meta/classes/create-spdx-3.0.bbclass
+++ b/meta/classes/create-spdx-3.0.bbclass
@@ -50,6 +50,12 @@ SPDX_INCLUDE_TIMESTAMPS[doc] = "Include time stamps in SPDX output. This is \
50 useful if you want to know when artifacts were produced and when builds \ 50 useful if you want to know when artifacts were produced and when builds \
51 occurred, but will result in non-reproducible SPDX output" 51 occurred, but will result in non-reproducible SPDX output"
52 52
53SPDX_INCLUDE_KERNEL_CONFIG ??= "0"
54SPDX_INCLUDE_KERNEL_CONFIG[doc] = "If set to '1', the .config file for the kernel will be parsed \
55and each CONFIG_* value will be included in the Build.build_parameter list as DictionaryEntry \
56items. Set to '0' to disable exporting kernel configuration to improve performance or reduce \
57SPDX document size."
58
53SPDX_IMPORTS ??= "" 59SPDX_IMPORTS ??= ""
54SPDX_IMPORTS[doc] = "SPDX_IMPORTS is the base variable that describes how to \ 60SPDX_IMPORTS[doc] = "SPDX_IMPORTS is the base variable that describes how to \
55 reference external SPDX ids. Each import is defined as a key in this \ 61 reference external SPDX ids. Each import is defined as a key in this \