问题
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?
回答1:
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 forBBFILE_PRIORITY
in the Yocto Project Reference Manual. (You can also see a list of all configured layers along with their priorities with the commandbitbake-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 variablePREFERRED_VERSION_recipename = desiredPV
in your distro.conf or local.conf file.
来源:https://stackoverflow.com/questions/56083565/upgrading-overriding-an-entire-recipe-in-a-custom-layer