summaryrefslogtreecommitdiff
path: root/meta-phosphor/classes/obmc-phosphor-utils.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor/classes/obmc-phosphor-utils.bbclass')
-rw-r--r--meta-phosphor/classes/obmc-phosphor-utils.bbclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta-phosphor/classes/obmc-phosphor-utils.bbclass b/meta-phosphor/classes/obmc-phosphor-utils.bbclass
new file mode 100644
index 0000000000..4f556294bc
--- /dev/null
+++ b/meta-phosphor/classes/obmc-phosphor-utils.bbclass
@@ -0,0 +1,14 @@
+# Helper functions for checking feature variables.
+
+inherit utils
+
+def df_enabled(feature, value, d):
+ return base_contains("DISTRO_FEATURES", feature, value, "", d)
+
+def mf_enabled(feature, value, d):
+ return base_contains("MACHINE_FEATURES", feature, value, "", d)
+
+def cf_enabled(feature, value, d):
+ return value if df_enabled(feature, value, d) \
+ and mf_enabled(feature, value, d) \
+ else ""