diff options
| author | Claudius Heine <ch@denx.de> | 2022-05-03 10:22:33 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-05-03 17:49:50 +0100 |
| commit | 78b41029221ca27b4511459c09bc85504555272d (patch) | |
| tree | 686a708189fd629e85451f0b80d3ec44c66f207c /meta/classes | |
| parent | 341a7043c1ae22a5a02e85ffa6e92deb14a4d952 (diff) | |
| download | poky-78b41029221ca27b4511459c09bc85504555272d.tar.gz | |
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"
Also add a testcase and fix a typo (fstat -> fstab).
(From OE-Core rev: 2ce9173169a2a86392c4a85fe9be7fbbd7353b7f)
Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 7b92df69c5..9b6824043c 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
| @@ -398,6 +398,10 @@ python overlayfs_qa_check() { | |||
| 398 | 398 | ||
| 399 | allUnitExist = True; | 399 | allUnitExist = True; |
| 400 | for mountPoint in overlayMountPoints: | 400 | for mountPoint in overlayMountPoints: |
| 401 | qaSkip = (d.getVarFlag("OVERLAYFS_QA_SKIP", mountPoint) or "").split() | ||
| 402 | if "mount-configured" in qaSkip: | ||
| 403 | continue | ||
| 404 | |||
| 401 | mountPath = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) | 405 | mountPath = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) |
| 402 | if mountPath in fstabDevices: | 406 | if mountPath in fstabDevices: |
| 403 | continue | 407 | continue |
| @@ -407,8 +411,10 @@ python overlayfs_qa_check() { | |||
| 407 | for dirpath in searchpaths): | 411 | for dirpath in searchpaths): |
| 408 | continue | 412 | continue |
| 409 | 413 | ||
| 410 | bb.warn('Mount path %s not found in fstat and unit %s not found ' | 414 | bb.warn(f'Mount path {mountPath} not found in fstab and unit ' |
| 411 | 'in systemd unit directories' % (mountPath, mountUnit)) | 415 | f'{mountUnit} not found in systemd unit directories.') |
| 416 | bb.warn(f'Skip this check by setting OVERLAYFS_QA_SKIP[{mountPoint}] = ' | ||
| 417 | '"mount-configured"') | ||
| 412 | allUnitExist = False; | 418 | allUnitExist = False; |
| 413 | 419 | ||
| 414 | if not allUnitExist: | 420 | if not allUnitExist: |
