Probably the easiest way to customize an image is to add a
package by way of the local.conf
configuration 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.
To add a package to your image using the local configuration
file, use 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.