[yocto] Extending images

Christopher Larson clarson at kergoth.com
Fri Jul 18 12:07:36 PDT 2014


On Fri, Jul 18, 2014 at 11:55 AM, Robert P. J. Day <rpjday at crashcourse.ca>
wrote:

> On Fri, 18 Jul 2014, Christopher Larson wrote:
>
> > I really don't think this was ever safe, as it completely depended
> > on how the image recipe added its bits to IMAGE_INSTALL, which could
> > easily vary from image to image. I've *always* told folks to use
> > IMAGE_INSTALL_append if anything, even back in oe classic :) --
>
>   a quick grep in openembedded-core/meta shows:
>
> $ grep -r "IMAGE_INSTALL +=" *
> recipes-core/images/core-image-minimal-mtdutils.bb:IMAGE_INSTALL +=
> "mtd-utils"
> recipes-extended/images/core-image-testmaster.bb:IMAGE_INSTALL += "\
> recipes-extended/images/core-image-lsb-sdk.bb:IMAGE_INSTALL +=
> "kernel-dev"
> recipes-graphics/images/core-image-directfb.bb:IMAGE_INSTALL += "\
> recipes-qt/images/qt4e-demo-image.bb:IMAGE_INSTALL += "\
> recipes-rt/images/core-image-rt-sdk.bb:IMAGE_INSTALL += "rt-tests
> hwlatdetect kernel-dev"
> recipes-rt/images/core-image-rt.bb:IMAGE_INSTALL += "rt-tests hwlatdetect"
> recipes-sato/images/core-image-sato-sdk.bb:IMAGE_INSTALL += "kernel-dev"
> recipes-sato/images/core-image-sato.bb:IMAGE_INSTALL +=
> "packagegroup-core-x11-sato-games"
> $
>
>   now i'm scared to look. :-)


This is what they should be doing in most cases. The only time you need
_append is when you're defining it from local.conf, because the behavior of
IMAGE_INSTALL += in local.conf depends on what the recipe is doing (does it
IMAGE_INSTALL = (overrides the user's value), ?= (only uses the user's
value, not its own), or += (adds to an already set value)). This is where
the value lies in providing the user explicit variables with known
semantics, so the user doesn't have to know these peculiarities and can
just set the variable already :)

That said, this is definitely another case of many you've pointed out where
our recipes just aren't as consistent as would be ideal. IMO when a recipe
takes a list variable like this and does just an '=' it's basically saying
"I must have only these things, throw away anything already set", so the
only time it should be set that way is when there's such an explicit need.
Whereas most of the time what they really wanted to say was "I need these
things", in which case += is more appropriate (and I'm not just talking
about IMAGE_INSTALL here, but also variables like RDEPENDS and DEPENDS) :)
But that's just my personal view on the subject.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20140718/f3c41f1c/attachment.html>


More information about the yocto mailing list