summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/dev-manual-common-tasks.rst
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/dev-manual/dev-manual-common-tasks.rst')
-rw-r--r--documentation/dev-manual/dev-manual-common-tasks.rst76
1 files changed, 36 insertions, 40 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.rst b/documentation/dev-manual/dev-manual-common-tasks.rst
index d401d3b4ee..d1dde6d0f3 100644
--- a/documentation/dev-manual/dev-manual-common-tasks.rst
+++ b/documentation/dev-manual/dev-manual-common-tasks.rst
@@ -2168,7 +2168,7 @@ recipe, but which one? You can configure your build to call out the
2168kernel recipe you want by using the 2168kernel recipe you want by using the
2169:term:`PREFERRED_PROVIDER` 2169:term:`PREFERRED_PROVIDER`
2170variable. As an example, consider the 2170variable. As an example, consider the
2171`x86-base.inc <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/conf/machine/include/x86-base.inc>`_ 2171:yocto_git:`x86-base.inc </cgit/cgit.cgi/poky/tree/meta/conf/machine/include/x86-base.inc>`
2172include file, which is a machine (i.e. 2172include file, which is a machine (i.e.
2173:term:`MACHINE`) configuration file. 2173:term:`MACHINE`) configuration file.
2174This include file is the reason all x86-based machines use the 2174This include file is the reason all x86-based machines use the
@@ -2628,7 +2628,7 @@ Recipe Syntax
2628Understanding recipe file syntax is important for writing recipes. The 2628Understanding recipe file syntax is important for writing recipes. The
2629following list overviews the basic items that make up a BitBake recipe 2629following list overviews the basic items that make up a BitBake recipe
2630file. For more complete BitBake syntax descriptions, see the 2630file. For more complete BitBake syntax descriptions, see the
2631":doc:`bitbake-user-manual/bitbake-user-manual-metadata`" 2631":doc:`bitbake:bitbake-user-manual/bitbake-user-manual-metadata`"
2632chapter of the BitBake User Manual. 2632chapter of the BitBake User Manual.
2633 2633
2634- *Variable Assignments and Manipulations:* Variable assignments allow 2634- *Variable Assignments and Manipulations:* Variable assignments allow
@@ -3854,7 +3854,7 @@ Setting Up and Running a Multiple Configuration Build
3854 3854
3855To accomplish a multiple configuration build, you must define each 3855To accomplish a multiple configuration build, you must define each
3856target's configuration separately using a parallel configuration file in 3856target's configuration separately using a parallel configuration file in
3857the :term:`Build Directory`, and you 3857the :term:`Build Directory` or configuration directory within a layer, and you
3858must follow a required file hierarchy. Additionally, you must enable the 3858must follow a required file hierarchy. Additionally, you must enable the
3859multiple configuration builds in your ``local.conf`` file. 3859multiple configuration builds in your ``local.conf`` file.
3860 3860
@@ -3862,47 +3862,47 @@ Follow these steps to set up and execute multiple configuration builds:
3862 3862
3863- *Create Separate Configuration Files*: You need to create a single 3863- *Create Separate Configuration Files*: You need to create a single
3864 configuration file for each build target (each multiconfig). 3864 configuration file for each build target (each multiconfig).
3865 Minimally, each configuration file must define the machine and the 3865 The configuration definitions are implementation dependent but often
3866 temporary directory BitBake uses for the build. Suggested practice 3866 each configuration file will define the machine and the
3867 dictates that you do not overlap the temporary directories used 3867 temporary directory BitBake uses for the build. Whether the same
3868 during the builds. However, it is possible that you can share the 3868 temporary directory (:term:`TMPDIR`) can be shared will depend on what is
3869 temporary directory 3869 similar and what is different between the configurations. Multiple MACHINE
3870 (:term:`TMPDIR`). For example, 3870 targets can share the same (:term:`TMPDIR`) as long as the rest of the
3871 consider a scenario with two different multiconfigs for the same 3871 configuration is the same, multiple DISTRO settings would need separate
3872 (:term:`TMPDIR`) directories.
3873
3874 For example, consider a scenario with two different multiconfigs for the same
3872 :term:`MACHINE`: "qemux86" built 3875 :term:`MACHINE`: "qemux86" built
3873 for two distributions such as "poky" and "poky-lsb". In this case, 3876 for two distributions such as "poky" and "poky-lsb". In this case,
3874 you might want to use the same ``TMPDIR``. 3877 you would need to use the different :term:`TMPDIR`.
3875 3878
3876 Here is an example showing the minimal statements needed in a 3879 Here is an example showing the minimal statements needed in a
3877 configuration file for a "qemux86" target whose temporary build 3880 configuration file for a "qemux86" target whose temporary build
3878 directory is ``tmpmultix86``: 3881 directory is ``tmpmultix86``::
3879 ::
3880 3882
3881 MACHINE = "qemux86" 3883 MACHINE = "qemux86"
3882 TMPDIR = "${TOPDIR}/tmpmultix86" 3884 TMPDIR = "${TOPDIR}/tmpmultix86"
3883 3885
3884 The location for these multiconfig configuration files is specific. 3886 The location for these multiconfig configuration files is specific.
3885 They must reside in the current build directory in a sub-directory of 3887 They must reside in the current :term:`Build Directory` in a sub-directory of
3886 ``conf`` named ``multiconfig``. Following is an example that defines 3888 ``conf`` named ``multiconfig`` or within a layer's ``conf`` directory
3889 under a directory named ``multiconfig``. Following is an example that defines
3887 two configuration files for the "x86" and "arm" multiconfigs: 3890 two configuration files for the "x86" and "arm" multiconfigs:
3888 3891
3889 .. image:: figures/multiconfig_files.png 3892 .. image:: figures/multiconfig_files.png
3890 :align: center 3893 :align: center
3894 :width: 50%
3891 3895
3892 The reason for this required file hierarchy is because the ``BBPATH`` 3896 The usual :term:`BBPATH` search path is used to locate multiconfig files in
3893 variable is not constructed until the layers are parsed. 3897 a similar way to other conf files.
3894 Consequently, using the configuration file as a pre-configuration
3895 file is not possible unless it is located in the current working
3896 directory.
3897 3898
3898- *Add the BitBake Multi-configuration Variable to the Local 3899- *Add the BitBake Multi-configuration Variable to the Local
3899 Configuration File*: Use the 3900 Configuration File*: Use the
3900 :term:`BBMULTICONFIG` 3901 :term:`BBMULTICONFIG`
3901 variable in your ``conf/local.conf`` configuration file to specify 3902 variable in your ``conf/local.conf`` configuration file to specify
3902 each multiconfig. Continuing with the example from the previous 3903 each multiconfig. Continuing with the example from the previous
3903 figure, the ``BBMULTICONFIG`` variable needs to enable two 3904 figure, the :term:`BBMULTICONFIG` variable needs to enable two
3904 multiconfigs: "x86" and "arm" by specifying each configuration file: 3905 multiconfigs: "x86" and "arm" by specifying each configuration file::
3905 ::
3906 3906
3907 BBMULTICONFIG = "x86 arm" 3907 BBMULTICONFIG = "x86 arm"
3908 3908
@@ -3916,13 +3916,11 @@ Follow these steps to set up and execute multiple configuration builds:
3916 with "". 3916 with "".
3917 3917
3918- *Launch BitBake*: Use the following BitBake command form to launch 3918- *Launch BitBake*: Use the following BitBake command form to launch
3919 the multiple configuration build: 3919 the multiple configuration build::
3920 ::
3921 3920
3922 $ bitbake [mc:multiconfigname:]target [[[mc:multiconfigname:]target] ... ] 3921 $ bitbake [mc:multiconfigname:]target [[[mc:multiconfigname:]target] ... ]
3923 3922
3924 For the example in this section, the following command applies: 3923 For the example in this section, the following command applies::
3925 ::
3926 3924
3927 $ bitbake mc:x86:core-image-minimal mc:arm:core-image-sato mc::core-image-base 3925 $ bitbake mc:x86:core-image-minimal mc:arm:core-image-sato mc::core-image-base
3928 3926
@@ -3937,7 +3935,7 @@ Follow these steps to set up and execute multiple configuration builds:
3937 Support for multiple configuration builds in the Yocto Project &DISTRO; 3935 Support for multiple configuration builds in the Yocto Project &DISTRO;
3938 (&DISTRO_NAME;) Release does not include Shared State (sstate) 3936 (&DISTRO_NAME;) Release does not include Shared State (sstate)
3939 optimizations. Consequently, if a build uses the same object twice 3937 optimizations. Consequently, if a build uses the same object twice
3940 in, for example, two different ``TMPDIR`` 3938 in, for example, two different :term:`TMPDIR`
3941 directories, the build either loads from an existing sstate cache for 3939 directories, the build either loads from an existing sstate cache for
3942 that build at the start or builds the object fresh. 3940 that build at the start or builds the object fresh.
3943 3941
@@ -3958,38 +3956,34 @@ essentially that the
3958 3956
3959To enable dependencies in a multiple configuration build, you must 3957To enable dependencies in a multiple configuration build, you must
3960declare the dependencies in the recipe using the following statement 3958declare the dependencies in the recipe using the following statement
3961form: 3959form::
3962::
3963 3960
3964 task_or_package[mcdepends] = "mc:from_multiconfig:to_multiconfig:recipe_name:task_on_which_to_depend" 3961 task_or_package[mcdepends] = "mc:from_multiconfig:to_multiconfig:recipe_name:task_on_which_to_depend"
3965 3962
3966To better show how to use this statement, consider the example scenario 3963To better show how to use this statement, consider the example scenario
3967from the first paragraph of this section. The following statement needs 3964from the first paragraph of this section. The following statement needs
3968to be added to the recipe that builds the ``core-image-sato`` image: 3965to be added to the recipe that builds the ``core-image-sato`` image::
3969::
3970 3966
3971 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_rootfs" 3967 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_rootfs"
3972 3968
3973In this example, the `from_multiconfig` is "x86". The `to_multiconfig` is "arm". The 3969In this example, the `from_multiconfig` is "x86". The `to_multiconfig` is "arm". The
3974task on which the ``do_image`` task in the recipe depends is the 3970task on which the :ref:`ref-tasks-image` task in the recipe depends is the
3975``do_rootfs`` task from the ``core-image-minimal`` recipe associated 3971:ref:`ref-tasks-rootfs` task from the ``core-image-minimal`` recipe associated
3976with the "arm" multiconfig. 3972with the "arm" multiconfig.
3977 3973
3978Once you set up this dependency, you can build the "x86" multiconfig 3974Once you set up this dependency, you can build the "x86" multiconfig
3979using a BitBake command as follows: 3975using a BitBake command as follows::
3980::
3981 3976
3982 $ bitbake mc:x86:core-image-sato 3977 $ bitbake mc:x86:core-image-sato
3983 3978
3984This command executes all the tasks needed to create the 3979This command executes all the tasks needed to create the
3985``core-image-sato`` image for the "x86" multiconfig. Because of the 3980``core-image-sato`` image for the "x86" multiconfig. Because of the
3986dependency, BitBake also executes through the ``do_rootfs`` task for the 3981dependency, BitBake also executes through the :ref:`ref-tasks-rootfs` task for the
3987"arm" multiconfig build. 3982"arm" multiconfig build.
3988 3983
3989Having a recipe depend on the root filesystem of another build might not 3984Having a recipe depend on the root filesystem of another build might not
3990seem that useful. Consider this change to the statement in the 3985seem that useful. Consider this change to the statement in the
3991``core-image-sato`` recipe: 3986``core-image-sato`` recipe::
3992::
3993 3987
3994 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_image" 3988 do_image[mcdepends] = "mc:x86:arm:core-image-minimal:do_image"
3995 3989
@@ -4967,7 +4961,7 @@ configuration would be as follows:
4967 require conf/multilib.conf 4961 require conf/multilib.conf
4968 MULTILIBS = "multilib:lib32" 4962 MULTILIBS = "multilib:lib32"
4969 DEFAULTTUNE_virtclass-multilib-lib32 = "x86" 4963 DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
4970 IMAGE_INSTALL_append = "lib32-glib-2.0" 4964 IMAGE_INSTALL_append = " lib32-glib-2.0"
4971 4965
4972This example enables an additional library named 4966This example enables an additional library named
4973``lib32`` alongside the normal target packages. When combining these 4967``lib32`` alongside the normal target packages. When combining these
@@ -8658,6 +8652,8 @@ In order to run tests, you need to do the following:
8658 - Be sure to use an absolute path when calling this script 8652 - Be sure to use an absolute path when calling this script
8659 with sudo. 8653 with sudo.
8660 8654
8655 - Ensure that your host has the package ``iptables`` installed.
8656
8661 - The package recipe ``qemu-helper-native`` is required to run 8657 - The package recipe ``qemu-helper-native`` is required to run
8662 this script. Build the package using the following command: 8658 this script. Build the package using the following command:
8663 :: 8659 ::