Skip to contentSkip to conversation

classes: rootfs-postcommands: add skip option to overlayfs_qa_check

PATCH Superseded Claudius Heine 1 participant 1 message Apr 29, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 classes: rootfs-postcommands: add skip option to overlayfs_qa_check

The overlayfs_qa_check checks if the current root file system has a mount configured for each overlayfs, when the overlayfs class is used.

However there are certain instances where this mount point is created at runtime and not static in a fstab entry or systemd mount unit.

One such case would be if overlayfs-etc is used, where the device is mounted in the preinit script and not via a mount unit or fstab entry.

However there are other possibilities for this as well, like startup scripts that support a dynamic partition layout. For instance when systemd-repart is used.

This adds the OVERLAYFS_QA_SKIP variable, which allows to define QA skips via its flags. In principle it supports multiple QA skip flags separated by whitespace, but only one (mount-configured) is implemented here. To skip this QA check simply add mount-configured to the flag of OVERLAYFS_QA_SKIP with the same name. For instance if a overlayfs is configured as:

OVERLAYFS_MOUNT_POINT[data] = "/data"

Skipping this QA check can be done by setting:

OVERLAYFS_QA_SKIP[data] = "mount-configured"

---
 meta/classes/rootfs-postcommands.bbclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta/classes/rootfs-postcommands.bbclass +8 -2
index 7b92df69c5..8df175e42e 100644
@@ -398,6 +398,10 @@ python overlayfs_qa_check() {
 
     allUnitExist = True;
     for mountPoint in overlayMountPoints:
+        qaSkip = (d.getVarFag("OVERLAYFS_QA_SKIP", mountPoint) or "").split()
+        if "mount-configured" in qaSkip:
+            continue
+
         mountPath = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint)
         if mountPath in fstabDevices:
             continue
@@ -407,8 +411,10 @@ python overlayfs_qa_check() {
                for dirpath in searchpaths):
             continue
 
-        bb.warn('Mount path %s not found in fstat and unit %s not found '
-                'in systemd unit directories' % (mountPath, mountUnit))
+        bb.warn(f'Mount path {mountPath} not found in fstab and unit '
+                f'{mountUnit} not found in systemd unit directories.')
+        bb.warn(f'Skip this check by setting OVERLAYFS_QA_SKIP[{mountPoint}] = '
+                '"mount-configured"')
         allUnitExist = False;
 
     if not allUnitExist:
Signature · 1 line
2.33.3