Once packages are split and stored in the Package Feeds area, the OpenEmbedded build system uses BitBake to generate the root filesystem image:
![]() |
The image generation process consists of several stages and
depends on many variables.
The
do_rootfs
task uses these key variables
to help create the list of packages to actually install:
IMAGE_INSTALL
:
Lists out the base set of packages to install from
the Package Feeds area.
PACKAGE_EXCLUDE
:
Specifies packages that should not be installed.
IMAGE_FEATURES
:
Specifies features to include in the image.
Most of these features map to additional packages for
installation.
PACKAGE_CLASSES
:
Specifies the package backend to use and consequently
helps determine where to locate packages within the
Package Feeds area.
IMAGE_LINGUAS
:
Determines the language(s) for which additional
language support packages are installed.
Package installation is under control of the package manager (e.g. smart/rpm, opkg, or apt/dpkg) regardless of whether or not package management is enabled for the target. At the end of the process, if package management is not enabled for the target, the package manager's data files are deleted from the root filesystem.
During image generation, the build system attempts to run all post-installation scripts. Any that fail to run on the build host are run on the target when the target system is first booted. If you are using a read-only root filesystem, all the post installation scripts must succeed during the package installation phase since the root filesystem is read-only.
During Optimization, optimizing processes are run across
the image.
These processes include mklibs
and
prelink
.
The mklibs
process optimizes the size
of the libraries.
A prelink
process optimizes the dynamic
linking of shared libraries to reduce start up time of
executables.
Along with writing out the root filesystem image, the
do_rootfs
task creates a manifest file
(.manifest
) in the same directory as
the root filesystem image that lists out, line-by-line, the
installed packages.
This manifest file is useful for the
testimage
class, for example, to determine whether or not to run
specific tests.
See the
IMAGE_MANIFEST
variable for additional information.
Part of the image generation process includes compressing the root filesystem image. Compression is accomplished through several optimization routines designed to reduce the overall size of the image.
After the root filesystem has been constructed, the image
generation process turns everything into an image file or
a set of image files.
The formats used for the root filesystem depend on the
IMAGE_FSTYPES
variable.