Learning OpenEmbedded

Posted on October 3, 2013 by Sanchayan Maity
Tags: openembedded

Recently, I was assigned a project for doing a Number Plate Recognition system on NVidia Tegra 2 based Toradex Colibri T20 module. Though the project was put on the sideline just a few days after being assigned due to another high priority task coming my way, I was able to learn how to use OpenEmbedded to some extent. In fact, most of my learning happened in my own spare time. As I was already aware that I would be working on this project, I had started playing around with OE at home and started building the image.

For building images for our modules, my company Toradex uses the oe-core build system. At first, I had no idea how to use it, how to add packages to my image and so on. I was using Arch Linux at first. Now, Arch Linux being a rolling release distribution everything stays up to date. This created it’s own set of problems. Three days I just spend trying to get the initial build going as it was failing for some reason or other. For example, one of the problems I encountered was related to Perl documentation (some POD error) and later gcc4.7.2 just won’t compile and kept segfaulting. On looking up, it turns out it was an Arch Linux issue and to get around this, I would have to upgrade to gcc4.7.8. At that point of time, I had no idea how to resolve this issue. It would have probably been resolved by getting the bitbake recipe for gcc4.7.8 and setting the preferred version in a bitbake recipe to 4.7.8. I didn’t try this out, but, on reading the OE manual much later, I thought that it might have been the solution.

Though I was frustrated during this time, and I was also cursing Arch Linux a bit, these problems made me look at the bitbake recipes, at the source packages and the process of applying patches and trying to fix each issue which use to pop up started giving me an idea at what was going on. I started appreciating Arch Linux. But of course I couldn’t do this everyday. I installed Linux Mint XFCE version and started the procedure again.

This time the process was going smoothly and when the errors did come, I was able to resolve them quickly as I knew what I had to change in the bitbake recipe to get the build going. For example a checksum error halted the build. All that had to be done, was change the checksum in the bitbake recipe to the one that was being computed.

Anyways, this was my story of playing with OE and it’s now time to share the links which will help you in learning OpenEmbedded. First step, have a look at a few of the bitbake recipes and try to understand as much as you can. After that, refer the below links.

  1. OpenEmbedded Manual: http://docs.openembedded.org/usermanual/usermanual.html

  2. Layers FAQ: http://www.openembedded.org/wiki/Layers_FAQ

Read this without fail. I would have saved a lot of time had I understood the concept of layers. Wasted a day’s time trying to find out how to add OpenCV package to my image. If I had understood the above, a lot of time would have been saved.

  1. Adding a Package: http://www.openembedded.org/wiki/I_want_an_image_with_package_XYZ_installed

  2. Layer Index: http://layers.openembedded.org/layerindex/branch/master/layers/

The above link will be very useful for searching for already existing bitbake recipes required for adding packages

  1. Yocto: https://www.yoctoproject.org/documentation/current

Has some information you might not find in the OE manual or the OE manual itself links here

  1. Legacy Staging: http://www.openembedded.org/wiki/Legacy_staging

This will be helpful if you have to convert an OE-Classic recipe to OE-Core recipe

  1. BEC Systems: http://bec-systems.com/site/

A company website having some more useful information on OpenEmbedded

  1. IRC Chat: http://www.openembedded.org/wiki/IRC

Last but not the list, you can always use the IRC chat to approach people if you have some specific queries and you can’t find the answers anywhere else. Do thoroughly research the answer to your query using Google and read the documentation before approaching. There will be people more than willing to help you out.

  1. Writing Bitbake recipes:
  1. http://www.multitech.net/developer/products/multiconnect-ocg/development/writing-bitbake-recipes/

  2. http://www.openembedded.org/wiki/How_to_create_a_bitbake_recipe_for_dummies

Well this is the last now for sure. I have put this in the last as most probably you won’t have to write a recipe. There are already recipes available for thousands of various software packages which you can use. You can search for them in the layer index link I gave earlier. You can then use those recipes. If they are not already included in the layers you have, you will figure out how to add them by following the documentation above.

Hope these incoherent musings of mine will be of use to you. The post turned out to be longer than I expected, but anyways, have a good time playing with OE and Linux. May the source be with you!