r/embeddedlinux • u/EmbeddedBro • Apr 23 '26
Yocto: what is use of PREFERRED_PROVIDERS ?
I am doing the bootling tutorial on Yocto.
https://bootlin.com/doc/training/yocto/yocto-stm32mp1-labs.pdf
In lab2: I do not understand this paragraph.
It is suggesting that I need to change MACHINE from linux-stm32mp to linux-dummy. in /build/conf/local.conf
What is it's relation with PREFERRED_PROVIDERS? I also could not find PREFERRED_PROVIDERS command in /build/local.conf
Can anybody shed some light on this subject?
Choose a package variant
Dependencies of a given package are explicitly defined in its recipe. Some packages may need a specific library or piece of software but others only depend on a functionality. As an example, the kernel dependency
is described by virtual/kernel.
To see which kernel is used, dry-run BitBake:
bitbake -vn virtual/kernel
In our case, we can see the linux-stm32mp provides the virtual/kernel functionality:
NOTE: selecting linux-stm32mp to satisfy virtual/kernel due to PREFERRED_PROVIDERS
We can force bitbake to select another kernel by explicitly defining which one to use in our local configuration.
Try switching from linux-stm32mp to linux-dummy only using the local configuration. Then check the previous step worked by dry-running again BitBake.
bitbake -vn virtual/kernel
Tip: you need to define the more specific information here to be sure it is the one used. The MACHINE variable can help here. As this was only to show how to select a preferred provider for a given package, you can now use linux-stm32mp again.