Yocto Main Concepts






Yocto Environment

As mentioned before, Yocto Project is a conjunction of diferent components. The main idea of those components is to provide the user a set of tools and metada able to create a customized Linux based system. The main parts are described on the diagram below:

 
Yocto componets diagram

Concepts

To create a Yocto project there are several concepts the user must understand first before start developing on your platforms.

What is OpenEmbedded?

OpenEmbedded is a build system based on "Poky" which works as a task executor for the system. OpenEmbedded essentially have two components:

BitBake

BitBake is a task execution engine that works through recipe interpreting the metadata to decide, run and execute the tasks. BitBake one the most important components of the Yocto Project, so it required an external maintenance from Yocto Project. There is a completely user manual about BitBake available BitBake User Manual

OpenEmbedded-Core

OpenEmbedded-Core or OE-Core contains the fundamental structure to build Linux-based systems. It is a common layer of metadata composed by classes, recipes and associated files that describes how to fetch, configure, build and package the software. Below is the basic structure of oe-core

├── classes
├── classes-global
├── classes-recipe
├── conf
├── COPYING.MIT
├── files
├── lib
├── recipes-bsp
├── recipes-connectivity
├── recipes-core
├── recipes-devtools
├── recipes-extended
├── recipes-gnome
├── recipes-graphics
├── recipes-kernel
├── recipes-multimedia
├── recipes-rt
├── recipes-sato
├── recipes-support
├── recipes.txt
└── site

What is Metadata?

Metadata is the most basic data able to provide information about other data. The metadata is formed by instructions, definitions of values and modifications building files such as: configuration files, recipes, classes, etc. Here you can see a simple example of metadata describing a dummy Linux Kernel on the system:

SUMMARY = "Dummy Linux kernel"
DESCRIPTION = "Dummy Linux kernel, to be selected as the preferred \
provider for virtual/kernel to satisfy dependencies for situations \
where you wish to build the kernel externally from the build system."
SECTION = "kernel"

What is a recipe?

Recipes one of the most important parts of BitBake, which are files with the extension .bb. A recipe represents the most basic metadata file providing: descriptive information, dependencies, sources code fetching route, patches, configuration and compiling source code.

Here you can see an example:

DESCRIPTION = "Hello World"
PN = 'printhello'
PV = '1'

python do_build() {
   bb.plain("*  Hello, World!   *");
}

What is a Meta Layer?

A Meta-Layer is a group of recipes, which are usually organized by categories depending on its functionality. The meta-layers follow the syntax meta-<layername>. On Poky project you can find the following meta-layers:

tree ~/yocto-test/poky/ -L 1 | grep meta
├── meta
├── meta-poky
├── meta-selftest
├── meta-skeleton
├── meta-yocto-bsp

If you take a look to the meta-layer meta-yocto-bsp you could see this meta-layer contains the recipes associated to the Board Support Package.

poky/meta-yocto-bsp$ tree -L 1 ./
./
├── conf
├── lib
├── README.hardware.md
├── recipes-bsp
├── recipes-graphics
├── recipes-kernel
└── wic