diff options
| author | Vyacheslav Yurkov <uvv.mail@gmail.com> | 2021-12-16 12:22:34 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-07 11:12:06 +0000 |
| commit | 4b2d79d740f14e1197ef6510b71cd3b0e425ccc5 (patch) | |
| tree | 300ac35cd7498a292cbbbf451b7693a1a2a9aaa0 /documentation | |
| parent | 7c7e53570c8171cc0d3729e4d507b4bd0ca82167 (diff) | |
| download | poky-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')
| -rw-r--r-- | documentation/ref-manual/classes.rst | 46 |
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 | |||
| 1779 | In order to have the ``/etc`` directory in overlayfs a special handling at early | ||
| 1780 | boot 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 | ||
| 1782 | requires ``/etc`` to be mounted. | ||
| 1783 | |||
| 1784 | Example 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 | |||
| 1792 | Your machine configuration should define at least the device, mount point, and file system type | ||
| 1793 | you 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 | |||
| 1799 | To control more mount options you should consider setting mount options | ||
| 1800 | (``defaults`` is used by default):: | ||
| 1801 | |||
| 1802 | OVERLAYFS_ETC_MOUNT_OPTIONS = "wsync" | ||
| 1803 | |||
| 1804 | The 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 | ||
