blog/posts/2013-10-03-learning-openembedded.markdown
2017-06-10 17:43:43 +05:30

56 lines
5.9 KiB
Markdown

---
author: Sanchayan Maity
title: Learning OpenEmbedded
tags: openembedded
---
<p style='text-align: justify;'>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.</p>
<p style='text-align: justify;'>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.</p>
<p style='text-align: justify;'>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.</p>
<p style='text-align: justify;'>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.</p>
<p style='text-align: justify;'>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.</p>
1. **OpenEmbedded Manual**: [http://docs.openembedded.org/usermanual/usermanual.html](http://docs.openembedded.org/usermanual/usermanual.html)
2. **Layers FAQ**: [http://www.openembedded.org/wiki/Layers_FAQ](http://http://www.openembedded.org/wiki/Layers_FAQ)
<p style='text-align: justify;'>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.</p>
3. **Adding a Package**: [http://www.openembedded.org/wiki/I_want_an_image_with_package_XYZ_installed](http://www.openembedded.org/wiki/I_want_an_image_with_package_XYZ_installed)
4. **Layer Index**: [http://layers.openembedded.org/layerindex/branch/master/layers/](http://layers.openembedded.org/layerindex/branch/master/layers/)
<p style='text-align: justify;'>The above link will be very useful for searching for already existing bitbake recipes required for adding packages</p>
5. **Yocto**: [https://www.yoctoproject.org/documentation/current](https://www.yoctoproject.org/documentation/current)
<p style='text-align: justify;'>Has some information you might not find in the OE manual or the OE manual itself links here</p>
6. **Legacy Staging**: [http://www.openembedded.org/wiki/Legacy_staging](http://www.openembedded.org/wiki/Legacy_staging)
<p style='text-align: justify;'>This will be helpful if you have to convert an OE-Classic recipe to OE-Core recipe</p>
7. **BEC Systems**: [http://bec-systems.com/site/](http://bec-systems.com/site/)
<p style='text-align: justify;'>A company website having some more useful information on OpenEmbedded</p>
8. **IRC Chat**: [http://www.openembedded.org/wiki/IRC](http://www.openembedded.org/wiki/IRC)
<p style='text-align: justify;'>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.</p>
9. **Writing Bitbake recipes**:
a. [http://www.multitech.net/developer/products/multiconnect-ocg/development/writing-bitbake-recipes/](http://www.openembedded.org/wiki/How_to_create_a_bitbake_recipe_for_dummies)
b. [http://www.openembedded.org/wiki/How_to_create_a_bitbake_recipe_for_dummies](http://www.openembedded.org/wiki/How_to_create_a_bitbake_recipe_for_dummies)
<p style='text-align: justify;'>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.</p>
<p style='text-align: justify;'>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!</p>