How to Write Own Package for Recipe in Arago Project Build

tiovx-app-host error on arago yocto project on cunstom AM57xx board

I have added inherit pkgconfig to my recipe and its working fine.

Request for clarification on Yocto inheritance

The learning curve for Yocto is different than other building systems, that's why I understand your confusion. But trust me, this is worth it. Your questions are related to BitBake so I recommend the BitBake User Manual. Just ensure that you're reading the same version as your poky revision.

  1. require and include.

require is similar to include and can be compared to #include from C and C++ just like you have written.
Although generally both of them should be used to add some extensions to a recipe (*.bb) which are common to some amount of recipes (simply - can be reused).
For instance: definitions of paths, custom tasks used by couple recipes. The common purpose is to make recipe cleaner and separate some constants for re-usage.

The very important thing -> difference between include and require (from BitBake manual):

The include directive does not produce an error when the file cannot be found. Consequently, it is recommended that if the file you are including is expected to exist, you should use require instead of include. Doing so makes sure that an error is produced if the file cannot be found.

As a result: when you include a file to *.bb and it hasn't been found, the BitBake will not raise an error during parsing this recipe.
If you would use require, the error will be raised. You should use require when the pointed file must exist because it contains important variables/tasks that are mandatory to process.


  1. *.bbappend mechanism.

In the case of *.bbappend - it's very powerful. The typical usage is whey you are adding some custom modifications to the recipe from other layer (located above layer where original recipe is) by *.bbappend because (e.g): you are not the maintainer of original recipe or the modifications are only used in your project (then it should be located in your meta-layer). But you can also bbappend the recipe on the same layer. BitBake parses all layers and then 'creates' an output and executes it. More in chapter Execution from BitBake man.


  1. inherit.

The inherit mechanism can be used to inherit *.bbclass where common tasks for some specific purpose are defined so you don't need to write them on your own, e.g: you use inherit cmake or inherit autotools to your recipe when it needs to provide output for sources that are built correspondingly by CMake (and you have CMakeLists.txt defined) or autotools (Makefile.am etc.).
The definitions of classes provided by OpenEmbedded are located under /meta/classes/ if you are using Yocto release with poky.
You can check them and you will see that for example autotools.bbclass has defined (among others) task: autotools_do_configure() so you don't need to write it from the scratch.
However, you can redefine it in your recipe (by just providing your own definition of this function). If the recipe can't be changed, then you can simply create a *.bbappend file and write your own function do_configure() which will override the function from *.bbclass. Just like in OO languages such as C++ or Java.

including python in openembedded

If you have already got an openembedded project running, in arago-oe-dev project, the arago-oe-dev/recipes/ directory includes python.

Then you need to include python into your own dependency tree of recipes. Normally on the top level of dependency tree is the "Images" recipe in which you define what are included into you embedded firmware image to be running on your embedded device.

In the .bb file of "Images" recipe, you normally find a variable of IMAGE_INSTALL. You can add your app recipe into IMAGE_INSTALL.

Then in your recipe of you app, in its .bb file, you should add python to something like "RDEPENDS_${PN}" to add it to run-level dependency. Don't forget to inherit the pkgconfig bbclass so that the runtime linking is properly managed. Then the python library (.h and .so or .a files) will be built into your firmware image in something link /usr/lib and /urs/incluce and be linked by the embedded apps you develope.

Building gstreamer using Yocto

You may add just

IMAGE_INSTALL_append += "gstreamer"

Long answer is that you should add the package name that usually stored in PN recipe variable. You may read about PN variable here. Package names may also be managed with PACKAGES variable.



Related Topics



Leave a reply



Submit