WORKDIR in a yocto recipe
Asked Answered
M

3

14

When I open bitbake files (ending with .bb extension), most of the files are using the WORKDIR variable as shown below.

S = "${WORKDIR}/git" 

can you please tell me where this WORKDIR is defined.

Modie answered 3/3, 2015 at 9:5 Comment(0)
C
10

The default value of ${WORKDIR} is defined in bitbake variables. But you can change it in the recipe. It points toward the directory where bitbake unpacks the package

You can get the value of ${WORKDIR} from the bitbake environment

bitbake -e <recipe-name> | grep ^WORKDIR=

For a specific recipe, you can get all the variables' value by getting an environment file as:

bitbake -e recipe_name > env
Crossly answered 7/3, 2018 at 14:7 Comment(0)
A
13

From the Yocto Project Reference Manual

WORKDIR

The pathname of the work directory in which the OpenEmbedded build system builds a recipe. This directory is located within the TMPDIR directory structure and is specific to the recipe being built and the system for which it is being built.

The WORKDIR directory is defined as follows:

    ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}

The actual directory depends on several things:

   TMPDIR: The top-level build output directory
   MULTIMACH_TARGET_SYS: The target system identifier
   PN: The recipe name
   EXTENDPE: The epoch - (if PE is not specified, which is usually the >case for most recipes, then EXTENDPE is blank)
   PV: The recipe version
   PR: The recipe revision

As an example, assume a Source Directory top-level folder name poky, a default Build Directory at poky/build, and a qemux86-poky-linux machine target system. Furthermore, suppose your recipe is named foo_1.3.0-r0.bb. In this case, the work directory the build system uses to build the package would be as follows:

    poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0

http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#var-WORKDIR

${TMPDIR} will be the folder named "tmp" within your Yocto build directory.

Allpowerful answered 12/7, 2016 at 20:53 Comment(0)
C
10

The default value of ${WORKDIR} is defined in bitbake variables. But you can change it in the recipe. It points toward the directory where bitbake unpacks the package

You can get the value of ${WORKDIR} from the bitbake environment

bitbake -e <recipe-name> | grep ^WORKDIR=

For a specific recipe, you can get all the variables' value by getting an environment file as:

bitbake -e recipe_name > env
Crossly answered 7/3, 2018 at 14:7 Comment(0)
M
1

WORKDIR is definied in the following files.

bitbake/conf/bitbake.conf
oe-core/meta/conf/bitbake.conf
Modie answered 3/3, 2015 at 12:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.