1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

dev-manual: Moved "Building Targets with Multiple Configurations"

This is a "building" topic.  I moved it beneath the new parent
"building" section.

(From yocto-docs rev: 0426f0dd6871c8063476945b93743ffc5cfc0856)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark
2018-05-16 14:34:11 -07:00
committed by Richard Purdie
parent cbda3472e3
commit 5c5a8e3d34
@@ -5320,114 +5320,113 @@
</orderedlist> </orderedlist>
</para> </para>
</section> </section>
</section>
<section id='platdev-building-targets-with-multiple-configurations'>
<title>Building Targets with Multiple Configurations</title>
<para>
Bitbake also has functionality that allows you to build
multiple targets at the same time, where each target uses
a different configuration.
</para>
<para>
In order to accomplish this, you setup each of the configurations
you need to use in parallel by placing the configuration files in
your current build directory alongside the usual
<filename>local.conf</filename> file.
</para>
<para>
Follow these guidelines to create an environment that supports
multiple configurations:
<section id='platdev-building-targets-with-multiple-configurations'> <itemizedlist>
<title>Building Targets with Multiple Configurations</title> <listitem><para>
<emphasis>Create Configuration Files</emphasis>:
<para> You need to create a single configuration file for each
Bitbake also has functionality that allows you to build configuration for which you want to add support.
multiple targets at the same time, where each target uses These files would contain lines such as the following:
a different configuration. <literallayout class='monospaced'>
</para>
<para>
In order to accomplish this, you setup each of the configurations
you need to use in parallel by placing the configuration files in
your current build directory alongside the usual
<filename>local.conf</filename> file.
</para>
<para>
Follow these guidelines to create an environment that supports
multiple configurations:
<itemizedlist>
<listitem><para>
<emphasis>Create Configuration Files</emphasis>:
You need to create a single configuration file for each
configuration for which you want to add support.
These files would contain lines such as the following:
<literallayout class='monospaced'>
MACHINE = "A" MACHINE = "A"
</literallayout> </literallayout>
The files would contain any other variables that can The files would contain any other variables that can
be set and built in the same directory. be set and built in the same directory.
<note> <note>
You can change the You can change the
<ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
to not conflict. to not conflict.
</note></para> </note></para>
<para> <para>
Furthermore, the configuration file must be located in the Furthermore, the configuration file must be located in the
current build directory in a directory named current build directory in a directory named
<filename>multiconfig</filename> under the build's <filename>multiconfig</filename> under the build's
<filename>conf</filename> directory where <filename>conf</filename> directory where
<filename>local.conf</filename> resides. <filename>local.conf</filename> resides.
The reason for this restriction is because the The reason for this restriction is because the
<filename>BBPATH</filename> variable is not constructed <filename>BBPATH</filename> variable is not constructed
until the layers are parsed. until the layers are parsed.
Consequently, using the configuration file as a Consequently, using the configuration file as a
pre-configuration file is not possible unless it is pre-configuration file is not possible unless it is
located in the current working directory. located in the current working directory.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<emphasis>Add the BitBake Multi-Config Variable to you Local Configuration File</emphasis>: <emphasis>Add the BitBake Multi-Config Variable to you Local Configuration File</emphasis>:
Use the Use the
<filename>BBMULTICONFIG</filename> <filename>BBMULTICONFIG</filename>
variable in your <filename>conf/local.conf</filename> variable in your <filename>conf/local.conf</filename>
configuration file to specify each separate configuration. configuration file to specify each separate configuration.
For example, the following line tells BitBake it should load For example, the following line tells BitBake it should load
<filename>conf/multiconfig/configA.conf</filename>, <filename>conf/multiconfig/configA.conf</filename>,
<filename>conf/multiconfig/configB.conf</filename>, and <filename>conf/multiconfig/configB.conf</filename>, and
<filename>conf/multiconfig/configC.conf</filename>. <filename>conf/multiconfig/configC.conf</filename>.
<literallayout class='monospaced'> <literallayout class='monospaced'>
BBMULTICONFIG = "configA configB configC" BBMULTICONFIG = "configA configB configC"
</literallayout> </literallayout>
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
<emphasis>Launch BitBake</emphasis>: <emphasis>Launch BitBake</emphasis>:
Use the following BitBake command form to launch the Use the following BitBake command form to launch the
build: build:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ bitbake [multiconfig:<replaceable>multiconfigname</replaceable>:]<replaceable>target</replaceable> [[[multiconfig:<replaceable>multiconfigname</replaceable>:]<replaceable>target</replaceable>] ... ] $ bitbake [multiconfig:<replaceable>multiconfigname</replaceable>:]<replaceable>target</replaceable> [[[multiconfig:<replaceable>multiconfigname</replaceable>:]<replaceable>target</replaceable>] ... ]
</literallayout> </literallayout>
Following is an example that supports building a minimal Following is an example that supports building a minimal
image for configuration A alongside a standard image for configuration A alongside a standard
<filename>core-image-sato</filename>, which takes its <filename>core-image-sato</filename>, which takes its
configuration from <filename>local.conf</filename>: configuration from <filename>local.conf</filename>:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ bitbake multiconfig:configA:core-image-minimal core-image-sato $ bitbake multiconfig:configA:core-image-minimal core-image-sato
</literallayout> </literallayout>
</para></listitem> </para></listitem>
</itemizedlist> </itemizedlist>
</para> </para>
<para> <para>
Support for multiple configurations in this current release of Support for multiple configurations in this current release of
the Yocto Project (&DISTRO_NAME; &DISTRO;) has some known issues: the Yocto Project (&DISTRO_NAME; &DISTRO;) has some known issues:
<itemizedlist> <itemizedlist>
<listitem><para> <listitem><para>
No inter-multi-configuration dependencies exist. No inter-multi-configuration dependencies exist.
</para></listitem> </para></listitem>
<listitem><para> <listitem><para>
Shared State (sstate) optimizations do not exist. Shared State (sstate) optimizations do not exist.
Consequently, if the build uses the same object twice Consequently, if the build uses the same object twice
in, for example, two different in, for example, two different
<filename>TMPDIR</filename> directories, the build <filename>TMPDIR</filename> directories, the build
will either load from an existing sstate cache at the will either load from an existing sstate cache at the
start or build the object twice. start or build the object twice.
</para></listitem> </para></listitem>
</itemizedlist> </itemizedlist>
</para> </para>
</section>
</section> </section>
<section id="platdev-working-with-libraries"> <section id="platdev-working-with-libraries">
<title>Working With Libraries</title> <title>Working With Libraries</title>