Building Your Embedded System with Yocto

Yocto is an open-source community that helps developers create customized systems based on the Linux kernel by providing templates, tools, and methods. It supports ARM, PPC, MIPS, and x86 (32 & 64 bit) hardware architectures. It assists developers in creating Linux-based custom systems designed specifically for embedded products, regardless of the hardware architecture of the product. The Yocto Project provides a flexible toolkit and development environment, allowing embedded device developers worldwide to collaborate by sharing technologies, software stacks, configurations, and best practices for creating these custom Linux images.

First, we need to focus on several terms related to the Yocto project; understanding these will be very helpful for our learning of the Yocto project.

01

Poky

Poky has two meanings. The first meaning refers to the build system used to construct Linux. It is important to note that Poky is merely a concept and not an entity: it includes the BitBake tool, the compilation toolchain, BSPs, and various packages or layers. One can consider Poky to be the essence of Yocto; in addition, the default reference Linux distribution obtained using the Poky system is also called Poky (of course, we can name this distribution as we wish). The two meanings of Poky must not be confused.

02

Metadata Set

The metadata set is arranged in layers, allowing each layer to provide separate functionality for the layers below it. The base layer is OpenEmbedded-Core or oe-core, which provides all common recipes, classes, and related functionalities necessary for building projects. You can customize the build by adding new layers on top of oe-core.

OpenEmbedded-Core is jointly maintained by the Yocto Project and the OpenEmbedded project. The layer that separates the Yocto Project from OpenEmbedded is the meta-yocto layer, which provides Poky distribution configurations and a set of core reference BSPs.

The OpenEmbedded project itself is an independent open-source project with recipes (mostly) that can be exchanged with the Yocto Project and similar goals, but the two have different governance and scope.

03

Board Support Package

BSP includes the essential packages and drivers required to build Linux for a specific board or architecture. This is typically maintained by the hardware manufacturer of the board. BSP serves as the interface between the Linux operating system and the hardware it runs on. Note that you can also create a BSP for virtual machines.

04

BitBake

BitBake is a build engine. It reads recipes and closely monitors them by fetching packages, building them, and incorporating the results into a bootable image. BitBake is jointly maintained by the Yocto Project and the OpenEmbedded project.

Building Your Embedded System with Yocto

In summary: if we compare building a distribution to preparing a feast, then Yocto is the restaurant name, Poky is the kitchen (along with the reference dish combinations provided), Metadata is the cooking resources (.bb/.bbappend represent recipes/tips on recipes, .conf represents the head chef in the kitchen), Layers are the classifications of recipes (like Sichuan cuisine, Cantonese cuisine), BitBake is the chef, and Output is the feast that is prepared.

Introduction to Yocto Project Development Environment

Building Your Embedded System with Yocto
Developers specify architecture, policies, patches, and configuration details.
The build system fetches and downloads the source code from the specified location. The build system supports standard methods, such as tarballs or source code repository systems like Git.
After downloading the source code, the build system extracts the sources into a local workspace to apply patches and runs the common steps for configuring and compiling the software.
Then, the build system installs the software into a temporary staging area, where the binary package format you choose (DEB, RPM, or IPK) is used to aggregate the software.
Throughout the build process, various QA and integrity checks are performed.
After creating the binaries, the build system generates binary package sources for creating the final root file system image.
The build system generates file system images and a custom extensible SDK (eSDSK) for parallel application development.

After introducing so many concepts, you might feel a bit dizzy; why not try out some hands-on practice? The commands are simple, just use git (patience is required, as you will need to wait for the download process).

$ git clone git://git.yoctoproject.org/poky

$ cd poky

$ git checkout -b zeus origin/zeus

If you need more reference information, you can visit the following website.

https://www.yoctoproject.org/docs/3.0.2/overview-manual/overview-manual.html

Author: Xu Xiong

Leave a Comment