Skip to contentSkip to conversation

classes/image: add new task to list defined image features

PATCH New Ross Burton 1 participant 1 message Nov 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 classes/image: add new task to list defined image features

Add a list_image_features task that lists the available IMAGE_FEATURES for a specific image.

---
 meta/classes-recipe/image.bbclass | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
meta/classes-recipe/image.bbclass +23 -0
index ccad308b939..53f1a9dc45b 100644
@@ -702,4 +702,27 @@ reproducible_final_image_task () {
 
 IMAGE_PREPROCESS_COMMAND:append = " reproducible_final_image_task "
 
+python do_list_image_features() {
+    """
+    Task to list the available values for IMAGE_FEATURES for a specific image.
+    """
+    features = set()
+
+    for var in d:
+        if var.startswith("FEATURE_PACKAGES_"):
+            features.add(var.replace("FEATURE_PACKAGES_", ""))
+
+    for flag in d.getVarFlags("COMPLEMENTARY_GLOB"):
+        if flag != "doc":
+            features.add(flag)
+
+    for feat in d.getVarFlag("IMAGE_FEATURES", "validitems").split():
+        features.add(feat)
+
+    bb.plain("Available features for IMAGE_FEATURES:")
+    for feature in sorted(features):
+        bb.plain(" - " + feature)
+}
+addtask list_image_features
+
 CVE_PRODUCT = ""
Signature · 1 line
2.43.0