In this chapter we will be introduced to the Yocto Project. The main concepts of the project, which are constantly used throughout the book, are discussed here. We will discuss the Yocto Project history, OpenEmbedded, Poky, BitBake, and metadata in brief, so fasten your seat belt and welcome aboard!
"The Yocto Project provides open source, high-quality infrastructure and tools to help developers create their own custom Linux distributions for any hardware architecture, across multiple market segments. The Yocto Project is intended to provide a helpful starting point for developers."
The Yocto Project is an open source collaboration project that provides templates, tools, and methods to help us create custom Linux-based systems for embedded products regardless of the hardware architecture. Being managed by a Linux Foundation fellow, the project remains independent of its member organizations that participate in various ways and provide resources to the project.
It was founded in 2010 as a collaboration of many hardware manufacturers, open source operating systems, vendors, and electronics companies in an effort to reduce their work duplication, provide resources and information catering to both new and experienced users.
Among these resources is OpenEmbedded-Core, the core system component, provided by the OpenEmbedded project.
The Yocto Project is, therefore, a community open source project that aggregates several companies, communities, projects, and tools, gathering people with the same purpose to build Linux-based embedded products; all these components are in the same boat, being driven by its community needs to work together.
To ease our understanding of the duties and outcomes provided by the Yocto Project, we can use the analogy of a computing machine. The input is a set of data that describes what we want, that is, our specification. As an output, we have the desired Linux-based embedded product.
If the output is a product running a Linux-based operating system, the result generated is the pieces that compose the operating system, such as the Linux kernel, bootloader, and the root filesystem (
rootfs) bundle which are properly organized.
To produce the resultant
rootfs bundle and other deliverables, the Yocto Project's tools are present in all intermediary steps. The reuse of previously built utilities and other software components are maximized while building other applications, libraries, and any other software components in the right order and with the desired configuration, including the fetching of the required source code from their respective repositories, such as The Linux Kernel Archives (www.kernel.org), GitHub, and www.SourceForge.net.
The Yocto Project's tools prepare its own build environment, utilities, and toolchain, reducing the amount of host software dependency. A subtle but important implication is that the determinism is considerably increased as the utilities and their versions as well as their configuration options are the same, thus minimizing the number of host utilities to rely on and producing the same result independent of the host Linux distribution being used.
We can list some projects, such as Poky, BitBake, and OpenEmbedded-Core, under the Yocto Project umbrella, all of them being complementary and playing specific roles in the system. We will understand exactly how they work together in this chapter and throughout the book.
Poky is the Yocto Project reference system and is composed of a collection of tools and metadata. It is platform-independent and performs cross-compiling, using the BitBake tool, OpenEmbedded Core, and a default set of metadata, as shown in the following figure. It provides the mechanism to build and combine thousands of distributed open source projects to form a fully customizable, complete, and coherent Linux software stack.
Poky's main objective is to provide all the features an embedded developer needs.
It evaluates all available configuration files and recipe data (known as metadata), managing dynamic variable expansion, dependencies, and code generation. It keeps track of all tasks being processed in order to ensure completion, maximizing the use of processing resources to reduce build time and being predictable. The development of BitBake is centralized in the
firstname.lastname@example.org mailing list, and its code can be found in the
bitbake subdirectory of Poky.
The OpenEmbedded-Core metadata collection provides the engine of the Poky build tool. It is designed to provide the core features and to be as lean as possible. It provides support for seven different processor architectures (ARM, ARM64, x86, x86-64, PowerPC, MIPS, and MIPS64), supporting only boards to be emulated by QEMU.
The development is centralized in the
email@example.com mailing list and houses its metadata inside the
meta subdirectory of Poky.
The metadata which is composed of a mix of Python and Shell Script text files, provides a tremendously flexible system. Poky uses this to extend OpenEmbedded-Core and includes two different layers, which are another metadata subsets shown as follows:
meta-poky: This layer provides the default and supported distributions, visual branding, and metadata tracking information (maintainers, upstream status, and so on)
meta-yocto-bsp: Provides the Board Support Package (BSP) used as the reference for the Yocto Project development and Quality Assurance (QA) process
Chapter 8, Developing with Yocto Projects, explores the metadata in more detail and serves as a reference when we write our own recipes.
The OpenEmbedded project was created around January 2003 when some core developers from the OpenZaurus project started to work with the new build system. The OpenEmbedded build system has been, since its beginning, a task scheduler inspired and based on the Gentoo Portage package system named BitBake. The project has grown its software collection and supported machine set at a fast pace.
As consequence of uncoordinated development, it was difficult to use OpenEmbedded in products that demand a more stable and polished code base, which is why Poky was born. Poky started as a subset of OpenEmbedded and had a more polished and stable code base across a limited set of architectures. Its reduced size allowed Poky to start to develop highlighting technologies, such as IDE plugins and QEMU integration, which are still being used today.
Around November 2010, the Yocto Project was announced by the Linux Foundation to continue this work under a Linux Foundation-sponsored project. The Yocto Project and OpenEmbedded Project consolidated their efforts on a core build system called OpenEmbedded-Core, using the best of both Poky and OpenEmbedded, thus emphasizing an increased use of additional components, metadata, and subsets.
This first chapter provided an overview of how the OpenEmbedded Project is related to the Yocto Project, the components which form Poky, and how it was created. In the next chapter, we will be introduced to the Poky workflow with steps to download, configure, and prepare the Poky build environment, and how to have the very first image built and running using QEMU.