
Written by David Soulsby
Senior Consultant
A comprehensive guide to choosing between PetaLinux and Yocto for your embedded Linux platform development.
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.
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.
References
-
UG1144 PetaLinux Tools Documentation: Reference Guide, 13th November 2024, Xilinx https://docs.amd.com/r/en-US/ug1144-PetaLinux-tools-reference-guide/Introduction
-
Yocto Project Wiki: Main Page, accessed 8th April 2025 https://wiki.yoctoproject.org/wiki/Main_Page
-
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
-
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
-
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/
-
Yocto Project Technical Overview, accessed 8th April 2025, Yocto Project https://www.yoctoproject.org/development/technical-overview/
-
Yocto Project Overview and Concepts Manual, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/overview-manual/index.html
-
BitBake User Manual, dev 3.2, Yocto Project https://docs.yoctoproject.org/bitbake/
-
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
-
Yocto Project Development Tasks Manual: Creating Your Own Distribution, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/dev-manual/custom-distribution.html
-
Yocto Project Reference Manual, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/ref-manual/index.html
-
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
-
GitHub Xilinx: gen-machine-conf, accessed 10th April 2025, Xilinx https://github.com/Xilinx/gen-machine-conf/blob/main/README.md
-
Yocto Project Quick Build, Styhead 5.1.999, Yocto Project https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html
-
NIST NVD Vulnerabilities Search, accessed 14th April 2025 https://nvd.nist.gov/vuln/search
-
Yocto Project Development Tasks Manual: Checking for Vulnerabilities, Styhead 5.1.4, Yocto Project https://docs.yoctoproject.org/dev/dev-manual/vulnerabilities.html
-
yocto-metrics, accessed 14th April 2025 https://autobuilder.yocto.io/pub/non-release/patchmetrics/