Introduction to the Yocto Project, Poky, and Bitbake
Yocto Project combines multiple open-source projects that help developers to create custom Linux image for target boards. A Yocto Project provides tools, metadata, and a build framework to create the custom Linux distro for your embedded and IoT devices. It automates the complete build process. Poky is the reference distribution system of the Yocto Project and It contains some metadata, OpenEmbedded core, and Bitbake. Bitbake is a task executor that executes the task according to the recipe.
What are the advantages of the Yocto Project as compare to the other Build tools:
- Yocto Project automates the build process and makes it easy to customize (add, remove, modify ) the packages in Linux Distro.
- It is the most popular and widely used build tool in the semiconductor industry.
- Easy to maintain the layer and recipes.
- A very good training document is present.
In this Yocto tutorial, we are focusing to learn the following topics:
- Overview of the Yocto Project
- Yocto Project Major Component
- Poky Directory Layout
Overview of the Yocto Project:
- It is an open-source project to build a custom Linux OS for target boards. It is a collection of build frameworks (build systems), tools, and metadata. its major components are openEmbedded, Poky, and the Bitbake. Yocto Project supports many different architectures (PowerPC, ARM, x86/64, etc) and hardware platforms.
What are the major components of the Yocto Project:
Yocto Project has collaborated with many other open-source projects to ease developing the custom Linux Image. Its core part is the Poky and OpenEmbedded build system.
- It is the reference distribution of the Yocto Project and it provides an OpenEmbedded build system (Bitbake and OpenEmbedded Core) as well as a set of metadata that helps to create the custom distro.
- Poky =Bitbake + meta data
- It supports as a reference for the following platforms: BeagleBone Black, Raspberry Pi, QEMU (Emulator), and generic x86-64.
- Every six-month Yocto project team releases a new version of poky.
- Download the Poky from the below link:
git clone https://git.yoctoproject.org/git/poky
Downloading Poky for the remote repository
- OpenEmbedded is a build framework that consists of OE-core metadata and Bitbake build engine.
- OE-core is the base layer of the Yocto project and contains a Bitbake layer, recipe, classes, and tools.
- It is the build engine in the Yocto Project.it executes the task according to provided recipes, classes, configuration files, and metadata.
- Bitbake is a python program that takes recipe files (.bb and .bbappend files ) as an input and does the following task –
- Fetch: It downloads the source file from a local or remote repository.
- Unpack: It extracts the source files into the source directory.
- Patch: Apply the patch on the source code.
- Configure: Set the flag for the software being build.
- Build: Compile the source files and generate the executable program.
- Installation: Executable program and other file copy to the target directory.
- Package: Generate the package for the target system according to the chosen package management systems.
Directory Layout of Poky in the Yocto Project:
In the Yocto Project, Directory Structure is very optimized and always follows the same. Poky directory contains meta-directory layers, Bitbake, etc.
poky directory layout
- It is the main part of the OpenEmbedded build system that parses the Recipe and executes the tasks.
- It contains recipes, class, and configuration files for many packages.
- Machine configuration: it tells the information about architecture and which kernel to build.
Yocto recipe layer directory structure
NOTE: Always start the Yocto build process without a root user.