[bitbake-devel] [HELP] Create a new image recipe based on a (changed) existing one

Andre McCurdy armccurdy at gmail.com
Fri Feb 14 23:33:04 UTC 2020


On Thu, Feb 13, 2020 at 9:34 AM Joao Carlos Cabral (P)
<Joao.CCabral at parceiros.nos.pt> wrote:
>
> Thanks for your answer.
>
> Using your method, how could I create the normal image and the dev one?
>
> * bitbake product - would produce the normal one?
> * bitbake my-image - would produce the dev one?
>
> I still need to create the "normal" when ending a develop phase.

Assuming that you can't change layers 1 or 2 then the ONLY thing you
can build which will include both the my-image recipe in layer 1 and
its .bbappend in layer 2 is the my-image recipe itself. If the
development image is created by adding to the contents of my-image by
using a .bbappend in layer 3 then to switch back to the normal image
you would need to disable that .bbappend. e.g. If you have a .bbappend
which adds to a package group under the control of a variable then you
could switch between production and development by setting that
variable from a global config file (e.g. local.conf) and rebuilding
my-image.

A different approach which _would_ allow you to switch between
production and development by building a different image would be to
duplicate the .bbappend from layer 2 in your layer 3. In layer 3 you
could then have a new image recipe which directly includes the layer 1
recipe (ie what you tried originally) plus a new .bbappend which makes
the same changes to your new image recipe as the .bbappend in layer 2
makes to the layer 1 image recipe. If the contents of the .bbappend
don't need to be changed then you could perhaps make the layer 3
.bbappend a symlink pointing back to the layer 2 .bbappend, rather
than just copying and renaming the whole file.


More information about the bitbake-devel mailing list