Discussion:
[yocto] How to request a certain version of a recipes for an image?
Patrick Boettcher
2018-11-04 16:55:30 UTC
Permalink
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.

Thanks.

best regards,
--
Patrick.



--
Randy MacLeod
2018-11-05 01:13:49 UTC
Permalink
Post by Patrick Boettcher
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.
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.
Can't you use PREFERRED_VERSION and commit that in one of the
layers that you control?

eg:
$ cd .../meta-virtualization.git
$ grep -r PREFERRED_VERSION .| head -1
./conf/distro/include/meta-virt-default-versions.inc:PREFERRED_VERSION_python-blinker
= "1.3"


../Randy
Post by Patrick Boettcher
Thanks.
best regards,
--
Patrick.
--
# Randy MacLeod
# Wind River Linux
--
Andre McCurdy
2018-11-05 02:38:18 UTC
Permalink
On Sun, Nov 4, 2018 at 2:30 PM Patrick Boettcher
Post by Patrick Boettcher
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.
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.
--
Patrick Boettcher
2018-11-05 08:46:41 UTC
Permalink
On Sun, 4 Nov 2018 18:38:18 -0800
Post by Andre McCurdy
On Sun, Nov 4, 2018 at 2:30 PM Patrick Boettcher
Post by Patrick Boettcher
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.
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.
Thanks Andre, thanks Randy for clearing up my mis-conception of recipes
and conf-files.

--
Patrick.


--

Loading...