The bitbake
command is the primary interface to the BitBake tool. This chapter presents the bitbake
command syntax and provides several execution examples.
For example, if you want to build a specific recipe, run the following command:
$ bitbake <recipe>
BitBake runs a set of scheduled tasks. When we wish to run a specific task, we can use the following command:
$ bitbake <recipe> -c <task>
If you want to clean a specific package (spitools
, for example), you just have to run this:
$ bitbake spitools -c clean
To list the tasks defined for a recipe, we can use the following command:
$ bitbake <recipe> -c listtasks
Here is a description of BitBake tasks:
WORKDIR
directory.All downloaded content is stored in the download folder (the DL_DIR
variable), so all external source code is cached to avoid redownloading it every time we need the same source.
do_fetch
task is do_unpack
. It is responsible for unpacking source code or checking the requested revision or branch in case the referenced source uses an SCM system.do_patch
task. Every file fetched by do_fetch
that has the .patch
extension is assumed to be a patch to be applied. This task applies the list of required patches.The process of applying a patch uses the S
variable, which points to the source code. The default value used for S
is ${WORKDIR}/${PN}-${PV}, and it is used for the do_patch
, do_configure
, do_compile
, and do_install
tasks.
do_configure
, do_compile
, and do_install
tasks are performed in this order. Some recipes may omit one task or another. It is important to note that the environment variables defined in the tasks are different from one task to another.Tasks vary a lot from one recipe to another. Poky provides a rich collection of predefined tasks in the classes, which ought to be used when possible. For example, when the Autotools
class is inherited by a recipe, it provides a known implementation for the do_configure
, do_compile
, and do_install
tasks.
do_package
task splits the files installed by the recipe into logical components, such as debugging symbols, documentation, and libraries. The do_package
task ensures that files are split up and packaged correctly.One of the most common uses of Poky is the generation of the root filesystem. The rootfs
image should be seen as a ready-to-use root filesystem for a target. The rootfs
is basically a directory with the desired packages installed. The list of packages to be installed into rootfs
is defined by a union of packages listed by IMAGE_INSTALL
and the packages included by IMAGE_FEATURES
.
We will learn more about the process and its contents in Chapter 5 , Creating, Developing, and Deploying on the Raspberry Pi.
3.145.58.169