Hooks Guide

Innovative News about IT

Yocto Contribution

Yocto Project

Yocto is a framework for automatically building a custom embedded Linux distribution from source-files. It’s usual features are, downloading, patching, compiling and packaging of software components in order to finally generate a bootable OS image.

Recently I tried to use a Yocto based installation that contains the cinematicexperience demo of the QT framework. It turned out that I had to edit two files on the target to make it work (thanks to Wick Wire). Then I decided that I wanted to add this as bugfix-patch to the meta_qt5 Yocto layer. Here’s what I did. I hope my guide will make it easier others who also want to contribute a change to a Yocto receipe.

Prepare the contribution

Fork the branch in GitHub. Then you can change it and contribute it back automatically (which is one of the central advanatages of GitHub by the way. Sending patches by email is not state-of-the-art anymore.).

I navigated with the internet browser to the project I wanted to contribute to (https://github.com/meta-qt5 in my case). I logged in and pressed the ‘fork’ button. Now I had a personal fork (https://github.com/-yourname-/meta-qt5) whick I could work in to prepare the contribution.

cd …Yocto…/sources/
rm meta-qt5
git clone -b master-next https://github.com/-yourname-/meta-qt5/meta-qt5.git

Prepare the Yocto receipe to apply another patch in it’s build procedure.

cd meta-qt5/recipes-qt/examples
#Create a directory for your patch (if not existing allready) with the name of the .bb file of your component (without the suffix _*.bb)
mkdir cinematicexperience
nano cinematicexperience_1.0.bb

Extend SRC_URI by your patch:

SRC_URI = “http://quitcoding.com/download/Qt5_CinematicExperience_rpi_1.0.tgz \
0001-textON-textOFF-renamed.patch \

Create the patch

To create the patch I decided to pragmatically work directly in the sourcefiles Yocto created during the build process (see Embedded Linux on the Freescale i.mx6 Sabre SD (Yocto, QT 5.3)). In your .bb file (the same as mentioned above) look for the S= variable. Find the folder mentioned in S= (without the ${…} variables) in the Yocto build folder. In my case this was: cd ../../../build find . -name “*Qt5_CinematicExperience_rpi_*”

Support Ukraine against russian fascists! Defend Europe from horde! Glory to Ukraine! 🇺🇦