#systems #yocto-project

Why the Yocto Project Was Created: OpenEmbedded and Poky

Why did embedded Linux developers need the Yocto Project when they already had OpenEmbedded and Poky? The answer lies in what they could build together.

Mathieu Hadjimegrian Mathieu Hadjimegrian 7 min

In the early 2000s, before smartphones became commonplace, people carried pocket computers called personal digital assistants, or PDAs. You could use one to keep a diary, look up a contact or jot down a note with a stylus. Sharp made a family of these devices called the Zaurus. One model, the Zaurus SL-5000D, shipped with Linux. For the developers who wanted to improve its software, the first question was therefore not how to get Linux running. Sharp had already done that.

Sharp Zaurus SL-5500G
A Sharp Zaurus SL-5500G, a Linux handheld from the same family as the SL-5000D.

The difficulty came when they wanted to change the software, then use those changes on another device. Two handhelds might need different kernels to drive their screens but exactly the same library to display a PNG image. If someone worked out how to compile that library for one handheld, why should the owner of the other have to work it out again?

That question first brought developers together around OpenEmbedded. A second question, several years later, helped bring the Yocto Project into existence: who would do the work of maintaining and testing that shared software, especially when the companies relying on it were competitors?

From the Zaurus to OpenEmbedded

The OpenZaurus community set out to improve the software supplied with the Sharp handheld. As developers added packages and support for other devices, the instructions for building them became valuable in their own right. The useful thing to share was more than a compiled binary: a binary built for one processor might not run on another. The instructions for fetching the source, applying a fix and building it with the right compiler often travelled better.

Around 2003, that idea took shape in OpenEmbedded. Contributors described components in files called recipes: where to find the source, which other components it required and how to build it. A separate tool, BitBake, read those instructions and worked out which tasks had to run before others. If an application needed a library, its developer did not have to write a second set of instructions for building that library.

OpenEmbedded could now serve several distributions. But a recipe working on one contributor’s machine was no guarantee that a change to it worked on everyone else’s. As the collection grew, choosing a set of components that worked well together, and keeping them working, became a substantial job.

Did OpenEmbedded and Poky merge?

Poky started as a derivative of OpenEmbedded. OpenedHand, a British software company, needed a dependable platform on which to test Matchbox, its window manager for small devices. As Rudolf J. Streif recounts in Embedded Linux Systems with the Yocto Project, OpenedHand built Poky for its own use. It took a selection of OpenEmbedded components and provided example system images that developers could adapt. If you were working on a window manager, that meant you could spend the morning testing what happened when a window opened on a small screen, rather than putting together a Linux system on which to open it.

Intel acquired OpenedHand in 2008. Poky gave it a promising starting point for supporting more embedded hardware, but that ambition posed a problem no build tool could fix. Why would another chip maker lend engineers to a platform whose direction appeared to be in Intel’s hands?

Why the Linux Foundation mattered

The Linux Foundation offered a place where companies could participate without putting a competitor in charge. At meetings convened by the Foundation, Richard Purdie proposed that companies and community developers pool the engineering work they already had in common. In October 2010, the Foundation announced the Yocto Project. Its first public release, 0.9, drew on Poky. The aim was to give teams building products on different chip architectures a common set of tools, while leaving them free to ship different systems.

The agreement with OpenEmbedded came after the launch. Community developers had good reason to ask what an industry-backed project would mean for work they had maintained for years. In March 2011, the Foundation announced that the projects would align their technology and include OpenEmbedded representatives in Yocto Project governance.

The practical result was OpenEmbedded-Core, usually shortened to OE-Core: a shared collection of foundational recipes and build rules. Consider a fix to the way a common library was compiled. While Poky and OpenEmbedded carried separate copies of the recipe, someone had to notice the fix in one and bring it across to the other. With a shared recipe, the two projects could review and maintain the fix in one place. That is what the “merger” amounted to for a developer. OpenEmbedded continued as a project in its own right.

Poky grew out of OpenEmbedded. In 2011, OpenEmbedded and the Yocto Project agreed to maintain a common set of recipes and build rules: OE-Core.

What actually runs on the device?

When an engineer says a board “runs Yocto”, two machines have been compressed into one sentence. On the build machine, the OpenEmbedded Build System uses BitBake, OE-Core and the team’s own recipes and configuration to compile software and assemble an image. On the target board, a bootloader loads the Linux kernel; the system then starts the services and applications selected for that image. The board does not need BitBake to run them.

The Yocto Project is therefore neither the operating system on the board nor the name of a single build tool. It is the collaboration, hosted by the Linux Foundation, that develops and tests this way of building custom Linux systems together with OpenEmbedded. Poky still has a specific role: it is the project’s reference distribution, a working example and a configuration against which the tools can be tested.

Who benefits from sharing the build?

Take a board supplier whose customers make two very different products: a touchscreen control panel and a headless data logger. Both need a kernel that recognises the board’s storage and network hardware. Only one needs the graphical software for a touchscreen.

The supplier can maintain its board-specific configuration in a layer: a collection of related recipes and settings. Each customer can use that layer and keep its own product choices separately. When the supplier fixes a storage driver, both teams can pick up the change and test it on their devices. The logger team never has to take the control panel’s graphical stack, and the supplier does not have to maintain either customer’s application.

That division of work is the reason the history matters. The Yocto Project did not ask competing manufacturers to agree on what an embedded Linux product should look like. It gave them a practical reason to maintain together the parts on which they already agreed.

Inside the Yocto ecosystem: layers, BitBake and developer tools

Open a Yocto build environment and you can see the division of work we have just traced. Run bitbake-layers show-layers and you can see whose build instructions are in use: the common meta layer from OE-Core, perhaps a board support layer from a hardware supplier, and a layer such as meta-logger maintained by the product team. Here meta means metadata: the recipes, configuration and shared rules that describe how to build the system.

A layer and a package group answer different questions. Enabling a layer makes its recipes available to BitBake; it does not install everything in that layer on the device. A package group, on the other hand, lets a team select related packages together. The logger team might define packagegroup-logger-diagnostics for its factory image. The factory and production builds could then use exactly the same layers, but only the factory image would request that group of tools.

BitBake connects these choices. A recipe (.bb) can describe how to build a component. An append file (.bbappend) lets the product team adapt that recipe from its own layer, without copying the supplier’s version. When asked to build an image, BitBake reads the active metadata and works out which tasks depend on which others: the target libraries must be ready before the logger application can link against them; the required packages must exist before the root filesystem can be assembled.

Where does the application developer fit in? A software development kit (SDK) provides a cross-compiler and the target headers and libraries needed to build the application on a workstation. When the job is to change a component already integrated into the system, devtool provides a different starting point. It can open the component’s sources in a workspace with the existing patches applied, rebuild the change and help save it back into the team’s layer. It works alongside BitBake in the build environment and is also part of the extensible SDK.

BitBake reads recipes and configuration from the enabled layers on the build host. The board runs the resulting Linux system.

In the next article, we’ll follow one change through that ecosystem: find the layer that supplies a recipe, use devtool to modify its source, then inspect what lands in the product layer. The test will be whether a colleague can build the change from that layer without needing the original developer’s workspace.

Sources and further reading