What is OpenEmbedded and how it transforms embedded Linux development

  • OpenEmbedded allows you to create fully customized and reproducible Linux systems for embedded hardware.
  • The Yocto Project uses OpenEmbedded as the core of its build system, facilitating collaboration and maintenance.
  • OpenEmbedded's layered and recipe model provides unique flexibility and scalability in embedded development.
  • An active community and enterprise support ensure long-term updates, documentation, and compatibility.

OpenEmbedded

Have you ever wondered how the Linux systems we find on so many everyday devices are created? From routers, televisions, and smartphones to industrial systems and smart cars: all of them typically run on an embedded Linux distribution specifically tailored to their needs. Behind this adaptation process are projects like OpenEmbedded and the Yocto Project, authentic key pieces in the world of embedded software.

In this article, you'll learn in depth what OpenEmbedded is, how it relates to the Yocto Project, and why it's so important in the development of smart electronic devices. We'll also walk you through its core components, advantages, key concepts, and how it has revolutionized the development of custom Linux systems for specific hardware.

What is OpenEmbedded?

OpenEmbedded is a build automation framework and cross-compiling environment used to create Linux distributions for embedded devices. It was formally created in 2003 by the OpenEmbedded community. The main mission of this environment is simplify the entire task of building Linux operating system images tailored to the specific needs of the hardware to be used.

This compilation system relies on files called recipes (recipes), managed through the tool bitbake. These recipes specify How each software package is compiled, its dependencies, what code to download, and how to integrate it in the final image.

OpenEmbedded allows you to generate binaries for a multitude of architectures and package the resulting software in the most recognized formats (ipk, deb, rpm), as well as produce boot images ready for use on the target board. This makes it the recommended build system for the Yocto Project, with which it collaborates very closely.

How are OpenEmbedded and Yocto Project related?

The Yocto Project is a collaborative open source initiative driven by the Linux Foundation since 2010, whose goal is to facilitate the creation of customized and optimized Linux operating systems for embedded and IoT devices. Although many people think of Yocto as a Linux distribution, it's actually a set of tools that allow you to build these distributions from scratch, completely customized.

The collaboration between both projects is reflected in that Yocto Project uses OpenEmbedded as a build engineThe core parts of the OpenEmbedded build system (BitBake and OpenEmbedded-Core) are maintained jointly by both projects. In addition, Yocto provides a reference implementation called Poky, which includes the OpenEmbedded build system along with a set of recipes and layers ready to be customized.

Thus, when a company or developer wants to create a specific Linux distribution for their product, Yocto and OpenEmbedded provide the tools, workflow, and flexibility needed to create something unique, reproducible, and maintainable..

Key components: BitBake, Poky, layers and recipes

To understand how OpenEmbedded (and, by extension, Yocto) actually works, it is essential to know its main elements:

  • BitBake: It's the build engine that interprets recipes, resolves dependencies, and executes tasks to generate the final image. It works similarly to other automation tools like Make, but is geared toward the world of embedded systems and offers outstanding flexibility.
  • Poke: This is the reference distribution provided by Yocto. It's not a final production system, but rather a starting point (a working example) that can be adjusted and expanded by adding new layers and recipes.
  • OpenEmbedded-Core (OE-Core): It represents the core of validated metadata and recipes, common to multiple systems and derived distributions. It provides a fundamental collection of shared definitions, classes, and configurations.
  • Recipes: Each recipe describes how to build a package or component: where to download it, how to compile it, what patches to apply, and how to install it.
  • Layers: They are collections of related recipes or metadata. Thanks to the layer model, it is possible to isolate information (for example, one layer for the GUI, another for drivers, another for applications, etc.), facilitating reuse and customization.

The layered model: collaboration and customization at the highest level

One of the great achievements of OpenEmbedded and Yocto is their layer-based development modelThis system allows:

  • To collaborate easily, as multiple teams can work on independent layers (drivers, middleware, applications, etc.) and combine them according to the needs of the project.
  • Customize now the entire system by isolating the logic of each subsystem. For example, we often find a specific layer for distribution configuration (distro layer), others for support for specific boards (BSP layers), and additional layers for applications, graphical interfaces, middleware, etc.
  • Avoid conflicts and simplify maintenance: Layers can overwrite or supplement instructions from lower layers, resulting in much more efficient management.

Thanks to this approach, developers can reuse community-created layers or customize them to suit the needs of each product.

What is OpenEmbedded/Yocto used for? Real-world uses

Both OpenEmbedded and Yocto Project are used in a huge variety of fields and products., for example:

  • Industrial robotics
  • Automotive (infotainment, control units, ADAS systems, etc.)
  • Dispositivos medicos
  • Smart appliances
  • IoT Gateways
  • Consumer electronics (televisions, routers, set-top boxes, etc.)
  • Telecommunications equipment
  • Access control systems and advanced home automation

Companies such as Intel, ARM, NXP, Seeed Studio, iWave Systems and many more are actively collaborating in the development and maintenance of OpenEmbedded and Yocto. The ecosystem is so broad and well-documented that today there are tens of millions of devices running distributions generated with these tools.

What are the main advantages of OpenEmbedded?

OpenEmbedded and its integration with the Yocto Project offer a number of powerful advantages for embedded development:

  • Extreme customization: It is possible to generate Linux distributions perfectly tailored to the desired hardware and functionality, eliminating unnecessary components and optimizing resources.
  • Cross-platform flexibility: They support multiple CPU architectures (ARM, x86/x64, PowerPC, MIPS…) and allow the same workflow to be adapted to different devices.
  • Reproducibility and version control: The entire build process is versionable and reproducible. It ensures that the entire development team builds the same image, providing security and facilitating continuous integration (CI/CD).
  • Active community and business support: The tools have a very active global community, as well as the support of major companies. There are LTS branches with long-term support, frequent updates, and constant evolution.
  • Custom license management: The system facilitates the management, auditing, and documentation of the licenses used in each image or package, allowing the creation of custom manifests.

Ultimately, OpenEmbedded is one of the most powerful and scalable solutions for embedded projects of any size.

Additional components and support tools

In addition to the core elements mentioned above, both Yocto and OpenEmbedded integrate or allow the addition of:

  • Toaster: Web interface for BitBake and OpenEmbedded, ideal for configuring, launching builds, and viewing statistics.
  • CROPS: Docker container-based framework, which facilitates cross-development on different operating systems (Windows, Linux, Mac OS).
  • Extensible SDK (eSDK): It allows you to develop custom applications and test them on the target hardware itself, facilitating integration with the generated image.
  • QEMU Support: It is possible to emulate target architectures without the need for physical hardware thanks to QEMU.
  • Validation and testing tools: Integration of automated tests, regressions, and integrity checks for each build.
eos 2024
Related article:
Embedded Open Source Summit 2024 (EOSS 2024): What to see in this new edition of the event?

The basic workflow using OpenEmbedded and Yocto

The typical process for creating a custom Linux image using these tools can be summarized as follows:

  1. Define the architecture, policies and configurations in the project files.
  2. Download source code and the required resources (tarballs, git repositories, etc.).
  3. Apply patches and process sources in an isolated environment.
  4. Compile the software and package the binaries in the selected format (deb, rpm, ipk).
  5. Run quality controls (sanity/regression tests) and generate reports.
  6. Create the root file system and boot images to load on the target device.

Thanks to the great flexibility of the system and the organization by layers, You can reuse large parts of your work for other projects, easily update images, or incorporate new features without having to rebuild the entire system from scratch..

Glossary of common concepts

  • Recipes: They define how a given software is compiled and packaged. They are stored in layers and can inherit or overwrite information from previous recipes.
  • Layers: They group related recipes, classes, and configurations. They are hierarchical and facilitate modularity.
  • Metadata: Files that describe recipes, configurations, and all the information needed to build the image. They include instructions on which versions to use, which patches to apply, dependencies, and so on.
  • Poke: Reference distribution included in Yocto, ideal for having a functional starting point.
  • BitBake: Main build tool. Processes recipes and executes the entire workflow.
  • BSP (Board Support Package): A set of software and recipes specific to a specific board or architecture.

How to get started with OpenEmbedded and Yocto?

The first step is to have a Linux PC, sufficient storage capacity (more than 80 GB free) and several CPU cores. Ubuntu or Debian are recommended for compatibility, although other distributions are also supported. You can also run it in a virtual machine or with WSL on Windows, although performance will be lower.

The usual thing is to download the reference Pokey, clone the necessary layers (for example, meta-raspberry if you want to work with a Raspberry Pi), add or modify the appropriate recipes, and launch the compilation with BitBake. Once the image is generated, it's burned to the target device's storage or card, and after booting the computer, we have our customized distribution ready.

Some challenges and considerations

Although the range of advantages is enormous, it must be considered that the learning curve can be steep if you have no prior knowledge of Linux, scripting, Bash, or cross-compiling. Additionally, the build process is resource-intensive (RAM, CPU, disk) and can take a long time.

However, once the basics are understood, The possibilities for customization and optimization are enormous, you can automate image integration and updates, audit license usage, create binary package feeds, and ensure true scalability across development teams.

Today, both OpenEmbedded and the Yocto Project represent the foundation upon which most modern embedded Linux systems are built. They allow a set of hardware and software requirements to be transformed into a fully customized, optimized, and ready-to-use operating system for any electronic device, from a small sensor to an industrial power plant or a connected vehicle.