Skip to content

Yocto

yoctoproject.org

What is Yocto?

The Yocto Project is an open-source collaboration project focused on developing tools and processes for creating custom Linux distributions for embedded and IoT devices. It provides a flexible framework for embedded developers worldwide to share technologies, software stacks, configurations, and best practices.

Key Components

  • OpenEmbedded: A framework for embedded Linux development, comprising OpenEmbedded-Core (OE-Core), metadata containing metadata files, basic recipes, and classes.
  • BitBake: A build tool used by the OpenEmbedded build system to construct complete Linux images.
  • Poky: A pre-configured build environment with a variety of metadata, serving as an integration layer over OE-Core and ensuring a basic distro infrastructure for customizations.

Goals and Benefits

The Yocto Project aims to:

  • Produce tools and processes for creating Linux distributions for embedded and IoT software, independent of the underlying architecture of the embedded hardware.
  • Empower developers to create Linux distributions tailored to unique needs, helping solutions stand out in the market.
  • Provide a flexible and customizable platform for embedded engineers, allowing them to create separate distributions for specific requirements.

In summary, the Yocto Project is an open-source initiative that enables developers to create custom Linux distributions for embedded and IoT devices, offering a toolbox for customization and flexibility.

PetaLinux

PetaLinux is a set of high level commands that are built on top of the Yocto Linux distribution. PetaLinux tools allow you to customize, build, and deploy Embedded Linux solutions/Linux images for Xilinx processing systems. It is tailored to accelerate design productivity, and works with the Xilinx hardware design tools (like Vivado) to ease the development of Linux systems for Zynq® UltraScale+™ MPSoC, Zynq®-7000 SoCs, and MicroBlaze™.

Basically, it is a set of simplified commands that can be used to quickly and easily make custom Linux systems/images for Xilinx boards!

Key Elements

PetaLinux consists of three primary components: 1. Pre-configured binary bootable images: Ready-to-use Linux images for specific hardware platforms. 2. Fully customizable Linux: Allows developers to tailor the Linux kernel and user space to their specific requirements. 3. PetaLinux tools: A suite of utilities for building, testing, and deploying embedded Linux systems.

PetaLinux Tools

The PetaLinux tools provide a streamlined development experience, enabling developers to:

  • Package and distribute software components for easy installation and use
  • Deploy and boot software elements to physical hardware or the included QEMU system emulator
  • Boot AMD-based hardware in about 5 minutes after installation, ready for application, library, and driver development

In Summary

PetaLinux is a software development kit (SDK) that simplifies the process of building, developing, testing, and deploying embedded Linux systems. It is designed for Xilinx Zynq chips and MicroBlaze FPGA-based designs, providing a comprehensive toolkit for developers to create custom Linux solutions.

Editing the image

PetaLinux uses recipes to perform tasks. For example, if you wanted to generate a devicetree, normally you would need to complete a series of different steps to do this (Download the source, import the XSA file... etc.). These steps can be combined and run as a single 'devicetree' recipe in PetaLinux.

The recipes are built using Bitbake. It will check if the recipes are dependent on each other/other tasks and distribute the build tasks appropriately. Users can pass information to Bitbake via the local.conf file in the conf folder.

PetaLinux recipes are also organised into Layers.

A number of standard recipes are used to create an image in PetaLinux. However, if you want to customise an image, you cannot directly modify a recipe or a PetaLinux build directory.

This is because, due to the tools-flow, the recipes and directories are overwritten every time you rebuild the project, so any changes will be lost. Instead, you must create something called a ‘recipe append’. This is simply a file which contains all requested modifications to the standard recipes. The system checks the ‘recipe appends’ at build time and uses them to modify the image, as shown in the diagram below: