Preparing the build environment
Inside the poky
directory exists a script named oe-init-build-env
, which sets up the building environment. But first, the script must be run-sourced (not executed) as follows:
$ source oe-init-build-env [build-directory]
Here, [build-directory]
is an optional parameter for the name of the directory where the environment is configured. If it is empty, it defaults to build
. The [build-directory]
parameter is the place where we perform the builds.
The output from source oe-init-build-env build
displays some important configurations such as the file location, some project URLs, and some common targets, such as available images. The following figure shows an output example:
Figure 2.2 – Output of the source oe-init-build-env build command
It is very convenient to use different build directories. We can work on separate projects in parallel or experimental setups without affecting our other builds.
Note
Throughout the book, we will use build
as the build directory. When we need to point to a file inside the build directory, we will adopt the same convention – for example, build/conf/local.conf
.