Upgrading (overriding) an entire recipe in a custom layer
Asked Answered
L

1

11

I have a custom layer in project. This gets shared with colleagues.

My distro (poky) it uses a older version of alsa. This gets downloaded on initial setup of the build area. I would like to 'replace' that version of alsa with a later version and do this within my custom layer, so that they don't have to edit/replace recipes in poky.

What's the best way to do this? If I just download the newer recipe and include it in my layer (matching the file system names) will it automatically use the later version or is there something else I need to do?

Labellum answered 10/5, 2019 at 19:10 Comment(0)
C
15

The way you proceeded is the right way, you should add new recipes/bbappend files on your own layer(s), you shouldn't modify Yocto's base layers nor third-party layers by default. Nevertheless, since you want to add a newer version of an existing recipe, you should keep in mind that:

  • You have to check the priority of your own layer and the priority of the layer that contains the original recipe. Yocto will pick the recipe of the higher priority layer, no matter if it is a newer version or not (ignoring PV). For further information, search for BBFILE_PRIORITY in the Yocto Project Reference Manual. (You can also see a list of all configured layers along with their priorities with the command bitbake-layers show-layers)
  • In the case of both layers having the same priority, Yocto will build the recipe with the highest PV (you can check/set this value inside your recipe or in its filename recipename_pv.bb). Alternatively, if you wish to select another version rather than the one that is being currently built, you can just set the variable PREFERRED_VERSION_recipename = desiredPV in your distro.conf or local.conf file.
Calvary answered 11/5, 2019 at 12:17 Comment(1)
Thanks! I figured out BBFILE_PRIORITY not long after I posted the question. Just logged in to update the post and saw your answer. Very comprehensive. Thanks again.Labellum

© 2022 - 2024 — McMap. All rights reserved.