Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bitbake: how does the build system choose the recipe provided by more than one layer

The meta layer provide recipe:

meta/recipes-graphics/x11-common/xserver-nodm-init.bb 

The meta-oe layer provide recipe:

meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb

My question is:

How the build system select the xserver-nodm-init from the multi-layers?

Does it select the xserver-nodm-init recipe according to the layers order in conf/bblayers?

like image 726
dudengke Avatar asked May 12 '16 05:05

dudengke


People also ask

What is a BitBake recipe?

BitBake recipes specify how a particular package is built. Recipes consist of the source URL (http, https, ftp, cvs, svn, git, local file system) of the package, dependencies and compile or install options. They also store the metadata for the package in standard variables.

What are BitBake-layers?

The openembedded-core layer provides a utility tool called bitbake-layers, which performs actions associated with layers. It allows you to perform actions including the following: see the list of actual layers taken into account in your configuration. add existing layers to your configuration.

How does Yocto build work?

The Yocto build system basically comprises recipes, layers, and configuration files that are parsed by the Bitbake tool to produce a Linux file system image that can later be run on the target hardware. Recipes are the most common file type in a Yocto build description.

How do you add layers to Yocto?

In order to enable your layer you need to add the layer's path to the BBLAYERS variable in the conf/bblayers. conf file which is found on the build directory. Please note that you will need to add your layer to each build directory in which you want to use it.


1 Answers

Layer priority (BBFILE_PRIORITY) and recipe version number (PV, often automated from filename) will decide which recipe is used. The recipe in higher priority layer will be used even if the recipe version in that layer is lower, so the version numbers should only matter if the layer priorities are the same.

In your case the recipe in meta/ has no explicit version number: PV defaults to 1.0.

You can use bitbake-layers show-layers to see the priorities of all your layers, and e.g. bitbake -e <recipe> | grep ^PV to check which version actually got selected for the recipe. To override a "wrong" selection of a specific recipe you can use PREFERRED_VERSION_<recipe> = <version> in your distro or local configuration.

like image 100
Jussi Kukkonen Avatar answered Oct 02 '22 19:10

Jussi Kukkonen