[PATCHv4,3/3] bitbake.conf: add MACHINE_FEATURES, DISTRO_FEATURES, COMBINED_FEATURES

Message ID 20250213214200.296-3-chris.larson@siemens.com
State Accepted, archived
Headers show
Series [PATCHv4,1/3] lists.bbclass: add class | expand

Commit Message

chris.larson Feb. 13, 2025, 9:41 p.m. UTC
From: Christopher Larson <chris.larson@siemens.com>

These variables are useful to allow toggling of functionality in their
respective configuration files to alter how images are constructed.
Common usage would be for an image recipe to alter ROOTFS_FEATURES basd
on configured machine, distro, or combined features.

Signed-off-by: Christopher Larson <chris.larson@siemens.com>
---
 meta/conf/bitbake.conf | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index d444b802..5ab8ced7 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -175,13 +175,22 @@  BBINCLUDELOGS ??= "yes"
 # Add event handlers for bitbake
 INHERIT += "isar-events sstate"
 
+# Make features variables available
 INHERIT += "lists"
 
-LIST_VARIABLES += "BASE_REPO_FEATURES ROOTFS_FEATURES"
+LIST_VARIABLES += "BASE_REPO_FEATURES MACHINE_FEATURES DISTRO_FEATURES ROOTFS_FEATURES"
 
 BASE_REPO_FEATURES ??= ""
 BASE_REPO_FEATURES[doc] = "Specifies the list of features for the base-apt repository."
 
+MACHINE_FEATURES ??= ""
+MACHINE_FEATURES[doc] = "Specifies the list of hardware features the MACHINE is capable of supporting."
+
+DISTRO_FEATURES ??= ""
+DISTRO_FEATURES[doc] = "The software support you want in your distribution for various features."
+
+COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}"
+
 ROOTFS_FEATURES ??= ""
 ROOTFS_FEATURES[doc] = "The list of features to be included in a root filesystem. Typically, you configure this variable in an image recipe or class."