summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorClaudius Heine <ch@denx.de>2022-05-03 10:22:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-03 17:49:50 +0100
commit78b41029221ca27b4511459c09bc85504555272d (patch)
tree686a708189fd629e85451f0b80d3ec44c66f207c /meta/lib
parent341a7043c1ae22a5a02e85ffa6e92deb14a4d952 (diff)
downloadpoky-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/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/overlayfs.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
index 472746a64f..ce1d2f1ec3 100644
--- a/meta/lib/oeqa/selftest/cases/overlayfs.py
+++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
@@ -62,11 +62,29 @@ DISTRO_FEATURES += "systemd overlayfs"
62 self.add_overlay_conf_to_machine() 62 self.add_overlay_conf_to_machine()
63 63
64 res = bitbake('core-image-minimal', ignore_status=True) 64 res = bitbake('core-image-minimal', ignore_status=True)
65 line = getline(res, " Mount path /mnt/overlay not found in fstat and unit mnt-overlay.mount not found in systemd unit directories") 65 line = getline(res, " Mount path /mnt/overlay not found in fstab and unit mnt-overlay.mount not found in systemd unit directories")
66 self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) 66 self.assertTrue(line and line.startswith("WARNING:"), msg=res.output)
67 line = getline(res, "Not all mount paths and units are installed in the image") 67 line = getline(res, "Not all mount paths and units are installed in the image")
68 self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) 68 self.assertTrue(line and line.startswith("ERROR:"), msg=res.output)
69 69
70 def test_not_all_units_installed_but_qa_skipped(self):
71 """
72 Summary: Test skipping the QA check
73 Expected: Image is created successfully
74 Author: Claudius Heine <ch@denx.de>
75 """
76
77 config = """
78IMAGE_INSTALL:append = " overlayfs-user"
79DISTRO_FEATURES += "systemd overlayfs"
80OVERLAYFS_QA_SKIP[mnt-overlay] = "mount-configured"
81"""
82
83 self.write_config(config)
84 self.add_overlay_conf_to_machine()
85
86 bitbake('core-image-minimal')
87
70 def test_mount_unit_not_set(self): 88 def test_mount_unit_not_set(self):
71 """ 89 """
72 Summary: Test whether mount unit was set properly 90 Summary: Test whether mount unit was set properly