docs.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ref-manual: add overlayfs class
@ 2021-08-22 20:14 Vyacheslav Yurkov
  2021-09-13 15:24 ` [docs] " Michael Opdenacker
  0 siblings, 1 reply; 3+ messages in thread
From: Vyacheslav Yurkov @ 2021-08-22 20:14 UTC (permalink / raw)
  To: docs; +Cc: Vyacheslav Yurkov

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
 documentation/ref-manual/classes.rst | 49 ++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 3af023895..ca6430034 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -1710,6 +1710,55 @@ one such example. However, being aware of this class can reduce the
 proliferation of different versions of similar classes across multiple
 layers.
 
+.. _ref-classes-overlayfs:
+
+``overlayfs.bbclass``
+=======================
+
+It's often desired in Embedded System design to have a read-only rootfs.
+But a lot of different applications might want to have a read-write access to
+some parts of a filesystem. It can be especially useful when your update mechanism
+overwrites the whole rootfs, but you want your application data to be preserved
+between updates. The :ref:`overlayfs <ref-classes-overlayfs>` class provides a way
+to achieve that by means of ``overlayfs`` and at the same time keeping the base
+rootfs read-only.
+
+To use this class, set a mount point for a partition overlayfs is going to use as upper
+layer in your machine configuration. Underlying file system can be anything that
+is supported by overlayfs. This has to be done in your machine configuration::
+
+  OVERLAYFS_MOUNT_POINT[data] = "/data"
+
+.. note::
+
+  * QA check fails to catch file existence if you redefine this variable in your recipe!
+  * Only existence of the systemd mount unit file is checked, not its content.
+  * To get more details on overlayfs, its internals and supported operations, please refer
+    to the official documentation of the `Linux kernel <https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html>`_
+
+The class assumes you have a ``data.mount`` systemd unit defined elsewhere in your BSP
+(e.g. in ``systemd-machine-units`` recipe) and it's installed to the image.
+
+Then you can specify writable directories on a recipe basis (e.g. in my-application.bb)::
+
+  OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application"
+
+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 not interested where the data
+survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs`` file system.
+
+In your machine configuration::
+
+  OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay"
+
+and then in your recipe::
+
+  OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
+
+.. note::
+
+   The class does not support ``/etc`` directory itself, because ``systemd`` depends on it
+
 .. _ref-classes-own-mirrors:
 
 ``own-mirrors.bbclass``
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [docs] [PATCH v2] ref-manual: add overlayfs class
  2021-08-22 20:14 [PATCH v2] ref-manual: add overlayfs class Vyacheslav Yurkov
@ 2021-09-13 15:24 ` Michael Opdenacker
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Opdenacker @ 2021-09-13 15:24 UTC (permalink / raw)
  To: Vyacheslav Yurkov, docs

Hi Slava,

On 8/22/21 10:14 PM, Vyacheslav Yurkov wrote:
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
>  documentation/ref-manual/classes.rst | 49 ++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
>
> diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
> index 3af023895..ca6430034 100644
> --- a/documentation/ref-manual/classes.rst
> +++ b/documentation/ref-manual/classes.rst
> @@ -1710,6 +1710,55 @@ one such example. However, being aware of this class can reduce the
>  proliferation of different versions of similar classes across multiple
>  layers.
>  
> +.. _ref-classes-overlayfs:
> +
> +``overlayfs.bbclass``
> +=======================
> +
> +It's often desired in Embedded System design to have a read-only rootfs.
> +But a lot of different applications might want to have a read-write access to
> +some parts of a filesystem. It can be especially useful when your update mechanism
> +overwrites the whole rootfs, but you want your application data to be preserved
> +between updates. The :ref:`overlayfs <ref-classes-overlayfs>` class provides a way
> +to achieve that by means of ``overlayfs`` and at the same time keeping the base
> +rootfs read-only.
> +
> +To use this class, set a mount point for a partition overlayfs is going to use as upper
> +layer in your machine configuration. Underlying file system can be anything that
> +is supported by overlayfs. This has to be done in your machine configuration::
> +
> +  OVERLAYFS_MOUNT_POINT[data] = "/data"
> +
> +.. note::
> +
> +  * QA check fails to catch file existence if you redefine this variable in your recipe!
> +  * Only existence of the systemd mount unit file is checked, not its content.
> +  * To get more details on overlayfs, its internals and supported operations, please refer
> +    to the official documentation of the `Linux kernel <https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html>`_
> +
> +The class assumes you have a ``data.mount`` systemd unit defined elsewhere in your BSP
> +(e.g. in ``systemd-machine-units`` recipe) and it's installed to the image.
> +
> +Then you can specify writable directories on a recipe basis (e.g. in my-application.bb)::
> +
> +  OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application"
> +
> +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 not interested where the data
> +survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a ``tmpfs`` file system.
> +
> +In your machine configuration::
> +
> +  OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay"
> +
> +and then in your recipe::
> +
> +  OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
> +
> +.. note::
> +
> +   The class does not support ``/etc`` directory itself, because ``systemd`` depends on it
> +
>  .. _ref-classes-own-mirrors:
>  
>  ``own-mirrors.bbclass``

Thanks for the code, for the documentation patch and its update.

I just added minor (mostly grammar) tweaks, but after those:

Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>

Now merged into "master-next".

Cheers,
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [docs] [PATCH v2] ref-manual: add overlayfs class
       [not found] <169DBA2544D42714.9946@lists.yoctoproject.org>
@ 2021-09-04 15:09 ` Vyacheslav Yurkov
  0 siblings, 0 replies; 3+ messages in thread
From: Vyacheslav Yurkov @ 2021-09-04 15:09 UTC (permalink / raw)
  To: Vyacheslav Yurkov; +Cc: docs

[-- Attachment #1: Type: text/plain, Size: 3262 bytes --]

Any more comments on this patch?

Vyacheslav

On Sun, Aug 22, 2021, 23:15 Vyacheslav Yurkov via lists.yoctoproject.org
<uvv.mail=gmail.com@lists.yoctoproject.org> wrote:

> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
>  documentation/ref-manual/classes.rst | 49 ++++++++++++++++++++++++++++
>  1 file changed, 49 insertions(+)
>
> diff --git a/documentation/ref-manual/classes.rst
> b/documentation/ref-manual/classes.rst
> index 3af023895..ca6430034 100644
> --- a/documentation/ref-manual/classes.rst
> +++ b/documentation/ref-manual/classes.rst
> @@ -1710,6 +1710,55 @@ one such example. However, being aware of this
> class can reduce the
>  proliferation of different versions of similar classes across multiple
>  layers.
>
> +.. _ref-classes-overlayfs:
> +
> +``overlayfs.bbclass``
> +=======================
> +
> +It's often desired in Embedded System design to have a read-only rootfs.
> +But a lot of different applications might want to have a read-write
> access to
> +some parts of a filesystem. It can be especially useful when your update
> mechanism
> +overwrites the whole rootfs, but you want your application data to be
> preserved
> +between updates. The :ref:`overlayfs <ref-classes-overlayfs>` class
> provides a way
> +to achieve that by means of ``overlayfs`` and at the same time keeping
> the base
> +rootfs read-only.
> +
> +To use this class, set a mount point for a partition overlayfs is going
> to use as upper
> +layer in your machine configuration. Underlying file system can be
> anything that
> +is supported by overlayfs. This has to be done in your machine
> configuration::
> +
> +  OVERLAYFS_MOUNT_POINT[data] = "/data"
> +
> +.. note::
> +
> +  * QA check fails to catch file existence if you redefine this variable
> in your recipe!
> +  * Only existence of the systemd mount unit file is checked, not its
> content.
> +  * To get more details on overlayfs, its internals and supported
> operations, please refer
> +    to the official documentation of the `Linux kernel <
> https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html>`_
> +
> +The class assumes you have a ``data.mount`` systemd unit defined
> elsewhere in your BSP
> +(e.g. in ``systemd-machine-units`` recipe) and it's installed to the
> image.
> +
> +Then you can specify writable directories on a recipe basis (e.g. in
> my-application.bb)::
> +
> +  OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application"
> +
> +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 not interested
> where the data
> +survives a reboot, then we could have a ``mnt-overlay.mount`` unit for a
> ``tmpfs`` file system.
> +
> +In your machine configuration::
> +
> +  OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay"
> +
> +and then in your recipe::
> +
> +  OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application"
> +
> +.. note::
> +
> +   The class does not support ``/etc`` directory itself, because
> ``systemd`` depends on it
> +
>  .. _ref-classes-own-mirrors:
>
>  ``own-mirrors.bbclass``
> --
> 2.28.0
>
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 4090 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-13 15:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22 20:14 [PATCH v2] ref-manual: add overlayfs class Vyacheslav Yurkov
2021-09-13 15:24 ` [docs] " Michael Opdenacker
     [not found] <169DBA2544D42714.9946@lists.yoctoproject.org>
2021-09-04 15:09 ` Vyacheslav Yurkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).