* [PATCH v2 1/2] ref-manual: add overlayfs-etc class
@ 2021-12-16 11:22 Vyacheslav Yurkov
2021-12-16 11:22 ` [PATCH v2 2/2] ref-manual: document overlayfs-etc image feature Vyacheslav Yurkov
0 siblings, 1 reply; 5+ messages in thread
From: Vyacheslav Yurkov @ 2021-12-16 11:22 UTC (permalink / raw)
To: docs; +Cc: Vyacheslav Yurkov
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
documentation/ref-manual/classes.rst | 45 ++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 2c191f407..b9baa0004 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -1769,6 +1769,51 @@ to the unit the following::
.. note::
The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.
+ In order to get ``/etc`` in overlayfs see :ref:`overlayfs-etc <ref-classes-overlayfs-etc>`
+
+.. _ref-classes-overlayfs-etc:
+
+``overlayfs-etc.bbclass``
+=========================
+
+In order to have the ``/etc`` directory in overlayfs a special handling at early
+boot stage is required. The idea is to supply a custom init script that mounts
+``/etc`` before launching the actual init program, because the latter already
+requires ``/etc`` to be mounted
+
+Example usage in image recipe::
+
+ IMAGE_FEATURES += "overlayfs-etc"
+
+.. note::
+
+ This class must not be inherited directly. Use :term:`IMAGE_FEATURES` or :term:`EXTRA_IMAGE_FEATURES`
+
+Your machine configuration should define at least the device, mount point, and file system type
+you are going to use for ``overlayfs``::
+
+ OVERLAYFS_ETC_MOUNT_POINT = "/data"
+ OVERLAYFS_ETC_DEVICE = "/dev/mmcblk0p2"
+ OVERLAYFS_ETC_FSTYPE ?= "ext4"
+
+To control more mount options you should consider setting mount options
+(``defaults`` is used by default)::
+
+ OVERLAYFS_ETC_MOUNT_OPTIONS = "wsync"
+
+The class provides two options for ``/sbin/init`` generation:
+
+* The default option is to rename the original ``/sbin/init`` to ``/sbin/init.orig``
+ and place generated init under original name, i.e. ``/sbin/init``. It has an advantage
+ that you won't need to change any kernel parameters in order to make it work,
+ but it poses a restriction that package-management can't be used, because updating
+ init manager would remove the generated script
+* If you wish to keep original init as is, you can set::
+
+ OVERLAYFS_ETC_USE_ORIG_INIT_NAME = "0"
+
+ Then the generated init will be named ``/sbin/preinit`` and you would need to extend your
+ kernel parameters manually in your bootloader configuration.
.. _ref-classes-own-mirrors:
--
2.28.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] ref-manual: document overlayfs-etc image feature
2021-12-16 11:22 [PATCH v2 1/2] ref-manual: add overlayfs-etc class Vyacheslav Yurkov
@ 2021-12-16 11:22 ` Vyacheslav Yurkov
2021-12-16 16:52 ` [docs] " Michael Opdenacker
0 siblings, 1 reply; 5+ messages in thread
From: Vyacheslav Yurkov @ 2021-12-16 11:22 UTC (permalink / raw)
To: docs; +Cc: Vyacheslav Yurkov
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
documentation/ref-manual/features.rst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/documentation/ref-manual/features.rst b/documentation/ref-manual/features.rst
index ded653221..57fe0cc3c 100644
--- a/documentation/ref-manual/features.rst
+++ b/documentation/ref-manual/features.rst
@@ -219,6 +219,10 @@ Here are the image features available for all images:
- *empty-root-password:* Sets the root password to an empty string,
which allows logins with a blank password.
+- *overlayfs-etc:* Configures the ``/etc`` directory to be in ``overlayfs``.
+ This allows to store device specific information elsewhere, especially
+ if root filesystem is configured to be read-only.
+
- *package-management:* Installs package management tools and preserves
the package manager database.
--
2.28.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [docs] [PATCH v2 2/2] ref-manual: document overlayfs-etc image feature
2021-12-16 11:22 ` [PATCH v2 2/2] ref-manual: document overlayfs-etc image feature Vyacheslav Yurkov
@ 2021-12-16 16:52 ` Michael Opdenacker
2021-12-17 6:07 ` Vyacheslav Yurkov
0 siblings, 1 reply; 5+ messages in thread
From: Michael Opdenacker @ 2021-12-16 16:52 UTC (permalink / raw)
To: Vyacheslav Yurkov, docs
Hi Slava,
Many thanks for the updates!
On 12/16/21 12:22 PM, Vyacheslav Yurkov wrote:
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
> documentation/ref-manual/features.rst | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/documentation/ref-manual/features.rst b/documentation/ref-manual/features.rst
> index ded653221..57fe0cc3c 100644
> --- a/documentation/ref-manual/features.rst
> +++ b/documentation/ref-manual/features.rst
> @@ -219,6 +219,10 @@ Here are the image features available for all images:
> - *empty-root-password:* Sets the root password to an empty string,
> which allows logins with a blank password.
>
> +- *overlayfs-etc:* Configures the ``/etc`` directory to be in ``overlayfs``.
> + This allows to store device specific information elsewhere, especially
> + if root filesystem is configured to be read-only.
> +
> - *package-management:* Installs package management tools and preserves
> the package manager database.
For both patches: Reviewed-by: Michael Opdenacker
<michael.opdenacker@bootlin.com>
There were a few remaining punctuation and missing article issues (that
I probably failed to report), but I was happy to fix them!
Merged in "master-next".
Thanks again.
Michael.
--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [docs] [PATCH v2 2/2] ref-manual: document overlayfs-etc image feature
2021-12-16 16:52 ` [docs] " Michael Opdenacker
@ 2021-12-17 6:07 ` Vyacheslav Yurkov
2021-12-17 7:07 ` Michael Opdenacker
0 siblings, 1 reply; 5+ messages in thread
From: Vyacheslav Yurkov @ 2021-12-17 6:07 UTC (permalink / raw)
To: Michael Opdenacker, docs
Hi Michael,
Thanks for the review and updates.
I assume it might be easier to send an update patch separately if
needed. Or you can do fix-ups in master-next? :)
Cheers,
Slava
On 16.12.2021 17:52, Michael Opdenacker wrote:
> Hi Slava,
>
> Many thanks for the updates!
>
> On 12/16/21 12:22 PM, Vyacheslav Yurkov wrote:
>
> For both patches: Reviewed-by: Michael Opdenacker
> <michael.opdenacker@bootlin.com>
> There were a few remaining punctuation and missing article issues (that
> I probably failed to report), but I was happy to fix them!
>
> Merged in "master-next".
>
> Thanks again.
> Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [docs] [PATCH v2 2/2] ref-manual: document overlayfs-etc image feature
2021-12-17 6:07 ` Vyacheslav Yurkov
@ 2021-12-17 7:07 ` Michael Opdenacker
0 siblings, 0 replies; 5+ messages in thread
From: Michael Opdenacker @ 2021-12-17 7:07 UTC (permalink / raw)
To: Vyacheslav Yurkov, docs
Hi Slava
On 12/17/21 7:07 AM, Vyacheslav Yurkov wrote:
> Hi Michael,
> Thanks for the review and updates.
>
> I assume it might be easier to send an update patch separately if
> needed. Or you can do fix-ups in master-next? :)
I can make fixups in master-next indeed. This way, we just have one commit.
Cheers
Michael.
--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-17 7:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-16 11:22 [PATCH v2 1/2] ref-manual: add overlayfs-etc class Vyacheslav Yurkov
2021-12-16 11:22 ` [PATCH v2 2/2] ref-manual: document overlayfs-etc image feature Vyacheslav Yurkov
2021-12-16 16:52 ` [docs] " Michael Opdenacker
2021-12-17 6:07 ` Vyacheslav Yurkov
2021-12-17 7:07 ` Michael Opdenacker
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.