The first stages of building a recipe are to fetch and unpack the source code:
![]() |
The
do_fetch
and
do_unpack
tasks fetch the source files and unpack them into the
Build Directory.
file://
)
that is part of a recipe's
SRC_URI
statement, the OpenEmbedded build system takes a
checksum of the file for the recipe and inserts the
checksum into the signature for the
do_fetch
task.
If any local file has been modified, the
do_fetch
task and all tasks that
depend on it are re-executed.
By default, everything is accomplished in the Build
Directory, which has a defined structure.
For additional general information on the Build Directory,
see the
"build/
"
section in the Yocto Project Reference Manual.
Each recipe has an area in the Build Directory where the
unpacked source code resides.
The
S
variable points to this area for a recipe's unpacked source
code.
The name of that directory for any given recipe is defined
from several different variables.
The preceding figure and the following list describe
the Build Directory's hierarchy:
TMPDIR
:
The base directory where the OpenEmbedded build
system performs all its work during the build.
The default base directory is the
tmp
directory.
PACKAGE_ARCH
:
The architecture of the built package or packages.
Depending on the eventual destination of the
package or packages (i.e. machine architecture,
build host,
SDK, or specific machine),
PACKAGE_ARCH
varies.
See the variable's description for details.
TARGET_OS
:
The operating system of the target device.
A typical value would be "linux" (e.g.
"qemux86-poky-linux").
PN
:
The name of the recipe used to build the package.
This variable can have multiple meanings.
However, when used in the context of input files,
PN
represents the the name
of the recipe.
WORKDIR
:
The location where the OpenEmbedded build system
builds a recipe (i.e. does the work to create the
package).
S
:
Contains the unpacked source files for a given
recipe.
PACKAGE_ARCH
) and one based on a
machine (i.e. MACHINE
).
The underlying structures are identical.
The differentiator being what the OpenEmbedded build
system is using as a build target (e.g. general
architecture, a build host, an SDK, or a specific
machine).