It is possible to customize image contents by using variables from your
local configuration in your conf/local.conf
file.
Because it is limited to local use, this method generally only allows you to
add packages and is not as flexible as creating your own customized image.
When you add packages using local variables this way, you need to realize that
these variable changes affect all images at the same time and might not be
what you require.
The simplest way to add extra packages to all images is by using the
IMAGE_INSTALL
variable with the _append
operator:
IMAGE_INSTALL_append = " strace"
Use of the syntax is important.
Specifically, the space between the quote and the package name, which is
strace
in this example.
This space is required since the _append
operator does not add the space.
Furthermore, you must use _append
instead of the +=
operator if you want to avoid ordering issues.
The reason for this is because doing so unconditionally appends to the variable and
avoids ordering problems due to the variable being set in image recipes and
.bbclass
files with operators like ?=
.
Using _append
ensures the operation takes affect.
As shown in its simplest use, IMAGE_INSTALL_append
affects
all images.
It is possible to extend the syntax so that the variable applies to a specific image only.
Here is an example:
IMAGE_INSTALL_append_pn-core-image-minimal = " strace"
This example adds strace
to core-image-minimal
only.
You can add packages using a similar approach through the
CORE_IMAGE_EXTRA_INSTALL
variable.
If you use this variable, only core-image-*
images are affected.