diff options
| -rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index fbfa63fcb3..c5746eba13 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
| @@ -39,6 +39,8 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd" | |||
| 39 | 39 | ||
| 40 | ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;' | 40 | ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;' |
| 41 | 41 | ||
| 42 | ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check;", "", d)}' | ||
| 43 | |||
| 42 | inherit image-artifact-names | 44 | inherit image-artifact-names |
| 43 | 45 | ||
| 44 | # Sort the user and group entries in /etc by ID in order to make the content | 46 | # Sort the user and group entries in /etc by ID in order to make the content |
| @@ -373,3 +375,26 @@ rootfs_reproducible () { | |||
| 373 | fi | 375 | fi |
| 374 | fi | 376 | fi |
| 375 | } | 377 | } |
| 378 | |||
| 379 | python overlayfs_qa_check() { | ||
| 380 | from oe.overlayfs import mountUnitName | ||
| 381 | |||
| 382 | # this is a dumb check for unit existence, not its validity | ||
| 383 | overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT") | ||
| 384 | imagepath = d.getVar("IMAGE_ROOTFS") | ||
| 385 | searchpaths = [oe.path.join(imagepath, d.getVar("sysconfdir"), "systemd", "system"), | ||
| 386 | oe.path.join(imagepath, d.getVar("systemd_system_unitdir"))] | ||
| 387 | |||
| 388 | allUnitExist = True; | ||
| 389 | for mountPoint in overlayMountPoints: | ||
| 390 | path = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) | ||
| 391 | unit = mountUnitName(path) | ||
| 392 | |||
| 393 | if not any(os.path.isfile(oe.path.join(dirpath, unit)) | ||
| 394 | for dirpath in searchpaths): | ||
| 395 | bb.warn('Unit name %s not found in systemd unit directories' % unit) | ||
| 396 | allUnitExist = False; | ||
| 397 | |||
| 398 | if not allUnitExist: | ||
| 399 | bb.fatal('Not all mount units are installed by the BSP') | ||
| 400 | } | ||
