Yocto investigation with bitbake-getvar
By Urs Fässler
Investigating Yocto issues can be challenging. Yocto employs Bitbake, which heavily relies on variables (lists) that are set, appended, prepended, and modified across several recipes. Other recipes reference these variables to make decisions and modify additional variables.
One particularly troublesome variable is DISTRO_FEATURES
.
Numerous recipes manipulate this variable, and any change typically triggers a rebuild of most packages.
In our case a colleague was missing systemd within DISTRO_FEATURES
, although it was present in my configuration.
Fortunately, there is bitbake-getvar.
This tool, although not widely known online, is invaluable for tracing variable manipulations.
It is included with poky.
Running bitbake-getvar DISTRO_FEATURES
lists all the locations where the variable is modified.
Together with the usual grepping the culprit can be found easily.
In the end, the discrepancy was the selected DISTRO
.
On one setup, the distro was poky; in the other our own.
Poky uses sysvinit as INIT_MANAGER
, whereas our own uses systemd.
Due to some magic (i.e. many recipes and include files), systemd is added to DISTRO_FEATURES
when INIT_MANAGER
is set to systemd.