Search code examples
yoctobitbake

Where do the "virtual/..." terms come from?


In Bitbake I can build e.g. the Linux Kernel with bitbake virtual/kernel or U-Boot with bitbake virtual/bootloader.

Where do those "virtual/..." terms come from?

I used find for patters such as "virtual/kernel" in the poky directory, but there are nearly infinite results and I don't know where to search.

Can I e.g. direct virtual/bootloader to a custom recipe when I might have programmed an own bootloader?


Solution

  • From bitbake user-manual

    As an example of adding an extra provider, suppose a recipe named foo_1.0.bb contained the following:

    PROVIDES += "virtual/bar_1.0"

    The recipe now provides both "foo_1.0" and "virtual/bar_1.0". The "virtual/" namespace is often used to denote cases where multiple providers are expected with the user choosing between them. Kernels and toolchain components are common cases of this in OpenEmbedded.

    Sometimes a target might have multiple providers. A common example is "virtual/kernel", which is provided by each kernel recipe. Each machine often selects the best kernel provider by using a line similar to the following in the machine configuration file:

    PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"