Module 4 · Lesson 99 of 156

Yocto, OpenEmbedded, Poky and the core concepts

Explain how Yocto, OpenEmbedded and Poky relate, and trace how BitBake uses build metadata to produce packages and an image.

  • Beginner to advanced
  • 7 min read
  • 15 min lab
What you will need

Ubuntu 24.04 in WSL2 or a VM and a text editor

Your place in the module
By the end you can 4 objectives
  • Distinguish the Yocto Project, OpenEmbedded, OpenEmbedded-Core and Poky.
  • Identify the roles of recipes, layers and classes in build metadata.
  • Explain how BitBake orders tasks using dependencies.
  • Trace how files from a software recipe reach a root filesystem image.
Video coming soonYocto, OpenEmbedded, Poky and the core concepts
The video for this lesson is being recorded. Read the lesson below in the meantime.
Recall first from The SDK and Buildroot internals
  • The SDK archives the Buildroot host tree, which contains the cross-toolchain and target sysroot.
  • Staging exposes the target sysroot, while target holds the runtime filesystem tree used to generate images.
  • Buildroot turns package declarations into GNU Make rules and records completed package steps with stamps.
01

Yocto, OpenEmbedded and Poky

3 min read

Buildroot is one build system; Yocto is the other, and it is a different mental model. This lesson answers the three names and the core concepts of recipes, layers, classes, images, packages and tasks.

Suppose a gateway needs a small root filesystem for deployment and a diagnostic image for the bench. Both need the same application, but only the bench image needs the diagnostic tools. You might also need the same root filesystem contents in two output formats. A tar archive carries files and their metadata, as tar(1) describes. An ext4 image contains the structures of an ext4 filesystem, as the kernel's ext4 documentation describes. Choosing which software to include and choosing how to represent the resulting filesystem are separate build decisions. Understanding where those decisions are recorded is the reason to distinguish the three names.

The Yocto Project is a collaborative project for building custom Linux-based systems. It develops and maintains tools, documentation and reference components. When someone says that a product “uses Yocto,” they usually mean the team uses this project's build technology to produce and maintain its own system. The name of the project alone tells you little about which board the product supports or what programs are installed on it.

OpenEmbedded is a project and the name of its build framework. The OpenEmbedded build system combines the BitBake execution engine with build metadata. OpenEmbedded-Core, commonly OE-Core, is the shared core metadata maintained in collaboration with the Yocto Project. It provides recipes for common software, classes with reusable build behavior and configuration used across many builds. At this level, includes plain values and executable task definitions.

Poky is the Yocto Project's reference distribution. The name also refers to the integrated reference source tree used in many Yocto examples. That tree combines BitBake, OE-Core and Poky-specific metadata, including the configuration for the Poky distribution. In a clone of the poky repository (branch scarthgap), the top directory holds bitbake/, meta/ (this is OE-Core), meta-poky/ (the Poky distribution policy, with conf/distro/poky.conf), meta-yocto-bsp/ and some sample or test layers. In that file, DISTRO = "poky" and DISTRO_NAME = "Poky (Yocto Project Reference Distro)", and DISTRO_VERSION was 5.0.21 on the day of the check. A product build can use the same BitBake engine and OE-Core metadata with its own distribution policy. When reading instructions, pay attention to whether “Poky” names the reference source tree an engineer starts from or the distribution configuration selected for a build.

Three names in an embedded Linux buildYocto ProjectOpenEmbeddedPokyRoleCollaborativeprojectBuildframeworkReferencedistributionKey materialTools anddocumentationOE-CoremetadataReferenceconfigurationIn a buildProvidesbuildtechnologyDefinescommon buildsIntegratesreferencecomponents
The Yocto Project, OpenEmbedded and Poky have distinct roles in the same build workflow

The difference matters when someone tells you where a change belongs. A problem with scheduling build work concerns BitBake. A change to the shared build description for a common program may concern OE-Core. A default chosen specifically for the Poky reference distribution concerns Poky's configuration. Those distinctions help you identify which changes affect one distribution and which can affect other builds using the same components.

02

Recipes, layers and classes

2 min read

A commonly describes a piece of software. A recipe for a sensor application can identify its source, license and build dependencies, and declare how to configure, compile and install it. The install step here means placing files in a temporary destination on the build host. The files in that destination can then be assigned to packages. Image recipes are also build targets, with metadata that describes the system image to assemble.

A can contain recipes, classes and settings. A hardware support layer can supply board-specific metadata. An application layer can supply the sensor program. A distribution layer can supply policy that applies across multiple components, such as the default init system. A build uses the layers selected in its configuration, so the same application layer can be used alongside different hardware support layers. That arrangement lets product teams maintain application changes and board support independently when the software and its dependencies support both targets.

A layer can also carry a .bbappend file that extends a matching recipe supplied by another layer. For example, a product layer could add a product-specific patch to the sensor recipe supplied by a shared application layer. The original recipe can still describe the normal build, while the product's active metadata supplies the change. Layer organization answers where metadata is maintained and which builds can use it. The recipe answers how a particular target is built.

A can supply shared tasks, settings and defaults. If several recipes build software using CMake, they can inherit the cmake class. The class supplies common behavior for configuring and building CMake projects in the target build environment. Each recipe still supplies its own source and any settings specific to that software. Updating the shared class can affect multiple recipes, which is why the distinction matters when you investigate a build failure common to several components.

Metadata you can find in a layerLayerRecipesDescribe build targetsClassesSupply reusable behaviorConfigurationSupplies build settingsLayerRecipesDescribe build targetsClassesSupply reusable behaviorConfigurationSupplies build settings
Layers organize metadata, recipes describe build targets and classes supply shared behavior
03

How BitBake turns metadata into an image

3 min read

BitBake is the build engine you invoke as bitbake. For a requested target, it reads the configuration and relevant metadata, resolves dependencies and schedules the required instances. A single recipe can have several tasks. For a typical compiled component, do_fetch obtains sources, do_unpack extracts or otherwise prepares the fetched source files, do_compile builds the software and do_install stages the files for packaging. Build behavior can come from the recipe and from the classes it inherits.

Task ordering applies across recipes as well as within a recipe. A sensor application that compiles against a library needs that library's build inputs, such as headers, available before they are used. BitBake schedules the relevant dependency work first. Unrelated tasks can run concurrently when their dependencies permit it. When an error identifies a recipe and a task, the recipe tells you which target was being processed and the task tells you the operation that failed. A failure fetching that application's sources and a failure compiling those sources therefore point to different operations within the same recipe.

A is a build output. A software recipe can produce several packages. A library recipe, for example, can produce a runtime package with the shared library and a development package with headers. The sensor program needs the headers when it is compiled. If it uses that shared library on the target, the installed program needs the runtime library there. The distinction explains how the build can succeed with headers available on the host side while the deployed system contains only the runtime files it needs.

An image is an output representing the assembled system or filesystem in a configured format. An image recipe and its configuration specify which packages to include. During image construction, the build installs the selected packages and their required runtime dependencies into the root filesystem being assembled. It then generates the requested output formats. A package can consequently exist as a build output without its files appearing in a particular image. To explain why a program is missing from a device, establish whether the build produced a package containing the program and whether the image build selected that package directly or through a dependency.

From software build to filesystem outputSoftwaretasksFetch,build andstage filesPackagesGroup filesfor installationRootfilesystemInstallselectedpackagesand dependenciesImageoutputsWriteconfiguredfilesystemformatsSoftwaretasksFetch,build andstage filesPackagesGroup filesfor installationRootfilesystemInstallselectedpackagesand dependenciesImageoutputsWriteconfiguredfilesystemformats
Software tasks produce packages, then image tasks install selected packages and generate filesystem outputs

Return to the two gateway images. Both can select the package containing the sensor program, and both can receive its shared library through a runtime dependency. The bench image can additionally select the diagnostic package. If both builds use the same compatible settings for the sensor program, the same recipe and package can serve both. If the bench image needs to be produced as both a tar archive and an ext4 image, that format choice can be made independently of the decision to include diagnostics.

The next lesson, The first Yocto build and its configuration, uses Poky to show where you select the build settings and how an image target becomes a BitBake invocation.

Key takeaways

  • Poky is the Yocto Project's reference distribution and combines BitBake, OpenEmbedded-Core metadata and Poky-specific configuration.
  • Recipes describe build targets, layers organize metadata and classes share build behavior.
  • BitBake schedules tasks according to dependencies within and across recipes.
  • A software recipe can produce several packages, and the image build installs selected packages and their runtime dependencies.
Reflect
  1. Explain to a colleague, in two sentences: distinguish the Yocto Project, OpenEmbedded, OpenEmbedded-Core and Poky.
  2. Which objective are you least sure about? Re-read that section, then do its exercise in the practice pack.
  3. What surprised you when you ran the commands yourself?
On a real board

Repeat the key commands on your Raspberry Pi or lab board over SSH or the serial console. Note anything that behaves differently from your PC, such as missing tools, a BusyBox shell or a read-only filesystem.

References and further reading

Find your next step

↑ ↓ to move · Enter to open · Esc to close