From 683a7db46d8443d8a96081a20f80df176eef71f1 Mon Sep 17 00:00:00 2001 From: Vyacheslav Yurkov Date: Tue, 2 Nov 2021 14:56:14 +0100 Subject: [PATCH] ref-manual: update overlayfs class Describe how to use a generated helper service to set up a proper systemd dependency chain. (From yocto-docs rev: c8c1f7e852830dae4468da70e1ac732d7bbce06f) Signed-off-by: Vyacheslav Yurkov Reviewed-by: Michael Opdenacker Signed-off-by: Richard Purdie --- documentation/ref-manual/classes.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index 9b1ead66b3..5bc4472e34 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,19 @@ and then in your recipe:: OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application" +On a practical note, your application recipe might require multiple +overlays to be mounted before running to avoid writing to the underlying +file system (which can be forbidden in case of read-only file system) +To achieve that :ref:`overlayfs ` provides a ``systemd`` +helper service for mounting overlays. This helper service is named +``${PN}-overlays.service`` and can be depended on in your application recipe +(named ``application`` in the following example) ``systemd`` unit by adding +to the unit the following:: + + [Unit] + After=application-overlays.service + Requires=application-overlays.service + .. note:: The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.