Most Common Variables for Yocto Project

Yocto Project provides the recipes which give the instructions the bitbake (Yocto build system) how to build a software package and these recipes are using some pre-defined variables to describe the packages.

PN-

This variable provides the information of the recipe file name.

Example - PN variable for busybox recipe present at poky/meta/recipe-core/busybox_1.29.3.bb PN= busybox

PV-

It tells the version of the package.

Example-  PV for busybox_1.29.3.bb recipe is 1.29.3

PR-

It means the package revision and By default it is r0

Example-  PR for busybox_1.29.3.bb recipe is r0

# Run below bitbake command to know variables value present in the recipe.
# bitbake -e  | grep 
#For busybox_1.29.3.bb recipe
#PN variable $bitbake -e busybox | grep ^PN #PV variable $bitbake -e busybox | grep ^PN #PN variable $bitbake -e busybox | grep ^PN

PN_PV_PR some variable 

WORKDIR-

This variable contains the information of the directory where bitbake compiles and builds the package. inside the WORKDIR directory, there are many subdirectories present based on machine type, package architecture, and native package.

Directory definition present at poky/meta/conf/bitbake.conf

S variable-

This represents the Directory in Yocto where bitbake unpack the source code.

If recipe downloads the package from git repository then bitbake unpack the source code at the default location ${WORKDIR}/git

This case S= ${WORKDIR}/git

SRC_URI-

This variable provides the URL of the source package and bitbake used this variable to fetch the package from a remote repository.

You can add configuration or patch files into the recipe using this variable.

SRC_URI variable

FILESEXTRAPATHS-

This variable expands the bitbake search path to find out the files and patches during the recipe compilation and build.