How it works...

When adding content to a new software layer, we need to keep in mind that our layer needs to play well with other layers in the Yocto project. To this end, when customizing recipes, we will always use append files, and will only override existing recipes if we are completely sure there is no way to add the customization required through an append file.

To help us manage the content across several layers, we can use the following bitbake-layers command-line utilities:

  • $ bitbake-layers show-layers: This will display the configured layers as BitBake sees them. It is helpful to detect errors on your conf/bblayer.conf file.
  • $ bitbake-layers show-recipes: This command will display all the available recipes and the layers that provide them. It can be used to verify that BitBake is seeing your newly created recipe. If it does not appear, verify that the filesystem hierarchy corresponds to the one defined in your layer's BBFILES variable in conf/layer.conf.
  • $ bitbake-layers show-overlayed: This command will show all the recipes that are overlayed by another recipe with the same name but in a higher priority layer. It helps detect recipe clashes.
  • $ bitbake-layers show-appends: This command will list all available append files and the recipe files they apply to. It can be used to verify that BitBake is seeing your append files. Also, as before with recipes, if they don't appear, you will need to check the filesystem hierarchy and your layer's BBFILES variable.
  • $ bitbake-layers flatten <output_dir>: This command will create a directory with the contents of all configured layers, without overlayed recipes and with all the append files applied. This is how BitBake will see the metadata. This flattened directory is useful to discover conflicts with your layer's metadata.
  • $ bitbake-layers show-cross-depends: This command will show all recipe dependencies across layers, for example recipes with the INHERIT, RRECOMMENDS, DEPENDS, or RDEPENDS variables to recipes from a different layer.

The bitbake-layers command can also be used to add and remove layers to the conf/bblayers.conf file:

  • $ bitbake-layers add-layer </path/to/layer>: This command will add the specified layer path to the BBLAYERS variable in your project's conf/bblayers.conf
  • $ bitbake-layers remove-layer </path/to/layer>: This command will remove the specified layer path from the BBLAYERS variable in your project's conf/bblayers.conf

It can also use the OpenEmbedded Layer Index mentioned previously to automatically fetch and add the layer and its dependencies to your project:

$ bitbake-layers layerindex-fetch <layer name>

Or to just list the layer dependencies from the index:

$ bitbake-layers layerindex-show-depends <layer name>

The new layer will be placed inside the poky layer.

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

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