All of lore.kernel.org
 help / color / mirror / Atom feed
* .bbappend and require
@ 2014-12-08 19:27 Gary Thomas
  2014-12-08 20:05 ` Nicolas Dechesne
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Thomas @ 2014-12-08 19:27 UTC (permalink / raw)
  To: Yocto Project

I have a base image in my distribution (e.g. xyz-image-base.bb).
Many of my layers will build on this using 'require', e.g.
   require recipes-base/images/xyz-image-base.bb

Sometimes a given layer may create many such image recipes, each
using 'require' to fill in the base.  It would be nice to be able
to adjust the base recipe using a .bbappend in the layer so that
all images built by that layer use the same changes.  I've found
that this doesn't work as .bbappend files do not seem to be used
by 'require'.

It's easy to see this bug in action - just create a file
'core-image-minimal.bbappend' which contains:
   CORE_IMAGE_EXTRA_INSTALL += " non-existent-package"
With this, you *can* build core-image-minimal-dev (which uses
'require' to build on core-image-minimal) but not core-image-minimal.

Is there some [good] reason for this behaviour or a bug?
Could it be made to work the way I had hoped/expected?

Thanks

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: .bbappend and require
  2014-12-08 19:27 .bbappend and require Gary Thomas
@ 2014-12-08 20:05 ` Nicolas Dechesne
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Dechesne @ 2014-12-08 20:05 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Yocto Project

On Mon, Dec 8, 2014 at 8:27 PM, Gary Thomas <gary@mlbassoc.com> wrote:
> I have a base image in my distribution (e.g. xyz-image-base.bb).
> Many of my layers will build on this using 'require', e.g.
>   require recipes-base/images/xyz-image-base.bb
>
> Sometimes a given layer may create many such image recipes, each
> using 'require' to fill in the base.  It would be nice to be able
> to adjust the base recipe using a .bbappend in the layer so that
> all images built by that layer use the same changes.  I've found
> that this doesn't work as .bbappend files do not seem to be used
> by 'require'.
>
> It's easy to see this bug in action - just create a file
> 'core-image-minimal.bbappend' which contains:
>   CORE_IMAGE_EXTRA_INSTALL += " non-existent-package"
> With this, you *can* build core-image-minimal-dev (which uses
> 'require' to build on core-image-minimal) but not core-image-minimal.
>
> Is there some [good] reason for this behaviour or a bug?

this isn't a bug. a .bbappend is to append content to a recipe. when
you build core-image-mininal-dev, this is the actual recipe name. so
if you want a .bbappend it would be core-image-minimal-dev.bbappend.

if you actually try to build core-image-minimal, then the .bbappend
would be applied.

this is good behavior here. nothing wrong.

> Could it be made to work the way I had hoped/expected?

i don't see any easy way to do that.
- you might be able to get something to work using layer priorities ,
but even if it works it's quite fragile.
- you can create another level of indirection, in the layer that
requires customization, you create xyz-image-base-layer-foo.bb, and
require that file in all your images, so that you can introduce
changes at one place.
- you can use variables in the generic image to offer several
configurations, and set these variables at the layer level
- maybe using a class instead of a recipe might make sense easier to
manage as well.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-08 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 19:27 .bbappend and require Gary Thomas
2014-12-08 20:05 ` Nicolas Dechesne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.