Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WORKDIR in a yocto recipe

Tags:

yocto

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.

like image 537
user3693586 Avatar asked Mar 03 '15 09:03

user3693586


People also ask

What is Workdir in Yocto?

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.

What does Do_install do in Yocto?

10 do_install. Copies files that are to be packaged into the holding area ${ D } . This task runs with the current working directory set to ${ B } , which is the compilation directory.

How do you add meta layer on Yocto?

We can find them at http://git.yoctoproject.org/ or http://layers.openembedded.org. We can now add a new layer by changing the build/conf/bblayer. conf fileand adding the absolute path to the new meta layer directory, as shown in the following source code. The highlightedlineis the one to be added.


1 Answers

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.

like image 164
javey Avatar answered Oct 01 '22 06:10

javey