Skip to contentSkip to conversation

contradictory explanations of IMAGE_INSTALL in yocto manuals

DISCUSSION Robert P. J. Day 4 participants 7 messages Mar 9, 2012

lore
Share & tools
lore
#0 lore raw

(i posted something regarding this on the oe-core list, but i wanted
to post here as well with specific examples from the yocto manuals.)

from the yocto dev manual, section 4.3.1:

"The other method for creating a custom image is to modify an existing image. For example, if a developer wants to add strace into the core-image-sato image, they can use the following recipe:

     require core-image-sato.bb

     IMAGE_INSTALL += "strace"

however, here's the discussion of IMAGE_INSTALL in the poky ref
manual in the variables glossary:

"Using IMAGE_INSTALL with the += operator from the /conf/local.conf file or from within an image recipe is not recommended as it can cause ordering issues."

... and that explanation goes on to recommend using IMAGE_INSTALL_append instead. that inconsistency should be cleared up.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw

I tried the versions _append and += as well as _prepend and =+ with the IMAGE_INSTALL and other variables. So far I have not run into any issues where one would behave differently from the other. The only thing you have to remember with the _append and _prepend versions is that you have to include a space at the beginning for _append and at the end for _prepend. Although I have found that not always to be consistent either. However, an additional space does not hurt.

RUdi

#2 lore raw
Quoted 8 lines · Rudolf Streif

I tried the versions _append and += as well as _prepend and =+ with the IMAGE_INSTALL and other variables. So far I have not run into any issues where one would behave differently from the other. The only thing you have to remember with the _append and _prepend versions is that you have to include a space at the beginning for _append and at the end for _prepend. Although I have found that not always to be consistent either. However, an additional space does not hurt.

well, as i mentioned, the manual suggests quite strongly that there
is a fundamental difference. i'd just like to understand clearly what that is.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#3 lore raw

I don't think that there is a difference. At least not from my experience. Every time I have the choice I tried both variants and then examined the resulting variable e.g.

bitbake <recipe> -e | grep IMAGE_INSTALL

It looked the same. My conclusion is to use += and =+ for variables and _append and _prepend for tasks. But I could possibly be wrong since there are definitely many more cases than I have tried. Hence, it would probably be prudent to dig into Bitbake's code to see how it handles _append and _prepend. I have not had time to do that.

Rudi

Quoted 27 lines · Robert P. J. Day
Quoted 8 lines · Rudolf Streif

I tried the versions _append and += as well as _prepend and =+ with the IMAGE_INSTALL and other variables. So far I have not run into any issues where one would behave differently from the other. The only thing you have to remember with the _append and _prepend versions is that you have to include a space at the beginning for _append and at the end for _prepend. Although I have found that not always to be consistent either. However, an additional space does not hurt.

well, as i mentioned, the manual suggests quite strongly that there
is a fundamental difference. i'd just like to understand clearly what that is.

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

========================================================================

#4 lore raw
In reply to Robert P. J. Day

I tried the versions _append and += as well as _prepend and =+ with the IMAGE_INSTALL and other variables. So far I have not run into any issues where one would behave differently from the other. The only thing you have to remember with the _append and _prepend versions is that you have to include a space at the beginning for _append and at the end for _prepend. Although I have found that not always to be consistent either. However, an additional space does not hurt.

Rudi

#5 lore raw
In reply to Robert P. J. Day
Quoted 16 lines · Robert P. J. Day

(i posted something regarding this on the oe-core list, but i wanted
to post here as well with specific examples from the yocto manuals.)

from the yocto dev manual, section 4.3.1:

"The other method for creating a custom image is to modify an existing image. For example, if a developer wants to add strace into the core-image-sato image, they can use the following recipe:

     require core-image-sato.bb

     IMAGE_INSTALL += "strace"

however, here's the discussion of IMAGE_INSTALL in the poky ref
manual in the variables glossary:

Quoted 8 lines

"Using IMAGE_INSTALL with the += operator from the /conf/local.conf file or from within an image recipe is not recommended as it can cause ordering issues."

... and that explanation goes on to recommend using IMAGE_INSTALL_append instead. that inconsistency should be cleared up.

The issue here is your talking about two different use cases. Setting IMAGE_INSTALL from a local.conf is a
different use case then setting the value in a image recipe that includes another image recipe.

From the local.conf, just from a functional point of view generally will not work well if you do IMAGE_INSTALL +=.

Some images(not neccisarily in oe-core) set IMAGE_INSTALL explictly hard, which means you can add what ever you want in your local.conf and it will get replaced with what is in the recipe. If the recipe sets IMAGE_INSTALL soft, then what happens is when your local.conf is read, the value should start out as not defined, so when you += to the value you get what ever you set as the only value. Later on when things like core-image attempt to set via =? it sees that it is already set and should break the image since it doesn't add what it thinks is the right stuff to make the image, just the stuff you set in your local.conf.

If from the local.conf, you so IMAGE_INSTALL_append, what ever you set will get added after all the processing of the various settings for the image is
already complete.

In an image recipe, like the one you call out, all the image processing of what should be added etc, is alreaqdy done, when the =+ is added, so the result is what you would expect.

Different use cases generally have different suggested methods. However this is more of a funcitonal discssion as I am not sure what the community consensus
suggestions for setting things like IMAGE_INSTALL in local.conf is any more.

#6 lore raw

On Fri, 9 Mar 2012, Jeremy Puhlman wrote:
... snip ...

Quoted 16 lines

Some images(not neccisarily in oe-core) set IMAGE_INSTALL explictly hard, which means you can add what ever you want in your local.conf and it will get replaced with what is in the recipe. If the recipe sets IMAGE_INSTALL soft, then what happens is when your local.conf is read, the value should start out as not defined, so when you += to the value you get what ever you set as the only value. Later on when things like core-image attempt to set via =? it sees that it is already set and should break the image since it doesn't add what it thinks is the right stuff to make the image, just the stuff you set in your local.conf.

If from the local.conf, you so IMAGE_INSTALL_append, what ever you set will get added after all the processing of the various settings for the image is
already complete.

Quoted 8 lines

In an image recipe, like the one you call out, all the image processing of what should be added etc, is alreaqdy done, when the =+ is added, so the result is what you would expect.

Different use cases generally have different suggested methods. However this is more of a funcitonal discssion as I am not sure what the community consensus
suggestions for setting things like IMAGE_INSTALL in local.conf is any more.

ah, got it. i didn't follow *every* detail above, but i had
forgotten about the different levels of assignment "hardness", so in principle, i see what's happening. thanks.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================