From: Vyacheslav Yurkov <uvv.mail@gmail.com>
To: docs@lists.yoctoproject.org
Cc: Vyacheslav Yurkov <uvv.mail@gmail.com>
Subject: [PATCH] ref-manual: update overlayfs class
Date: Mon, 1 Nov 2021 12:58:42 +0100 [thread overview]
Message-ID: <20211101115842.17956-1-uvv.mail@gmail.com> (raw)
Describe how to use a generated helper service to set up a proper
systemd dependency chain.
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
documentation/ref-manual/classes.rst | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 9b1ead66b..1638f6ea0 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -1742,7 +1742,8 @@ Then you can specify writable directories on a recipe basis (e.g. in my-applicat
To support several mount points you can use a different variable flag. Assuming we
want to have a writable location on the file system, but do not need that the data
-survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs`` file system.
+survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs``
+file system.
In your machine configuration::
@@ -1752,6 +1753,22 @@ and then in your recipe::
OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
+On a practical note, your application recipe might use several mount points,
+therefore you'd like your application to start only when all overlays are mounted
+otherwise you might end up in a situation when application would write to an actual
+underlying file system (if it allows it) or could't write at all (for RO file systems).
+To achieve that :ref:`overlayfs <ref-classes-overlayfs>` provides another helper
+service, which you can use to set dependencies on. The systemd dependency chain makes
+sure the service start only when all ``overlayfs`` mount points used in the recipe
+are mounted. File name is fixed to ``${PN}-overlays.service``, so you can depend only
+on this service in your application service file. E.g. if you have a recipe
+``application.bb`` and a corresponding start-up service ``application.service``, you
+can add dependencies as follows::
+
+ [Unit]
+ After=application-overlays.service
+ Requires=application-overlays.service
+
.. note::
The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.
--
2.28.0
next reply other threads:[~2021-11-01 12:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 11:58 Vyacheslav Yurkov [this message]
2021-11-02 9:56 ` [docs] [PATCH] ref-manual: update overlayfs class Quentin Schulz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211101115842.17956-1-uvv.mail@gmail.com \
--to=uvv.mail@gmail.com \
--cc=docs@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.