summaryrefslogtreecommitdiff
path: root/meta-phosphor/classes/image_types_phosphor.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor/classes/image_types_phosphor.bbclass')
-rw-r--r--meta-phosphor/classes/image_types_phosphor.bbclass16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass
new file mode 100644
index 000000000..eef1b1c67
--- /dev/null
+++ b/meta-phosphor/classes/image_types_phosphor.bbclass
@@ -0,0 +1,16 @@
+# Base image class extension, inlined into every image.
+
+def build_uboot(d):
+ fstypes = d.getVar('IMAGE_FSTYPES', True).split()
+ if any([x.endswith('u-boot') for x in fstypes]):
+ return 'image_types_uboot'
+ return ''
+
+
+# Inherit u-boot classes if legacy uboot images are in use.
+IMAGE_TYPE_uboot = '${@build_uboot(d)}'
+inherit ${IMAGE_TYPE_uboot}
+
+# Inherit the overlay class if overlay is in use.
+IMAGE_TYPE_overlay = '${@bb.utils.contains("IMAGE_FSTYPES", "overlay", "image-overlay", "", d)}'
+inherit ${IMAGE_TYPE_overlay}