summaryrefslogtreecommitdiff
path: root/poky/meta/classes/rootfs-postcommands.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/classes/rootfs-postcommands.bbclass')
-rw-r--r--poky/meta/classes/rootfs-postcommands.bbclass27
1 files changed, 26 insertions, 1 deletions
diff --git a/poky/meta/classes/rootfs-postcommands.bbclass b/poky/meta/classes/rootfs-postcommands.bbclass
index e66ed5938..c5746eba1 100644
--- a/poky/meta/classes/rootfs-postcommands.bbclass
+++ b/poky/meta/classes/rootfs-postcommands.bbclass
@@ -23,7 +23,7 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only
#
# We do this with _append because the default value might get set later with ?=
# and we don't want to disable such a default that by setting a value here.
-APPEND_append = '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", " ro", "", d)}'
+APPEND:append = '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", " ro", "", d)}'
# Generates test data file with data store variables expanded in json format
ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data; "
@@ -39,6 +39,8 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd"
ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check;", "", d)}'
+
inherit image-artifact-names
# Sort the user and group entries in /etc by ID in order to make the content
@@ -373,3 +375,26 @@ rootfs_reproducible () {
fi
fi
}
+
+python overlayfs_qa_check() {
+ from oe.overlayfs import mountUnitName
+
+ # this is a dumb check for unit existence, not its validity
+ overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT")
+ imagepath = d.getVar("IMAGE_ROOTFS")
+ searchpaths = [oe.path.join(imagepath, d.getVar("sysconfdir"), "systemd", "system"),
+ oe.path.join(imagepath, d.getVar("systemd_system_unitdir"))]
+
+ allUnitExist = True;
+ for mountPoint in overlayMountPoints:
+ path = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint)
+ unit = mountUnitName(path)
+
+ if not any(os.path.isfile(oe.path.join(dirpath, unit))
+ for dirpath in searchpaths):
+ bb.warn('Unit name %s not found in systemd unit directories' % unit)
+ allUnitExist = False;
+
+ if not allUnitExist:
+ bb.fatal('Not all mount units are installed by the BSP')
+}