During a build, the unpacked temporary source code used by recipes
to build packages is available in the Build Directory as
defined by the
S
variable.
Below is the default value for the S
variable as defined in the
meta/conf/bitbake.conf
configuration file in the
Source Directory:
S = "${WORKDIR}/${BP}"
You should be aware that many recipes override the S
variable.
For example, recipes that fetch their source from Git usually set
S
to ${WORKDIR}/git
.
BP
represents the base recipe name, which consists of the name and version:
BP = "${BPN}-${PV}"
The path to the work directory for the recipe
(WORKDIR
) depends
on the recipe name and the architecture of the target device.
For example, here is the work directory for recipes and resulting packages that are
not device-dependent:
${TMPDIR}/work/${PACKAGE_ARCH}-poky-${TARGET_OS}/${PN}/${EXTENDPE}${PV}-${PR}
Let's look at an example without variables.
Assuming a top-level Source Directory
named poky
and a default Build Directory of poky/build
,
the following is the work directory for the acl
recipe that
creates the acl
package:
poky/build/tmp/work/i586-poky-linux/acl/2.2.51-r3/
If your resulting package is dependent on the target device, the work directory varies slightly:
${TMPDIR}/work/${MACHINE}-poky-${TARGET_OS}/${PN}/${EXTENDPE}${PV}-${PR}
Again, assuming top-level Source Directory named poky
and a default Build Directory of poky/build
, the
following are the work and temporary source directories, respectively,
for the acl
package that is being
built for a MIPS-based device:
poky/build/tmp/work/mips-poky-linux/acl/2.2.51-r2 poky/build/tmp/work/mips-poky-linux/acl/2.2.51-r2/acl-2.2.51
WORKDIR
,
TMPDIR
,
TOPDIR
,
PACKAGE_ARCH
,
MULTIMACH_TARGET_SYS
,
TARGET_OS
,
PN
,
PV
,
EXTENDPE
,
and
PR
variables in the Yocto Project Reference Manual.
Now that you know where to locate the directory that has the temporary source code, you can use a Quilt or Git workflow to make your edits, test the changes, and preserve the changes in the form of patches.