[yocto] How to request a certain version of a recipes for an image?

Andre McCurdy armccurdy at gmail.com
Sun Nov 4 18:38:18 PST 2018


On Sun, Nov 4, 2018 at 2:30 PM Patrick Boettcher
<patrick.boettcher at posteo.de> wrote:
>
> Hi list,
>
> I'm using the morty-release for my device.
>
> My sources consists of different layers. Some application
> specific-layers (which contains a image-recipe), our
> BSP-provider and tooling-layers.
>
> It now happens that in there is package (dt-utils) which has recipes in
> two different layers, with different versions.
>
> In my image-file I request the package via
>
>     IMAGE_INSTALL += "dt-utils"
>
> How do I force the version of dt-utils for this image? By default it
> selects the wrong one.
>
> Here's what I tried, by adding to the image-recipe:
>
>     DEPENDS += "dt-utils (>= 2017.03.0)"
>
> and
>
>     RDEPENDS += "dt-utils (>= 2017.03.0)"
>
> seems to have no effect. Adding the version-logic to the
> IMAGE_INSTALL-line fails to build.
>
> What works is to add PREFERRED_VERSION to local.conf. But this is not
> committable, so I'd like to avoid it.

You can't directly influence the build of one recipe (ie dt-utils) by
making a change in another recipe (ie the image recipe), so the
DEPENDS and RDEPENDS style changes you have tried will not work.
Variables in the image recipe are not visible when the dt-utils recipe
is built.

Setting PREFERRED_VERSION from a global config file is a valid
solution. In that case it's up to you to decide which global config to
use - adding to local.conf, the machine config, the distro config, a
meta layer config file will all work. Using either the distro or
machine config would be the most typical approach - depending on
whether you want to version preference to apply to one build
configuration (ie one machine) or to all your builds (ie your distro).

An alternative solution would to be to change the priority of the
recipes in the meta layer(s) which contains the dt-utils recipes. e.g.
increasing BBFILE_PRIORITY_xxx in the layer.conf in the meta layer
with the dt-utils recipe you want to use.


More information about the yocto mailing list