Home Articles Yocto or PetaLinux?

David Soulsby Senior Consultant
Written by David Soulsby

Senior Consultant

A comprehensive guide to choosing between PetaLinux and Yocto for your embedded Linux platform development.

Introduction

PetaLinux [1] and Yocto [2] are both build tools for creating custom embedded Linux platforms. Recently, I got into a discussion with a colleague as to which to use for an embedded Linux project. Given PetaLinux simplifies to some degree the complexities of Yocto, my colleague’s initial instinct was to use PetaLinux. However, I have on occasion bumped into the limitations of PetaLinux. This got me thinking that a comparison of the two would make for an interesting article.

It’s worth noting that PetaLinux was created by Xilinx, which has now been purchased by AMD [3]. At the time of writing the support forums and documentation hosting have moved over to AMD. But the Xilinx wiki lives on, and it seems unlikely that the APIs and code will have all their Xilinx references removed (function names beginning with X or Xil for example). I’ll continue to refer to Xilinx throughout this article as we are talking about the Xilinx part of the AMD portfolio.

Target Hardware and Applications

PetaLinux is targeted at designs involving a Field Programmable Gate Array (FPGA), for example a FPGA-based System-on-Chip (SoC), and implies the use of Xilinx hardware.

FPGAs are integrated circuits that can be reprogrammed for different tasks, they excel at high performance applications. Meanwhile SoCs package Central Processor Units (CPUs), memory, I/O ports, and other specialised processing units (like FPGAs) onto a single chip. The benefits of SoCs are they allow for smaller, lighter and more power efficient solutions.

The benefit of a SoC that includes an FPGA is that you have the benefits of a general-purpose processor (for example access to existing software platforms such as Linux and everything that comes with it), and a reprogrammable integrated circuit that can be used to execute high performance specialised tasks.

At Plextek we specialise in low size, weight and power (SWaP) solutions and often find ourselves utilising SoCs.

Yocto

Yocto is a set of build tools for creating embedded Linux operating systems. Broadly speaking Yocto also encapsulates the poky reference distribution and components from the OpenEmbedded project [6] [7]. The key components for the purpose of this discussion are:

  1. Distributions
  2. Layers
  3. BitBake

A distribution (typically abbreviated to distro) is a Linux based operating system. Yocto has a reference distribution called “poky” that has a set of image definitions you can use as a starting point.

A layer is a set of software components that can be added to your Yocto project. A Yocto project consists of a number of layers:

  • Base layers (such poky and OpenEmbedded)
  • Device specific layers (such as meta-xilinx)
  • Layers that fulfil dependencies for your applications (e.g. if you needed libmetal then meta-openamp would fulfil this requirement)
  • Project specific layers (such as board support and software)

Yocto makes use of the OpenEmbedded BitBake tool [8] for its build engine. You will be using the “bitbake” command line tool on a day-to-day basis for a Yocto project. BitBake is a generic task execution engine, which runs tasks written in shell script and Python. Essentially, it allows you to build packages (software components) and images (deployable files).

PetaLinux

PetaLinux is a set of tools that utilises many of the same underlying tools as Yocto, and as such can be seen as a wrapper for Yocto (although this is a simplification).

The first thing to note is that there are actually a few things called “PetaLinux”:

  • A set of tools (a sort of Yocto wrapper)
  • A reference distro
  • A meta layer (meta-petalinux)

The PetaLinux set of tools includes the meta-petalinux layer, which defines the PetaLinux distribution. Xilinx provide quick start packages for boards (e.g. Xilinx ZCU102 etc) which can be fed into the petalinux-create command. This gets you a usable image for a reference board within a couple of commands.

The focus of PetaLinux is on getting you as a developer up and running with a development system as quickly as possible. This allows you to focus on specific elements, for example an FPGA and the software on the processor that utilises it.

Moving from PetaLinux to Yocto

If you start out with a PetaLinux project and wish to move to Yocto, there are a couple of ways of doing this. They are not zero effort however, and there are some issues to bear in mind.

Migration Script

There is a migration script which you can use to migrate from PetaLinux to Yocto. However, the Xilinx wiki page entry on performing this operation [4] states that it only works for 2021.1 to 2022.2 Xilinx versions. We’ve had mixed success with this approach; you won’t always get a usable build when it produces something and other times, you’ll just get nothing out. This is particularly the case when using the migration script on a version of PetaLinux that is not supported. It may get you most of the way there but expect to complete migration manually.

When the migration script does work, the file structure created is a little different to how you would typically structure a Yocto project, reflecting the PetaLinux folder structure. But this can be rearranged.

Port Across the Key Components

To do this, you’ll need to start out with a vanilla Yocto build (see the Yocto Quick Start page for inspiration [14]). At a minimum you’ll need your FPGA definition (XSA file), and a machine conf for you target hardware (see gen-machine-conf [13]). Then you can start adding the components you need to a new project specific meta layer. You can even include the meta-petalinux layer in your Yocto project and utilise the PetaLinux distro if that is what you require.

It can be time consuming. It’s best to create your own image definition, even if based on a pre-existing one. You’ll need this for adding your components and their dependencies to the build. It can also take a while to make sure you have all the relevant build configurations copied across to Yocto and they won’t necessarily be set in the same place.

System Requirements

The minimum system requirements for a PetaLinux and a Yocto project are essentially the same [1][11]:

PetaLinux Yocto
2Mhz CPU Clock, 8 cores 4 CPU cores
8GB RAM 8GB RAM
100GB Disk Space 90GB Disk Space

The similarity between the two is perhaps not surprising given that much of the underlying build system uses many of the same components.

However, it is worth noting that by default PetaLinux deletes all the intermediate build files once the build output is produced, in theory saving a bit of disk space.

Additionally, I would suggest that most Yocto projects would take up more than 90GB of disk space.

Comparison

  • Build Output

    The build output is effectively the same, e.g. boot image and rootfs.

  • Command Line Tools

    As a Yocto developer you will be using the BitBake tool to build recipes and images, but for PetaLinux you will be using the petalinux-* set of commands [9]. The petalinux-* commands are a higher-level abstraction of BitBake commands and therefore not all options are available (for example the ability to generate a dependency tree for a package). However, many operations are duplicated between each command set and Xilinx provide a cross reference on their Wiki page [12].

  • Complexity

    There is a steep learning curve to build with Yocto, and PetaLinux attempts to get you to a useable output quicker.

  • Xilinx Workflow Integration

    The Xilinx workflows (e.g. Vivado, Vitis, etc) are geared towards using PetaLinux.

Which to Choose?

This really comes down to if you need to productise your Linux platform. If you need to productise the platform then you will need to use Yocto; we’ll cover the reasons why in the next section. If you are developing components, or a platform which will not need productising, and do not already have Yocto expertise then PetaLinux is likely to be the place to start.

PetaLinux does give you the option to dip your toe in, which is useful if you don’t have much experience. If you’re using a SOM then the reference design provided by the board manufacturer is a good place to start, even if you end up porting to Yocto afterwards. We find more often than not that reference designs are provided as PetaLinux projects.

The Why: Productisation

Ultimately PetaLinux is not intended for productisation and therefore lacks some key ingredients; it does not support SELinux (a mechanism for implementing security polices) and has no mechanism for security updates. Meanwhile, Yocto allows you to create your own distro.

Security Updates

A Common Vulnerability and Exposure (CVE) is a security flaw that has been listed on a publicly accessible catalogue. Yocto CVEs reference the NIST NVD CVE database where each CVE has its own unique ID [15]. At a high level you can look at the poky/OpenEmbedded-Core CVEs by release on the yocto-metrics page [17].

A Yocto project can take advantage of the cve-check feature to check for CVEs at build time. It is also possible to use BitBake to check for CVEs on a certain package. Yocto has a process that you can follow to apply patches for CVEs, and the cve-check feature can note CVEs as patched based on the commit information [16].

Distro

The PetaLinux (set of tools) comes with a PetaLinux distribution. Likewise, Yocto comes with a reference distribution called poky. But just using Yocto is not the full answer here, as poky is just that, a reference, and should be replaced with your own distribution for products. This is further evidenced by the latest versions of poky giving the following warning:

“Poky is a reference Yocto Project distribution that should be used for testing and development purposes only. It is recommended that you create your own distribution for production use.”

 

Broadly speaking there are two key reasons why you would want your own distribution [10]:

  1. Reducing the attack surface: Poky enables most hardware and software features leaving a broad attack surface from a security perspective
  2. Greater control over configuration:
    1. Package alternative selections
    2. Compile-time options
    3. Low-level configurations

You can create your own distribution with Yocto.


Plextek’s Projects

Plextek has worked on a number of embedded Linux platforms over the years, including the follow projects:

  • Foreign Object Detection (FOD) Radar
  • Ground Penetrating Radar (GPR)
  • Smart Cities Base station
  • Prototype hand-held scanner

They do indeed follow the pattern of prototypes using PetaLinux and products using Yocto.


Summary

In summary, if you’re not productising your device or you’re just developing the FPGA, then PetaLinux is a good candidate. But you need to be aware of its limitations if you do want to productise at a later date. If you are already familiar with Yocto then starting with Yocto from the beginning, even for a prototype project, will put you in good stead going forward. Yocto is an absolute must when you intend to productise your device, particularly in terms of security.

TI mmWave Radar circuit board

Got a project?

If you need help with any PetaLinux or Yocto based projects, then please get in touch.

We’d love to hear from you.

Yocto or PetaLinux
Yocto or PetaLinux?

Our comprehensive comparison of PetaLinux and Yocto, focusing on system requirements, build engines, and build outputs for developing embedded systems.

Kevin Cobley discussing 5G and the role of Non-Terrestrial Networks
The Future of Connectivity: 5G, 6G, and Space-Based Networks

As industries push the boundaries of global connectivity, the integration of 5G and drive towards 6G with satellite and space-based networks is unlocking new opportunities. Kevin Cobley, an expert in this evolving field, shares his insights on the challenges and innovations shaping the future of non-terrestrial networks (NTN).

Enhancing communication and safety in mining: the role of custom RF system design

We explore the role of custom RF system design in communication and safety within the mining industry, ensuring robust data handling and operational efficiency in challenging conditions.

Evolving silicon choices in the AI age
Evolving silicon choices in the AI age

How do you choose? We explore the complexities and evolution of processing silicon choices in the AI era, from CPUs and GPUs to the rise of TPUs and NPUs for efficient artificial intelligence model implementation.

A visual representation of: A Programmer's Introduction to Processing Imaging Radar Data
A Programmer’s Introduction to Processing Imaging Radar Data

A practical guide for programmers on processing imaging radar data, featuring example Python code and a detailed exploration of a millimetre-wave radar's data processing pipeline.

A visual representation of: AI Gesture Control
AI Gesture Control

Exploring the possibilities of AI gesture control for household appliances and more, using privacy-preserving radar technology, underscoring innovation in smart home interactions.

A visual representation of: Repurposing Innovation Bullet Proof Your Wine
Repurposing Innovation: Bullet Proof Your Wine

Repurposing military-grade technology to safeguard fine wines, ensuring their pristine condition from bottling to cellar.

A visual representation of: Of mice and ships
Calculating Error: What do a brain and a ship have in common?

Analysing the commonalities between brain function and ship steering through error correction methods, highlighting the indispensable role of calculus in both biological and engineered control systems.


References

  1. UG1144 PetaLinux Tools Documentation: Reference Guide, 13th November 2024, Xilinx https://docs.amd.com/r/en-US/ug1144-PetaLinux-tools-reference-guide/Introduction
  2. Yocto Project Wiki: Main Page, accessed 8th April 2025 https://wiki.yoctoproject.org/wiki/Main_Page
  3. AMD Newsroom: AMD Completes Acquisition of Xilinx, accessed 8th April 2025 https://www.amd.com/en/newsroom/press-releases/2022-2-14-amd-completes-acquisition-of-xilinx.html
  4. Xilinx Wiki: Migrate from PetaLinux project to Yocto project, last updated 14th July 2024 https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/757891119/Migrate+from+PetaLinux+project+to+Yocto+project
  5. Plextek Projects: mmWave Radar for Foreign Object Debris Detection, accessed 8th April 2025 https://www.plextek.com/projects/mmwave-radar-for-foreign-object-debris-detection/
  6. Yocto Project Technical Overview, accessed 8th April 2025, Yocto Project https://www.yoctoproject.org/development/technical-overview/
  7. Yocto Project Overview and Concepts Manual, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/overview-manual/index.html
  8. BitBake User Manual, dev 3.2, Yocto Project https://docs.yoctoproject.org/bitbake/
  9. UG1157 PetaLinux Tools Documentation: Command Line Guide, 30th October 2019, Xilinx https://docs.amd.com/v/u/en-US/ug1157-petalinux-tools-command-line-guide
  10. Yocto Project Development Tasks Manual: Creating Your Own Distribution, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/dev-manual/custom-distribution.html
  11. Yocto Project Reference Manual, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/ref-manual/index.html
  12. Xilinx Wiki: PetaLinux to Yocto – Command Cross Reference, last updated 31 January 2025, Xilinx https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/2787311617/PetaLinux+to+Yocto+-+Command+Cross+Reference
  13. GitHub Xilinx: gen-machine-conf, accessed 10th April 2025, Xilinx https://github.com/Xilinx/gen-machine-conf/blob/main/README.md
  14. Yocto Project Quick Build, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html
  15. NIST NVD Vulnerabilities Search, accessed 14th April 2025 https://nvd.nist.gov/vuln/search
  16. Yocto Project Development Tasks Manual: Checking for Vulnerabilities, Styhead 5.1.4, Yocto Project https://docs.yoctoproject.org/dev/dev-manual/vulnerabilities.html
  17. yocto-metrics, accessed 14th April 2025 https://autobuilder.yocto.io/pub/non-release/patchmetrics/