How to do it...

While developing, we will use our project's conf/local.conf file to add customizations. To add packages to all images, we can use the following line of code:

IMAGE_INSTALL_append = " htop"  
Note that there is a space after the first quote to separate the new package from the existing ones, as the append operator does not add a space.

We could also limit the addition to a specific image with:

IMAGE_INSTALL_append_pn-core-image-minimal = " htop" 

Another way to easily make customizations is by making use of features. A feature is a logical grouping of packages. For example, we could create a new feature called debug-utils, which will add a whole set of debugging utilities. We could define our feature in a configuration file or class as follows:

FEATURE_PACKAGES_debug-utils = "trace-cmd perf" 

We could then add this feature to our image by adding an EXTRA_IMAGE_FEATURES variable to our conf/local.conf file as follows:

EXTRA_IMAGE_FEATURES += "debug-utils" 

If you were to add it to an image recipe, you would use the IMAGE_FEATURES variable instead.

Usually, features get added as a packagegroup recipe instead of being listed as packages individually. Let's show how to define a packagegroup recipe in the recipes-core/packagegroups/packagegroup-debug-utils.bb file:

SUMMARY = "Debug applications packagegroup" 
 
inherit packagegroup 
 
RDEPENDS_${PN} = "
    trace-cmd   
    perf   
" 

And you would then add it to the FEATURE_PACKAGES variable as follows:

FEATURE_PACKAGES_debug-utils = "packagegroup-debug-utils" 

We can use packagegroups to create more complex examples. Refer to the Yocto Project Development Manual at http://www.yoctoproject.org/docs/2.4/dev-manual/dev-manual.html for details.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset