* [PATCH v2 1/4] overlayfs: Fix QA failure
@ 2025-12-24 14:16 uvv.mail
2025-12-24 14:16 ` [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic uvv.mail
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: uvv.mail @ 2025-12-24 14:16 UTC (permalink / raw)
To: openembedded-core; +Cc: Vyacheslav Yurkov
From: Vyacheslav Yurkov <uvv.mail@gmail.com>
The QA check for skipped mounts happens twice, at parsing stage and at
rootfs postprocessing. Fix the former, because it didn't happen properly.
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
meta/lib/oe/overlayfs.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oe/overlayfs.py b/meta/lib/oe/overlayfs.py
index 8b88900f71..dbfed317c0 100644
--- a/meta/lib/oe/overlayfs.py
+++ b/meta/lib/oe/overlayfs.py
@@ -36,7 +36,8 @@ def unitFileList(d):
# check that we have required mount points set first
requiredMountPoints = d.getVarFlags('OVERLAYFS_WRITABLE_PATHS')
for mountPoint in requiredMountPoints:
- if mountPoint not in overlayMountPoints:
+ qaSkip = (d.getVarFlag("OVERLAYFS_QA_SKIP", mountPoint) or "").split()
+ if mountPoint not in overlayMountPoints and not "mount-configured" in qaSkip:
bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint)
for mountPoint in overlayMountPoints:
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic
2025-12-24 14:16 [PATCH v2 1/4] overlayfs: Fix QA failure uvv.mail
@ 2025-12-24 14:16 ` uvv.mail
2026-01-08 13:33 ` [OE-core] " Paul Barker
2025-12-24 14:16 ` [PATCH v2 3/4] overlayfs: Remove helper unit uvv.mail
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: uvv.mail @ 2025-12-24 14:16 UTC (permalink / raw)
To: openembedded-core; +Cc: Vyacheslav Yurkov
From: Vyacheslav Yurkov <uvv.mail@gmail.com>
The test orignally was written under assumption that poky distro is
used. When poky-altcft is used for example, then systemd is already set
in DISTRO_FETURES, which the test did not expect.
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
meta/lib/oeqa/selftest/cases/overlayfs.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
index 580fbdcb9c..3e55e97927 100644
--- a/meta/lib/oeqa/selftest/cases/overlayfs.py
+++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
@@ -5,7 +5,7 @@
#
from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake, runqemu, get_bb_vars
+from oeqa.utils.commands import bitbake, runqemu, get_bb_vars, get_bb_var
from oeqa.core.decorator import OETestTag
from oeqa.core.decorator.data import skipIfNotMachine
@@ -46,7 +46,8 @@ inherit overlayfs
res = bitbake('core-image-minimal', ignore_status=True)
line = getline(res, "overlayfs-user was skipped: missing required distro features")
self.assertTrue("overlayfs" in res.output, msg=res.output)
- self.assertTrue("systemd" in res.output, msg=res.output)
+ if not "systemd" in get_bb_var('DISTRO_FEATURES'):
+ self.assertTrue("systemd" in res.output, msg=res.output)
self.assertTrue("ERROR: Required build target 'core-image-minimal' has no buildable providers." in res.output, msg=res.output)
def test_not_all_units_installed(self):
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 3/4] overlayfs: Remove helper unit
2025-12-24 14:16 [PATCH v2 1/4] overlayfs: Fix QA failure uvv.mail
2025-12-24 14:16 ` [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic uvv.mail
@ 2025-12-24 14:16 ` uvv.mail
2025-12-24 14:16 ` [PATCH v2 4/4] oe-selftest: overlayfs: Add a demo case for /etc uvv.mail
2026-01-08 13:21 ` [OE-core] [PATCH v2 1/4] overlayfs: Fix QA failure Paul Barker
3 siblings, 0 replies; 12+ messages in thread
From: uvv.mail @ 2025-12-24 14:16 UTC (permalink / raw)
To: openembedded-core; +Cc: Vyacheslav Yurkov
From: Vyacheslav Yurkov <uvv.mail@gmail.com>
Since systemd v256 workdir and upperdir are automatically created if
they don't exist, so we don't need an additional helper unit anymore.
Ref: https://github.com/systemd/systemd/commit/6c75eff6afd90596d09a33a9275be292db4e3380
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
meta/classes-recipe/overlayfs.bbclass | 10 ----------
meta/classes-recipe/rootfs-postcommands.bbclass | 13 +------------
meta/files/overlayfs-create-dirs.service.in | 13 -------------
meta/files/overlayfs-create-dirs.sh | 11 -----------
meta/files/overlayfs-unit.mount.in | 3 +--
meta/lib/oe/overlayfs.py | 4 ----
6 files changed, 2 insertions(+), 52 deletions(-)
delete mode 100644 meta/files/overlayfs-create-dirs.service.in
delete mode 100644 meta/files/overlayfs-create-dirs.sh
diff --git a/meta/classes-recipe/overlayfs.bbclass b/meta/classes-recipe/overlayfs.bbclass
index a82763ec10..07cc68ad7b 100644
--- a/meta/classes-recipe/overlayfs.bbclass
+++ b/meta/classes-recipe/overlayfs.bbclass
@@ -55,27 +55,21 @@ REQUIRED_DISTRO_FEATURES += "systemd overlayfs"
inherit systemd features_check
-OVERLAYFS_CREATE_DIRS_TEMPLATE ??= "${COREBASE}/meta/files/overlayfs-create-dirs.service.in"
OVERLAYFS_MOUNT_UNIT_TEMPLATE ??= "${COREBASE}/meta/files/overlayfs-unit.mount.in"
OVERLAYFS_ALL_OVERLAYS_TEMPLATE ??= "${COREBASE}/meta/files/overlayfs-all-overlays.service.in"
python do_create_overlayfs_units() {
from oe.overlayfs import mountUnitName
- with open(d.getVar("OVERLAYFS_CREATE_DIRS_TEMPLATE"), "r") as f:
- CreateDirsUnitTemplate = f.read()
with open(d.getVar("OVERLAYFS_MOUNT_UNIT_TEMPLATE"), "r") as f:
MountUnitTemplate = f.read()
with open(d.getVar("OVERLAYFS_ALL_OVERLAYS_TEMPLATE"), "r") as f:
AllOverlaysTemplate = f.read()
def prepareUnits(data, lower):
- from oe.overlayfs import helperUnitName
-
args = {
'DATA_MOUNT_POINT': data,
'DATA_MOUNT_UNIT': mountUnitName(data),
- 'CREATE_DIRS_SERVICE': helperUnitName(lower),
'LOWERDIR': lower,
}
@@ -83,10 +77,6 @@ python do_create_overlayfs_units() {
with open(os.path.join(d.getVar('WORKDIR'), mountUnitName(lower)), 'w') as f:
f.write(MountUnitTemplate.format(**args))
- bb.debug(1, "Generate helper systemd unit %s" % helperUnitName(lower))
- with open(os.path.join(d.getVar('WORKDIR'), helperUnitName(lower)), 'w') as f:
- f.write(CreateDirsUnitTemplate.format(**args))
-
def prepareGlobalUnit(dependentUnits):
from oe.overlayfs import allOverlaysUnitName
args = {
diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index 2a36840f29..f0c7ee658d 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -47,7 +47,7 @@ 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 overlayfs_postprocess", "", d)}'
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check", "", d)}'
inherit image-artifact-names
@@ -570,14 +570,3 @@ python overlayfs_qa_check() {
if not allUnitExist:
bb.fatal('Not all mount paths and units are installed in the image')
}
-
-python overlayfs_postprocess() {
- import shutil
-
- # install helper script
- helperScriptName = "overlayfs-create-dirs.sh"
- helperScriptSource = oe.path.join(d.getVar("COREBASE"), "meta/files", helperScriptName)
- helperScriptDest = oe.path.join(d.getVar("IMAGE_ROOTFS"), "/usr/sbin/", helperScriptName)
- shutil.copyfile(helperScriptSource, helperScriptDest)
- os.chmod(helperScriptDest, 0o755)
-}
diff --git a/meta/files/overlayfs-create-dirs.service.in b/meta/files/overlayfs-create-dirs.service.in
deleted file mode 100644
index c8431548d7..0000000000
--- a/meta/files/overlayfs-create-dirs.service.in
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Overlayfs directories setup {LOWERDIR}
-RequiresMountsFor={DATA_MOUNT_POINT}
-DefaultDependencies=no
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/overlayfs-create-dirs.sh {LOWERDIR} {DATA_MOUNT_POINT}
-RemainAfterExit=true
-StandardOutput=journal
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta/files/overlayfs-create-dirs.sh b/meta/files/overlayfs-create-dirs.sh
deleted file mode 100644
index 9954c34352..0000000000
--- a/meta/files/overlayfs-create-dirs.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# This script is intended to be used sorely by overlayfs-create-dirs.service
-# Usage: overlayfs-create-dirs.sh <LOWERDIR> <DATA_MOUNT_POINT>
-
-lowerdir=$1
-datamountpoint=$2
-mkdir -p ${datamountpoint}/upper${lowerdir}
-mkdir -p ${datamountpoint}/workdir${lowerdir}
-if [ -d "$lowerdir" ]; then
- chown $(stat -c "%U:%G" ${lowerdir}) ${datamountpoint}/upper${lowerdir}
-fi
diff --git a/meta/files/overlayfs-unit.mount.in b/meta/files/overlayfs-unit.mount.in
index 9c117f2c52..eb78d2cb4f 100644
--- a/meta/files/overlayfs-unit.mount.in
+++ b/meta/files/overlayfs-unit.mount.in
@@ -1,7 +1,6 @@
[Unit]
Description=Overlayfs mount unit {LOWERDIR}
-Requires={CREATE_DIRS_SERVICE}
-After={CREATE_DIRS_SERVICE}
+RequiresMountsFor={DATA_MOUNT_POINT}
[Mount]
What=overlay
diff --git a/meta/lib/oe/overlayfs.py b/meta/lib/oe/overlayfs.py
index dbfed317c0..3805746d90 100644
--- a/meta/lib/oe/overlayfs.py
+++ b/meta/lib/oe/overlayfs.py
@@ -23,9 +23,6 @@ def allOverlaysUnitName(d):
def mountUnitName(unit):
return escapeSystemdUnitName(unit) + '.mount'
-def helperUnitName(unit):
- return escapeSystemdUnitName(unit) + '-create-upper-dir.service'
-
def unitFileList(d):
fileList = []
overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT")
@@ -47,7 +44,6 @@ def unitFileList(d):
continue
for path in mountPointList.split():
fileList.append(mountUnitName(path))
- fileList.append(helperUnitName(path))
fileList.append(allOverlaysUnitName(d))
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 4/4] oe-selftest: overlayfs: Add a demo case for /etc
2025-12-24 14:16 [PATCH v2 1/4] overlayfs: Fix QA failure uvv.mail
2025-12-24 14:16 ` [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic uvv.mail
2025-12-24 14:16 ` [PATCH v2 3/4] overlayfs: Remove helper unit uvv.mail
@ 2025-12-24 14:16 ` uvv.mail
2026-01-08 13:46 ` [OE-core] " Paul Barker
2026-01-08 13:21 ` [OE-core] [PATCH v2 1/4] overlayfs: Fix QA failure Paul Barker
3 siblings, 1 reply; 12+ messages in thread
From: uvv.mail @ 2025-12-24 14:16 UTC (permalink / raw)
To: openembedded-core; +Cc: Vyacheslav Yurkov
From: Vyacheslav Yurkov <uvv.mail@gmail.com>
/etc is a special directory. It's possible to create a mount unit for
it, but many system services that start early at boot time will not
rescan its content when you mount overlay on top. The added test case
demonstrates this by adding a sample systemd service and enabling it in
overlay.
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
meta/lib/oeqa/selftest/cases/overlayfs.py | 98 +++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
index 3e55e97927..426b4ccee3 100644
--- a/meta/lib/oeqa/selftest/cases/overlayfs.py
+++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
@@ -263,6 +263,104 @@ EOT
self._test_correct_image('systemd-machine-units', systemd_machine_unit_append)
+ @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently")
+ def test_etc_mount(self):
+ """
+ Summary: /etc is not supposed to be used with overlayfs.bbclass
+ Expected: Observe inconsistencies after using etc overlay with a mount unit
+ Author: Vyacheslav Yurkov <uvv.mail@gmail.com>
+ """
+ systemd_machine_unit_append = """
+SYSTEMD_SERVICE:${PN} += " \
+ data.mount \
+ etc.mount \
+"
+
+do_install:append() {
+ install -d ${D}${systemd_system_unitdir}
+ install -d ${D}${ROOT_HOME}
+ cat <<EOT > ${D}${systemd_system_unitdir}/etc.mount
+[Unit]
+Description=OverlayFS mount for /etc directory
+DefaultDependencies=no
+RequiresMountsFor=/data
+
+[Mount]
+What=overlay
+Where=/etc
+Type=overlay
+Options=lowerdir=/etc,upperdir=/data/overlay/etc,workdir=/data/overlay-workdir/etc
+[Install]
+WantedBy=local-fs.target
+EOT
+
+ cat <<EOT >${D}${systemd_system_unitdir}/data.mount
+[Unit]
+Description=Persistent storage partition
+
+[Mount]
+What=/dev/sda3
+Where=/data
+Type=ext4
+Options=defaults
+
+[Install]
+WantedBy=local-fs.target
+EOT
+ cat <<EOT > ${D}${ROOT_HOME}/test-daemon.service
+[Unit]
+Description=My one-shot task
+After=local-fs.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/echo test
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+EOT
+}
+
+FILES:${PN} += "${ROOT_HOME}"
+"""
+
+ config = """
+IMAGE_INSTALL:append = " systemd-machine-units"
+DISTRO_FEATURES:append = " overlayfs"
+
+# Use systemd as init manager
+INIT_MANAGER = "systemd"
+
+# enable overlayfs in the kernel
+KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc"
+
+IMAGE_FSTYPES += "wic"
+WKS_FILE = "overlayfs_etc.wks.in"
+OVERLAYFS_ROOTFS_TYPE = "ext4"
+"""
+
+ self.write_config(config)
+
+ machine_inc = """
+OVERLAYFS_MOUNT_POINT[etc] = "/etc"
+OVERLAYFS_QA_SKIP[mnt-overlay] = "mount-configured"
+"""
+ self.set_machine_config(machine_inc)
+ self.write_recipeinc('systemd-machine-units', systemd_machine_unit_append)
+ bitbake('core-image-minimal')
+ with runqemu('core-image-minimal', image_fstype='wic', discard_writes=False) as qemu:
+ test_daemon_path = get_bb_var('ROOT_HOME') + '/test-daemon.service'
+ status, output = qemu.run_serial('cp -f ' + test_daemon_path + ' /etc/systemd/system/')
+ status, output = qemu.run_serial("systemctl enable test-daemon")
+ status, output = qemu.run_serial("sync")
+ with runqemu('core-image-minimal', image_fstype='wic') as qemu:
+ # Check the test service status. It's enabled and supposed to start, but it didn't
+ status, output = qemu.run_serial("systemctl is-enabled test-daemon")
+ self.assertTrue("enabled" in output, msg=output)
+ status, output = qemu.run_serial("systemctl is-active test-daemon")
+ self.assertTrue("inactive" in output, msg=output)
+
@OETestTag("runqemu")
class OverlayFSEtcRunTimeTests(OESelftestTestCase):
"""overlayfs-etc class tests"""
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [OE-core] [PATCH v2 1/4] overlayfs: Fix QA failure
2025-12-24 14:16 [PATCH v2 1/4] overlayfs: Fix QA failure uvv.mail
` (2 preceding siblings ...)
2025-12-24 14:16 ` [PATCH v2 4/4] oe-selftest: overlayfs: Add a demo case for /etc uvv.mail
@ 2026-01-08 13:21 ` Paul Barker
2026-01-13 9:32 ` [PATCH v3] overlayfs: Fix the QA skip for ignored mounts uvv.mail
3 siblings, 1 reply; 12+ messages in thread
From: Paul Barker @ 2026-01-08 13:21 UTC (permalink / raw)
To: uvv.mail, openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]
On Wed, 2025-12-24 at 14:16 +0000, Vyacheslav Yurkov via
lists.openembedded.org wrote:
> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>
> The QA check for skipped mounts happens twice, at parsing stage and at
> rootfs postprocessing. Fix the former, because it didn't happen properly.
>
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
> meta/lib/oe/overlayfs.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/lib/oe/overlayfs.py b/meta/lib/oe/overlayfs.py
> index 8b88900f71..dbfed317c0 100644
> --- a/meta/lib/oe/overlayfs.py
> +++ b/meta/lib/oe/overlayfs.py
> @@ -36,7 +36,8 @@ def unitFileList(d):
> # check that we have required mount points set first
> requiredMountPoints = d.getVarFlags('OVERLAYFS_WRITABLE_PATHS')
> for mountPoint in requiredMountPoints:
> - if mountPoint not in overlayMountPoints:
> + qaSkip = (d.getVarFlag("OVERLAYFS_QA_SKIP", mountPoint) or "").split()
> + if mountPoint not in overlayMountPoints and not "mount-configured" in qaSkip:
> bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint)
>
> for mountPoint in overlayMountPoints:
Thanks for the patches! The review has been delayed a bit by the
holidays...
We need more explanation in the commit message of why the QA check was
happening twice and why it wasn't happening properly at parsing time.
Also, when you send a v2 (or v3, etc) patch series, please include a
note on what has changed since the previous version, either after the
commit message delimiter (the first '---' line) or in a cover letter for
the series. That makes review much easier!
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [OE-core] [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic
2025-12-24 14:16 ` [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic uvv.mail
@ 2026-01-08 13:33 ` Paul Barker
2026-01-09 8:49 ` Vyacheslav Yurkov
[not found] ` <188903DB96F81C7D.2783356@lists.openembedded.org>
0 siblings, 2 replies; 12+ messages in thread
From: Paul Barker @ 2026-01-08 13:33 UTC (permalink / raw)
To: uvv.mail, openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]
On Wed, 2025-12-24 at 14:16 +0000, Vyacheslav Yurkov via
lists.openembedded.org wrote:
> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>
> The test orignally was written under assumption that poky distro is
> used. When poky-altcft is used for example, then systemd is already set
> in DISTRO_FETURES, which the test did not expect.
The commit title says this is about determinism, but it's actually about
supporting init systems other than systemd in the test case. I also
think "selftest" should come before the component name, so perhaps it
should be:
selftest: overlayfs: Support non-systemd init systems
>
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
> meta/lib/oeqa/selftest/cases/overlayfs.py | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
> index 580fbdcb9c..3e55e97927 100644
> --- a/meta/lib/oeqa/selftest/cases/overlayfs.py
> +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
> @@ -5,7 +5,7 @@
> #
>
> from oeqa.selftest.case import OESelftestTestCase
> -from oeqa.utils.commands import bitbake, runqemu, get_bb_vars
> +from oeqa.utils.commands import bitbake, runqemu, get_bb_vars, get_bb_var
> from oeqa.core.decorator import OETestTag
> from oeqa.core.decorator.data import skipIfNotMachine
>
> @@ -46,7 +46,8 @@ inherit overlayfs
> res = bitbake('core-image-minimal', ignore_status=True)
> line = getline(res, "overlayfs-user was skipped: missing required distro features")
> self.assertTrue("overlayfs" in res.output, msg=res.output)
> - self.assertTrue("systemd" in res.output, msg=res.output)
> + if not "systemd" in get_bb_var('DISTRO_FEATURES'):
> + self.assertTrue("systemd" in res.output, msg=res.output)
The inverse logic here confused a few people on the patch review call.
Could we add a comment at the same time, something like:
# If systemd is not enabled, we should see it listed as a missing
# distro feature
That is just re-stating what the code does, but I think it's worthwhile
here to avoid confusion.
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [OE-core] [PATCH v2 4/4] oe-selftest: overlayfs: Add a demo case for /etc
2025-12-24 14:16 ` [PATCH v2 4/4] oe-selftest: overlayfs: Add a demo case for /etc uvv.mail
@ 2026-01-08 13:46 ` Paul Barker
2026-01-09 8:52 ` Vyacheslav Yurkov
0 siblings, 1 reply; 12+ messages in thread
From: Paul Barker @ 2026-01-08 13:46 UTC (permalink / raw)
To: uvv.mail, openembedded-core
[-- Attachment #1: Type: text/plain, Size: 4771 bytes --]
On Wed, 2025-12-24 at 14:16 +0000, Vyacheslav Yurkov via
lists.openembedded.org wrote:
> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>
> /etc is a special directory. It's possible to create a mount unit for
> it, but many system services that start early at boot time will not
> rescan its content when you mount overlay on top. The added test case
> demonstrates this by adding a sample systemd service and enabling it in
> overlay.
>
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
> meta/lib/oeqa/selftest/cases/overlayfs.py | 98 +++++++++++++++++++++++
> 1 file changed, 98 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
> index 3e55e97927..426b4ccee3 100644
> --- a/meta/lib/oeqa/selftest/cases/overlayfs.py
> +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
> @@ -263,6 +263,104 @@ EOT
>
> self._test_correct_image('systemd-machine-units', systemd_machine_unit_append)
>
> + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently")
> + def test_etc_mount(self):
> + """
> + Summary: /etc is not supposed to be used with overlayfs.bbclass
> + Expected: Observe inconsistencies after using etc overlay with a mount unit
> + Author: Vyacheslav Yurkov <uvv.mail@gmail.com>
> + """
> + systemd_machine_unit_append = """
> +SYSTEMD_SERVICE:${PN} += " \
> + data.mount \
> + etc.mount \
> +"
> +
> +do_install:append() {
> + install -d ${D}${systemd_system_unitdir}
> + install -d ${D}${ROOT_HOME}
> + cat <<EOT > ${D}${systemd_system_unitdir}/etc.mount
> +[Unit]
> +Description=OverlayFS mount for /etc directory
> +DefaultDependencies=no
> +RequiresMountsFor=/data
> +
> +[Mount]
> +What=overlay
> +Where=/etc
> +Type=overlay
> +Options=lowerdir=/etc,upperdir=/data/overlay/etc,workdir=/data/overlay-workdir/etc
> +[Install]
> +WantedBy=local-fs.target
> +EOT
> +
> + cat <<EOT >${D}${systemd_system_unitdir}/data.mount
> +[Unit]
> +Description=Persistent storage partition
> +
> +[Mount]
> +What=/dev/sda3
> +Where=/data
> +Type=ext4
> +Options=defaults
> +
> +[Install]
> +WantedBy=local-fs.target
> +EOT
> + cat <<EOT > ${D}${ROOT_HOME}/test-daemon.service
> +[Unit]
> +Description=My one-shot task
> +After=local-fs.target
> +
> +[Service]
> +Type=oneshot
> +ExecStart=/usr/bin/echo test
> +RemainAfterExit=yes
> +
> +[Install]
> +WantedBy=multi-user.target
> +EOT
> +}
> +
> +FILES:${PN} += "${ROOT_HOME}"
> +"""
> +
> + config = """
> +IMAGE_INSTALL:append = " systemd-machine-units"
> +DISTRO_FEATURES:append = " overlayfs"
> +
> +# Use systemd as init manager
> +INIT_MANAGER = "systemd"
> +
> +# enable overlayfs in the kernel
> +KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc"
> +
> +IMAGE_FSTYPES += "wic"
> +WKS_FILE = "overlayfs_etc.wks.in"
> +OVERLAYFS_ROOTFS_TYPE = "ext4"
> +"""
> +
> + self.write_config(config)
> +
> + machine_inc = """
> +OVERLAYFS_MOUNT_POINT[etc] = "/etc"
> +OVERLAYFS_QA_SKIP[mnt-overlay] = "mount-configured"
> +"""
> + self.set_machine_config(machine_inc)
> + self.write_recipeinc('systemd-machine-units', systemd_machine_unit_append)
> + bitbake('core-image-minimal')
> + with runqemu('core-image-minimal', image_fstype='wic', discard_writes=False) as qemu:
> + test_daemon_path = get_bb_var('ROOT_HOME') + '/test-daemon.service'
> + status, output = qemu.run_serial('cp -f ' + test_daemon_path + ' /etc/systemd/system/')
> + status, output = qemu.run_serial("systemctl enable test-daemon")
> + status, output = qemu.run_serial("sync")
> + with runqemu('core-image-minimal', image_fstype='wic') as qemu:
> + # Check the test service status. It's enabled and supposed to start, but it didn't
> + status, output = qemu.run_serial("systemctl is-enabled test-daemon")
> + self.assertTrue("enabled" in output, msg=output)
> + status, output = qemu.run_serial("systemctl is-active test-daemon")
> + self.assertTrue("inactive" in output, msg=output)
> +
What is actually being tested here? It looks like we're just confirming
that incorrect behaviour occurs. Why do we want to ensure that the
behaviour stays incorrect?
If someone is installing an 'etc.mount' unit into the rootfs that
behaves like this then there's probably nothing we can do within Yocto
Project to help them. I suppose you could use overlayfs for /etc if you
set it up from an initramfs before pivoting to the main rootfs.
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [OE-core] [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic
2026-01-08 13:33 ` [OE-core] " Paul Barker
@ 2026-01-09 8:49 ` Vyacheslav Yurkov
[not found] ` <188903DB96F81C7D.2783356@lists.openembedded.org>
1 sibling, 0 replies; 12+ messages in thread
From: Vyacheslav Yurkov @ 2026-01-09 8:49 UTC (permalink / raw)
To: Paul Barker, openembedded-core
On 08.01.2026 14:33, Paul Barker wrote:
> On Wed, 2025-12-24 at 14:16 +0000, Vyacheslav Yurkov via
> lists.openembedded.org wrote:
>> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>>
>> The test orignally was written under assumption that poky distro is
>> used. When poky-altcft is used for example, then systemd is already set
>> in DISTRO_FETURES, which the test did not expect.
> The commit title says this is about determinism, but it's actually about
> supporting init systems other than systemd in the test case. I also
> think "selftest" should come before the component name, so perhaps it
> should be:
>
> selftest: overlayfs: Support non-systemd init systems
The commit has nothing to do with non-systemd init systems, because the
whole feature only works with systemd.
>
>> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
>> ---
>> meta/lib/oeqa/selftest/cases/overlayfs.py | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
>> index 580fbdcb9c..3e55e97927 100644
>> --- a/meta/lib/oeqa/selftest/cases/overlayfs.py
>> +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
>> @@ -5,7 +5,7 @@
>> #
>>
>> from oeqa.selftest.case import OESelftestTestCase
>> -from oeqa.utils.commands import bitbake, runqemu, get_bb_vars
>> +from oeqa.utils.commands import bitbake, runqemu, get_bb_vars, get_bb_var
>> from oeqa.core.decorator import OETestTag
>> from oeqa.core.decorator.data import skipIfNotMachine
>>
>> @@ -46,7 +46,8 @@ inherit overlayfs
>> res = bitbake('core-image-minimal', ignore_status=True)
>> line = getline(res, "overlayfs-user was skipped: missing required distro features")
>> self.assertTrue("overlayfs" in res.output, msg=res.output)
>> - self.assertTrue("systemd" in res.output, msg=res.output)
>> + if not "systemd" in get_bb_var('DISTRO_FEATURES'):
>> + self.assertTrue("systemd" in res.output, msg=res.output)
> The inverse logic here confused a few people on the patch review call.
> Could we add a comment at the same time, something like:
>
> # If systemd is not enabled, we should see it listed as a missing
> # distro feature
>
> That is just re-stating what the code does, but I think it's worthwhile
> here to avoid confusion.
This is already written a few lines above in the test description.
>
> Best regards,
>
Thanks,
Slava
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [OE-core] [PATCH v2 4/4] oe-selftest: overlayfs: Add a demo case for /etc
2026-01-08 13:46 ` [OE-core] " Paul Barker
@ 2026-01-09 8:52 ` Vyacheslav Yurkov
0 siblings, 0 replies; 12+ messages in thread
From: Vyacheslav Yurkov @ 2026-01-09 8:52 UTC (permalink / raw)
To: Paul Barker, openembedded-core
On 08.01.2026 14:46, Paul Barker wrote:
> On Wed, 2025-12-24 at 14:16 +0000, Vyacheslav Yurkov via
> lists.openembedded.org wrote:
>> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>>
>> /etc is a special directory. It's possible to create a mount unit for
>> it, but many system services that start early at boot time will not
>> rescan its content when you mount overlay on top. The added test case
>> demonstrates this by adding a sample systemd service and enabling it in
>> overlay.
>>
>> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
>> ---
>> meta/lib/oeqa/selftest/cases/overlayfs.py | 98 +++++++++++++++++++++++
>> 1 file changed, 98 insertions(+)
>>
>> diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py
>> index 3e55e97927..426b4ccee3 100644
>> --- a/meta/lib/oeqa/selftest/cases/overlayfs.py
>> +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
>> @@ -263,6 +263,104 @@ EOT
>>
>> self._test_correct_image('systemd-machine-units', systemd_machine_unit_append)
>>
>> + @skipIfNotMachine("qemux86-64", "tests are qemux86-64 specific currently")
>> + def test_etc_mount(self):
>> + """
>> + Summary: /etc is not supposed to be used with overlayfs.bbclass
>> + Expected: Observe inconsistencies after using etc overlay with a mount unit
>> + Author: Vyacheslav Yurkov <uvv.mail@gmail.com>
>> + """
>> + systemd_machine_unit_append = """
>> +SYSTEMD_SERVICE:${PN} += " \
>> + data.mount \
>> + etc.mount \
>> +"
>> +
>> +do_install:append() {
>> + install -d ${D}${systemd_system_unitdir}
>> + install -d ${D}${ROOT_HOME}
>> + cat <<EOT > ${D}${systemd_system_unitdir}/etc.mount
>> +[Unit]
>> +Description=OverlayFS mount for /etc directory
>> +DefaultDependencies=no
>> +RequiresMountsFor=/data
>> +
>> +[Mount]
>> +What=overlay
>> +Where=/etc
>> +Type=overlay
>> +Options=lowerdir=/etc,upperdir=/data/overlay/etc,workdir=/data/overlay-workdir/etc
>> +[Install]
>> +WantedBy=local-fs.target
>> +EOT
>> +
>> + cat <<EOT >${D}${systemd_system_unitdir}/data.mount
>> +[Unit]
>> +Description=Persistent storage partition
>> +
>> +[Mount]
>> +What=/dev/sda3
>> +Where=/data
>> +Type=ext4
>> +Options=defaults
>> +
>> +[Install]
>> +WantedBy=local-fs.target
>> +EOT
>> + cat <<EOT > ${D}${ROOT_HOME}/test-daemon.service
>> +[Unit]
>> +Description=My one-shot task
>> +After=local-fs.target
>> +
>> +[Service]
>> +Type=oneshot
>> +ExecStart=/usr/bin/echo test
>> +RemainAfterExit=yes
>> +
>> +[Install]
>> +WantedBy=multi-user.target
>> +EOT
>> +}
>> +
>> +FILES:${PN} += "${ROOT_HOME}"
>> +"""
>> +
>> + config = """
>> +IMAGE_INSTALL:append = " systemd-machine-units"
>> +DISTRO_FEATURES:append = " overlayfs"
>> +
>> +# Use systemd as init manager
>> +INIT_MANAGER = "systemd"
>> +
>> +# enable overlayfs in the kernel
>> +KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc"
>> +
>> +IMAGE_FSTYPES += "wic"
>> +WKS_FILE = "overlayfs_etc.wks.in"
>> +OVERLAYFS_ROOTFS_TYPE = "ext4"
>> +"""
>> +
>> + self.write_config(config)
>> +
>> + machine_inc = """
>> +OVERLAYFS_MOUNT_POINT[etc] = "/etc"
>> +OVERLAYFS_QA_SKIP[mnt-overlay] = "mount-configured"
>> +"""
>> + self.set_machine_config(machine_inc)
>> + self.write_recipeinc('systemd-machine-units', systemd_machine_unit_append)
>> + bitbake('core-image-minimal')
>> + with runqemu('core-image-minimal', image_fstype='wic', discard_writes=False) as qemu:
>> + test_daemon_path = get_bb_var('ROOT_HOME') + '/test-daemon.service'
>> + status, output = qemu.run_serial('cp -f ' + test_daemon_path + ' /etc/systemd/system/')
>> + status, output = qemu.run_serial("systemctl enable test-daemon")
>> + status, output = qemu.run_serial("sync")
>> + with runqemu('core-image-minimal', image_fstype='wic') as qemu:
>> + # Check the test service status. It's enabled and supposed to start, but it didn't
>> + status, output = qemu.run_serial("systemctl is-enabled test-daemon")
>> + self.assertTrue("enabled" in output, msg=output)
>> + status, output = qemu.run_serial("systemctl is-active test-daemon")
>> + self.assertTrue("inactive" in output, msg=output)
>> +
> What is actually being tested here? It looks like we're just confirming
> that incorrect behaviour occurs. Why do we want to ensure that the
> behaviour stays incorrect?
>
> If someone is installing an 'etc.mount' unit into the rootfs that
> behaves like this then there's probably nothing we can do within Yocto
> Project to help them. I suppose you could use overlayfs for /etc if you
> set it up from an initramfs before pivoting to the main rootfs.
>
> Best regards,
>
Correct, and this is what overlayfs-etc class is for. I've seen attempts
to use the mount unit instead and this is just a proof of concept that
it doesn't work.
Slava
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v3] overlayfs: Fix the QA skip for ignored mounts
2026-01-08 13:21 ` [OE-core] [PATCH v2 1/4] overlayfs: Fix QA failure Paul Barker
@ 2026-01-13 9:32 ` uvv.mail
2026-01-14 13:34 ` [OE-core] " Antonin Godard
0 siblings, 1 reply; 12+ messages in thread
From: uvv.mail @ 2026-01-13 9:32 UTC (permalink / raw)
To: openembedded-core; +Cc: Vyacheslav Yurkov
From: Vyacheslav Yurkov <uvv.mail@gmail.com>
The supressing of QA check for mounts should happens twice, at parsing stage
and at rootfs postprocessing. If the mount point is configured to be skipped,
but it is still present in the configuration (machine or distro), then the
parsing would complain.
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
meta/lib/oe/overlayfs.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oe/overlayfs.py b/meta/lib/oe/overlayfs.py
index 8b88900f71..dbfed317c0 100644
--- a/meta/lib/oe/overlayfs.py
+++ b/meta/lib/oe/overlayfs.py
@@ -36,7 +36,8 @@ def unitFileList(d):
# check that we have required mount points set first
requiredMountPoints = d.getVarFlags('OVERLAYFS_WRITABLE_PATHS')
for mountPoint in requiredMountPoints:
- if mountPoint not in overlayMountPoints:
+ qaSkip = (d.getVarFlag("OVERLAYFS_QA_SKIP", mountPoint) or "").split()
+ if mountPoint not in overlayMountPoints and not "mount-configured" in qaSkip:
bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint)
for mountPoint in overlayMountPoints:
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [OE-core] [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic
[not found] ` <188903DB96F81C7D.2783356@lists.openembedded.org>
@ 2026-01-14 7:45 ` Vyacheslav Yurkov
0 siblings, 0 replies; 12+ messages in thread
From: Vyacheslav Yurkov @ 2026-01-14 7:45 UTC (permalink / raw)
To: openembedded-core
Just want to double check, what is the reason the patch was dropped from
master-next? Is that only the component order in the caption?
Slava
On 09.01.2026 09:49, Vyacheslav Yurkov via lists.openembedded.org wrote:
> On 08.01.2026 14:33, Paul Barker wrote:
>> On Wed, 2025-12-24 at 14:16 +0000, Vyacheslav Yurkov via
>> lists.openembedded.org wrote:
>>> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>>>
>>> The test orignally was written under assumption that poky distro is
>>> used. When poky-altcft is used for example, then systemd is already set
>>> in DISTRO_FETURES, which the test did not expect.
>> The commit title says this is about determinism, but it's actually about
>> supporting init systems other than systemd in the test case. I also
>> think "selftest" should come before the component name, so perhaps it
>> should be:
>>
>> selftest: overlayfs: Support non-systemd init systems
>
> The commit has nothing to do with non-systemd init systems, because
> the whole feature only works with systemd.
>
>>
>>> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
>>> ---
>>> meta/lib/oeqa/selftest/cases/overlayfs.py | 5 +++--
>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py
>>> b/meta/lib/oeqa/selftest/cases/overlayfs.py
>>> index 580fbdcb9c..3e55e97927 100644
>>> --- a/meta/lib/oeqa/selftest/cases/overlayfs.py
>>> +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py
>>> @@ -5,7 +5,7 @@
>>> #
>>> from oeqa.selftest.case import OESelftestTestCase
>>> -from oeqa.utils.commands import bitbake, runqemu, get_bb_vars
>>> +from oeqa.utils.commands import bitbake, runqemu, get_bb_vars,
>>> get_bb_var
>>> from oeqa.core.decorator import OETestTag
>>> from oeqa.core.decorator.data import skipIfNotMachine
>>> @@ -46,7 +46,8 @@ inherit overlayfs
>>> res = bitbake('core-image-minimal', ignore_status=True)
>>> line = getline(res, "overlayfs-user was skipped: missing
>>> required distro features")
>>> self.assertTrue("overlayfs" in res.output, msg=res.output)
>>> - self.assertTrue("systemd" in res.output, msg=res.output)
>>> + if not "systemd" in get_bb_var('DISTRO_FEATURES'):
>>> + self.assertTrue("systemd" in res.output, msg=res.output)
>> The inverse logic here confused a few people on the patch review call.
>> Could we add a comment at the same time, something like:
>>
>> # If systemd is not enabled, we should see it listed as a missing
>> # distro feature
>>
>> That is just re-stating what the code does, but I think it's worthwhile
>> here to avoid confusion.
>
> This is already written a few lines above in the test description.
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [OE-core] [PATCH v3] overlayfs: Fix the QA skip for ignored mounts
2026-01-13 9:32 ` [PATCH v3] overlayfs: Fix the QA skip for ignored mounts uvv.mail
@ 2026-01-14 13:34 ` Antonin Godard
0 siblings, 0 replies; 12+ messages in thread
From: Antonin Godard @ 2026-01-14 13:34 UTC (permalink / raw)
To: uvv.mail, openembedded-core
Hi,
You have sent multiple versions of some patches (v3 for 1/4, v2 for the rest,
I think): it's not straightforward for maintainers to follow which patch version
to apply.
I also see Paul has made some comment about the naming order of the patch
titles.
Can you take Paul's comments into account, and can you please re-send the series
with the proper versions of the patches? All patches should have the same
version.
Thanks!
Antonin
--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-01-14 13:34 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-24 14:16 [PATCH v2 1/4] overlayfs: Fix QA failure uvv.mail
2025-12-24 14:16 ` [PATCH v2 2/4] overlayfs: oe-selftest: Make the test more deterministic uvv.mail
2026-01-08 13:33 ` [OE-core] " Paul Barker
2026-01-09 8:49 ` Vyacheslav Yurkov
[not found] ` <188903DB96F81C7D.2783356@lists.openembedded.org>
2026-01-14 7:45 ` Vyacheslav Yurkov
2025-12-24 14:16 ` [PATCH v2 3/4] overlayfs: Remove helper unit uvv.mail
2025-12-24 14:16 ` [PATCH v2 4/4] oe-selftest: overlayfs: Add a demo case for /etc uvv.mail
2026-01-08 13:46 ` [OE-core] " Paul Barker
2026-01-09 8:52 ` Vyacheslav Yurkov
2026-01-08 13:21 ` [OE-core] [PATCH v2 1/4] overlayfs: Fix QA failure Paul Barker
2026-01-13 9:32 ` [PATCH v3] overlayfs: Fix the QA skip for ignored mounts uvv.mail
2026-01-14 13:34 ` [OE-core] " Antonin Godard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox