To accomplish a multiple configuration build, you must
define each target's configuration separately using
a parallel configuration file in the
Build Directory,
and you must follow a required file hierarchy.
Additionally, you must enable the multiple configuration
builds in your local.conf
file.
Follow these steps to set up and execute multiple configuration builds:
Create Separate Configuration Files:
You need to create a single configuration file for
each build target (each multiconfig).
Minimally, each configuration file must define the
machine and the temporary directory BitBake uses
for the build.
Suggested practice dictates that you do not
overlap the temporary directories
used during the builds.
However, it is possible that you can share the
temporary directory
(TMPDIR
).
For example, consider a scenario with two
different multiconfigs for the same
MACHINE
: "qemux86" built for
two distributions such as "poky" and "poky-lsb".
In this case, you might want to use the same
TMPDIR
.
Here is an example showing the minimal
statements needed in a configuration file for
a "qemux86" target whose temporary build directory
is tmpmultix86
:
MACHINE="qemux86" TMPDIR="${TOPDIR}/tmpmultix86"
The location for these multiconfig
configuration files is specific.
They must reside in the current build directory in
a sub-directory of conf
named
multiconfig
.
Following is an example that defines two
configuration files for the "x86" and "arm"
multiconfigs:
![]() |
The reason for this required file hierarchy
is because the BBPATH
variable
is not constructed until the layers are parsed.
Consequently, using the configuration file as a
pre-configuration file is not possible unless it is
located in the current working directory.
Add the BitBake Multi-configuration Variable to the Local Configuration File:
Use the
BBMULTICONFIG
variable in your
conf/local.conf
configuration
file to specify each multiconfig.
Continuing with the example from the previous
figure, the BBMULTICONFIG
variable needs to enable two multiconfigs: "x86"
and "arm" by specifying each configuration file:
BBMULTICONFIG = "x86 arm"
Launch BitBake: Use the following BitBake command form to launch the multiple configuration build:
$ bitbake [multiconfig:multiconfigname
:]target
[[[multiconfig:multiconfigname
:]target
] ... ]
For the example in this section, the following command applies:
$ bitbake multiconfig:x86:core-image-minimal multiconfig:arm:core-image-sato
The previous BitBake command builds a
core-image-minimal
image that
is configured through the
x86.conf
configuration file
and builds a core-image-sato
image that is configured through the
arm.conf
configuration file.
TMPDIR
directories, the build
either loads from an existing sstate cache for that
build at the start or builds the object fresh.