Book Image

Embedded Linux Development with Yocto Project

Book Image

Embedded Linux Development with Yocto Project

Overview of this book

Table of Contents (22 chapters)
Embedded Linux Development with Yocto Project
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
References
Index

Working with metadata


The syntax used by BitBake metadata may be misleading, which can sometimes be hard to trace. We can check the value of each variable we want using the environment option (-e or --environment) of BitBake, for example:

$: bitbake -e <recipe> | grep <variable>

In order to understand how BitBake works in more detail, please refer to the BitBake User Manual.

In the following sections, we will see most of the syntaxes commonly used in recipes.

The basic variable setting

The assignment of a variable can be done as shown:

FOO = "bar"

In the preceding example, the value of the variable FOO is bar.

The variable assignment is core to the BitBake metadata syntax as most other examples are performed using variables.

Variable expansion

BitBake supports variable referencing. The syntax closely resembles Shell Script, for example:

A = "aval"
B = "pre${A}post"

This results in A containing aval and B containing preavalpost. One important thing to bear in mind is that the variable only...