summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual/classes.rst
diff options
context:
space:
mode:
authorVyacheslav Yurkov <uvv.mail@gmail.com>2021-12-16 12:22:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-07 11:12:06 +0000
commit4b2d79d740f14e1197ef6510b71cd3b0e425ccc5 (patch)
tree300ac35cd7498a292cbbbf451b7693a1a2a9aaa0 /documentation/ref-manual/classes.rst
parent7c7e53570c8171cc0d3729e4d507b4bd0ca82167 (diff)
downloadpoky-4b2d79d740f14e1197ef6510b71cd3b0e425ccc5.tar.gz
ref-manual: add overlayfs-etc class
(From yocto-docs rev: c11da26609e02f0c0b43efacb4642141d990ebaa) Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual/classes.rst')
-rw-r--r--documentation/ref-manual/classes.rst46
1 files changed, 46 insertions, 0 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 2c191f407e..e70c7d9013 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -1769,6 +1769,52 @@ to the unit the following::
1769.. note:: 1769.. note::
1770 1770
1771 The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it. 1771 The class does not support the ``/etc`` directory itself, because ``systemd`` depends on it.
1772 In order to get ``/etc`` in overlayfs, see :ref:`overlayfs-etc <ref-classes-overlayfs-etc>`.
1773
1774.. _ref-classes-overlayfs-etc:
1775
1776``overlayfs-etc.bbclass``
1777=========================
1778
1779In order to have the ``/etc`` directory in overlayfs a special handling at early
1780boot stage is required. The idea is to supply a custom init script that mounts
1781``/etc`` before launching the actual init program, because the latter already
1782requires ``/etc`` to be mounted.
1783
1784Example usage in image recipe::
1785
1786 IMAGE_FEATURES += "overlayfs-etc"
1787
1788.. note::
1789
1790 This class must not be inherited directly. Use :term:`IMAGE_FEATURES` or :term:`EXTRA_IMAGE_FEATURES`
1791
1792Your machine configuration should define at least the device, mount point, and file system type
1793you are going to use for ``overlayfs``::
1794
1795 OVERLAYFS_ETC_MOUNT_POINT = "/data"
1796 OVERLAYFS_ETC_DEVICE = "/dev/mmcblk0p2"
1797 OVERLAYFS_ETC_FSTYPE ?= "ext4"
1798
1799To control more mount options you should consider setting mount options
1800(``defaults`` is used by default)::
1801
1802 OVERLAYFS_ETC_MOUNT_OPTIONS = "wsync"
1803
1804The class provides two options for ``/sbin/init`` generation:
1805
1806- The default option is to rename the original ``/sbin/init`` to ``/sbin/init.orig``
1807 and place the generated init under original name, i.e. ``/sbin/init``. It has an advantage
1808 that you won't need to change any kernel parameters in order to make it work,
1809 but it poses a restriction that package-management can't be used, because updating
1810 the init manager would remove the generated script.
1811
1812- If you wish to keep original init as is, you can set::
1813
1814 OVERLAYFS_ETC_USE_ORIG_INIT_NAME = "0"
1815
1816 Then the generated init will be named ``/sbin/preinit`` and you would need to extend your
1817 kernel parameters manually in your bootloader configuration.
1772 1818
1773.. _ref-classes-own-mirrors: 1819.. _ref-classes-own-mirrors:
1774 1820