summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Hernandez Samaniego <alhe@linux.microsoft.com>2022-02-16 13:17:31 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-18 17:58:02 +0000
commit552ff6e3d5f96834e6b3a8881154636dab54a62e (patch)
treed8c34216f3d89a2169ea3d2b9c7d38104169e585
parentb6c132950188ad41bd6454bbc708a42999c369be (diff)
downloadpoky-552ff6e3d5f96834e6b3a8881154636dab54a62e.tar.gz
documentation: Add multiconfig initramfs configuration:
dev-manual/common-tasks.rst: Add section to create an initramfs image from a separate multiconfig. ref-manual/variables.rst: Add new variable definitions for INITRAMFS_DEPLOY_DIR_IMAGE and INITRAMFS_MULTICONFIG (From yocto-docs rev: 7853ab3df82c27ba309879a66a084b2e597dc1e5) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alhe@linux.microsoft.com> Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--documentation/dev-manual/common-tasks.rst42
-rw-r--r--documentation/ref-manual/variables.rst17
2 files changed, 59 insertions, 0 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst
index 1856d4c3ad..fd394c3ae2 100644
--- a/documentation/dev-manual/common-tasks.rst
+++ b/documentation/dev-manual/common-tasks.rst
@@ -3919,6 +3919,48 @@ Follow these steps to create an initramfs image:
3919 :term:`INITRAMFS_IMAGE_BUNDLE` 3919 :term:`INITRAMFS_IMAGE_BUNDLE`
3920 variable described earlier. 3920 variable described earlier.
3921 3921
3922Bundling an Initramfs Image From a Separate Multiconfig
3923~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3924
3925There may be a case where we want to build an initramfs image which does not
3926inherit the same distro policy as our main image, for example, we may want
3927our main image to use ``TCLIBC="glibc"``, but to use ``TCLIBC="musl"`` in our initramfs
3928image to keep a smaller footprint. However, by performing the steps mentioned
3929above the initramfs image will inherit ``TCLIBC="glibc"`` without allowing us
3930to override it.
3931
3932To achieve this, you need to perform some additional steps:
3933
39341. *Create a multiconfig for your initramfs image:* You can perform the steps
3935 on ":ref:`dev-manual/common-tasks:building images for multiple targets using multiple configurations`" to create a separate multiconfig.
3936 For the sake of simplicity let's assume such multiconfig is called: ``initramfscfg.conf`` and
3937 contains the variables::
3938
3939 TMPDIR="${TOPDIR}/tmp-initramfscfg"
3940 TCLIBC="musl"
3941
39422. *Set additional initramfs variables on your main configuration:*
3943 Additionally, on your main configuration (``local.conf``) you need to set the
3944 variables::
3945
3946 INITRAMFS_MULTICONFIG = "initramfscfg"
3947 INITRAMFS_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-initramfscfg/deploy/images/${MACHINE}"
3948
3949 The variables :term:`INITRAMFS_MULTICONFIG` and :term:`INITRAMFS_DEPLOY_DIR_IMAGE`
3950 are used to create a multiconfig dependency from the kernel to the :term:`INITRAMFS_IMAGE`
3951 to be built coming from the ``initramfscfg`` multiconfig, and to let the
3952 buildsystem know where the :term:`INITRAMFS_IMAGE` will be located.
3953
3954 Building a system with such configuration will build the kernel using the
3955 main configuration but the ``do_bundle_initramfs`` task will grab the
3956 selected :term:`INITRAMFS_IMAGE` from :term:`INITRAMFS_DEPLOY_DIR_IMAGE`
3957 instead, resulting in a musl based initramfs image bundled in the kernel
3958 but a glibc based main image.
3959
3960 The same is applicable to avoid inheriting :term:`DISTRO_FEATURES` on :term:`INITRAMFS_IMAGE`
3961 or to build a different :term:`DISTRO` for it such as ``poky-tiny``.
3962
3963
3922Building a Tiny System 3964Building a Tiny System
3923---------------------- 3965----------------------
3924 3966
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index d4f40b6929..caa9713935 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -3554,6 +3554,13 @@ system and gives an overview of their function and contents.
3554 even if the toolchain's binaries are strippable, there are other files 3554 even if the toolchain's binaries are strippable, there are other files
3555 needed for the build that are not strippable. 3555 needed for the build that are not strippable.
3556 3556
3557 :term:`INITRAMFS_DEPLOY_DIR_IMAGE`
3558 Indicates the deploy directory used by ``do_bundle_initramfs`` where the
3559 :term:`INITRAMFS_IMAGE` will be fetched from.
3560 This variable is set by default to ``${DEPLOY_DIR_IMAGE}`` in the
3561 :ref:`kernel <ref-classes-kernel>` class and it's only meant to be changed
3562 when building an initramfs image from a separate multiconfig via :term:`INITRAMFS_MULTICONFIG`.
3563
3557 :term:`INITRAMFS_FSTYPES` 3564 :term:`INITRAMFS_FSTYPES`
3558 Defines the format for the output image of an initial RAM filesystem 3565 Defines the format for the output image of an initial RAM filesystem
3559 (initramfs), which is used during boot. Supported formats are the 3566 (initramfs), which is used during boot. Supported formats are the
@@ -3673,6 +3680,16 @@ system and gives an overview of their function and contents.
3673 See the :term:`MACHINE` variable for additional 3680 See the :term:`MACHINE` variable for additional
3674 information. 3681 information.
3675 3682
3683 :term:`INITRAMFS_MULTICONFIG`
3684 Defines the multiconfig to create a multiconfig dependency to be used by the :ref:`kernel <ref-classes-kernel>` class.
3685
3686 This allows the kernel to bundle an :term:`INITRAMFS_IMAGE` coming from
3687 a separate multiconfig, this is meant to be used in addition to :term:`INITRAMFS_DEPLOY_DIR_IMAGE`.
3688
3689 For more information on how to bundle an initramfs image from a separate
3690 multiconfig see the ":ref:`dev-manual/common-tasks:Bundling an Initramfs Image From a Separate Multiconfig`"
3691 section in the Yocto Project Development Tasks Manual.
3692
3676 :term:`INITRAMFS_NAME` 3693 :term:`INITRAMFS_NAME`
3677 The base name of the initial RAM filesystem image. This variable is 3694 The base name of the initial RAM filesystem image. This variable is
3678 set in the ``meta/classes/kernel-artifact-names.bbclass`` file as 3695 set in the ``meta/classes/kernel-artifact-names.bbclass`` file as