* [HELP] Create a new image recipe based on a (changed) existing one
@ 2020-02-09 23:17 Joao Carlos Cabral (P)
2020-02-09 23:26 ` Joao Carlos Cabral (P)
0 siblings, 1 reply; 5+ messages in thread
From: Joao Carlos Cabral (P) @ 2020-02-09 23:17 UTC (permalink / raw)
To: bitbake-devel
Hi,
I'm trying to create a image recipe based on a existing one.
I've searched online, and I could find such an example.
My problem is that the image I what to serve as a base is changed in
another layer, and I want to include that changes.
Ex:
(tree)
Prj_root
-> layer1
-> recipes-core
-> images
-> my-image.bb [This is the base recipe]
-> layer2
-> recipes-core
-> images
-> my-image.bbappend [This is the changed one]
-> layer3
-> recipes-core
-> images
-> my-image-dev.bb [this is the new image, based on my-
image]
my-image.bbappend is something like this:
--------------------- my-image.bbappend ---------
PROVIDES = "product"
IMAGE_INSTALL += " \
<some_packages> \
"
IMAGE_INSTALL_remove += " \
<other-packeges>
"
(+ other functions related with signing the image)
_________________________________________________
The final image is created with 'bitbake product'.
And, I want to create a dev image that must be based on the current
"product" image (my-image.bb + my-image.bbappend) with some dev
packages.
So, I need to include the changes that my-image.bbapend does to this
dev image I'm trying to create.
Tried simple create a new image that should be a copy of the working
one, and then add the needed packages for development.
So I did the following...
---------------- my-image-dev.bbappend ----------
SUMMARY = "dev Image"
require layer1/recipes-core/images/my-image.bb
------------------------------------------------
I can run 'bitbake my-image-dev' and it runs, but doesn't produce the
same output as 'bitbake product'.
Also, If I run 'bitbake my-image-dev' 1st, it finishes fine. Running
'bitbake product' after makes a bunch of other tasks and finishes fine.
Running again 'bitbake my-image-dev' finishes with an error on a
specific task. ( It shows that they are not building the same thing)
How can I do what I need?
NOTE: I can't change anything in the layer1 and layer2.
PS. Also tried to require the bbappend file, but bitbake fails saying
that it's not a bitbake file.
Thanks in advanced.
João Cabral
^ permalink raw reply [flat|nested] 5+ messages in thread
* [HELP] Create a new image recipe based on a (changed) existing one
2020-02-09 23:17 [HELP] Create a new image recipe based on a (changed) existing one Joao Carlos Cabral (P)
@ 2020-02-09 23:26 ` Joao Carlos Cabral (P)
2020-02-10 21:12 ` Andre McCurdy
0 siblings, 1 reply; 5+ messages in thread
From: Joao Carlos Cabral (P) @ 2020-02-09 23:26 UTC (permalink / raw)
To: bitbake-devel
Hi,
I'm trying to create a image recipe based on a existing one.
I've searched online, and I could find such an example.
My problem is that the image I what to serve as a base is changed in
another layer, and I want to include that changes.
Ex:
(tree)
Prj_root
-> layer1
-> recipes-core
-> images
-> my-image.bb [This is the base recipe]
-> layer2
-> recipes-core
-> images
-> my-image.bbappend [This is the changed one]
-> layer3
-> recipes-core
-> images
-> my-image-dev.bb [this is the new image, based on my-image]
my-image.bbappend is something like this:
--------------------- my-image.bbappend ---------
PROVIDES = "product"
IMAGE_INSTALL += " \
<some_packages> \
"
IMAGE_INSTALL_remove += " \
<other-packeges>
"
(+ other functions related with signing the image)
_________________________________________________
The final image is created with 'bitbake product'.
And, I want to create a dev image that must be based on the current
"product" image (my-image.bb + my-image.bbappend) with some dev
packages.
So, I need to include the changes that my-image.bbapend does to this
dev image I'm trying to create.
Tried simple create a new image that should be a copy of the working
one, and then add the needed packages for development.
So I did the following...
---------------- my-image-dev.bbappend ----------
SUMMARY = "dev Image"
require layer1/recipes-core/images/my-image.bb
------------------------------------------------
I can run 'bitbake my-image-dev' and it runs, but doesn't produce the
same output as 'bitbake product'.
Also, If I run 'bitbake my-image-dev' 1st, it finishes fine. Running
'bitbake product' after makes a bunch of other tasks and finishes fine.
Running again 'bitbake my-image-dev' finishes with an error on a
specific task. ( It shows that they are not building the same thing)
How can I do what I need?
NOTE: I can't change anything in the layer1 and layer2.
PS. Also tried to require the bbappend file, but bitbake fails saying
that it's not a bitbake file.
Thanks in advanced.
João Cabral
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [HELP] Create a new image recipe based on a (changed) existing one
2020-02-09 23:26 ` Joao Carlos Cabral (P)
@ 2020-02-10 21:12 ` Andre McCurdy
2020-02-13 17:34 ` Joao Carlos Cabral (P)
0 siblings, 1 reply; 5+ messages in thread
From: Andre McCurdy @ 2020-02-10 21:12 UTC (permalink / raw)
To: Joao Carlos Cabral (P); +Cc: bitbake-devel
On Mon, Feb 10, 2020 at 6:15 AM Joao Carlos Cabral (P)
<Joao.CCabral@parceiros.nos.pt> wrote:
>
> Hi,
>
> I'm trying to create a image recipe based on a existing one.
> I've searched online, and I could find such an example.
>
> My problem is that the image I what to serve as a base is changed in
> another layer, and I want to include that changes.
>
> Ex:
>
> (tree)
>
> Prj_root
> -> layer1
> -> recipes-core
> -> images
> -> my-image.bb [This is the base recipe]
> -> layer2
> -> recipes-core
> -> images
> -> my-image.bbappend [This is the changed one]
> -> layer3
> -> recipes-core
> -> images
> -> my-image-dev.bb [this is the new image, based on my-image]
>
> my-image.bbappend is something like this:
>
> --------------------- my-image.bbappend ---------
> PROVIDES = "product"
>
> IMAGE_INSTALL += " \
> <some_packages> \
> "
> IMAGE_INSTALL_remove += " \
> <other-packeges>
> "
>
> (+ other functions related with signing the image)
> _________________________________________________
>
> The final image is created with 'bitbake product'.
> And, I want to create a dev image that must be based on the current
> "product" image (my-image.bb + my-image.bbappend) with some dev
> packages.
> So, I need to include the changes that my-image.bbapend does to this
> dev image I'm trying to create.
>
>
> Tried simple create a new image that should be a copy of the working
> one, and then add the needed packages for development.
> So I did the following...
>
> ---------------- my-image-dev.bbappend ----------
>
> SUMMARY = "dev Image"
>
> require layer1/recipes-core/images/my-image.bb
> ------------------------------------------------
>
> I can run 'bitbake my-image-dev' and it runs, but doesn't produce the
> same output as 'bitbake product'.
>
> Also, If I run 'bitbake my-image-dev' 1st, it finishes fine. Running
> 'bitbake product' after makes a bunch of other tasks and finishes fine.
> Running again 'bitbake my-image-dev' finishes with an error on a
> specific task. ( It shows that they are not building the same thing)
>
> How can I do what I need?
> NOTE: I can't change anything in the layer1 and layer2.
For the future, the clean way to do this would be to for the base
image to include a package group for dev tools. The dev tools package
group would be defined by a recipe in layer 1 and empty by default.
When you want to add dev tools you can create a .bbappend (in layer 3)
for the dev tools recipe.
If you can't modify layers 1 or 2 you can archieve something similar
with a .bbappend in layer 3 which adds the dev tools to one of the
package groups which _is_ being included in the image. For example, if
you look in the manifest for the image you should see a number of
package groups named packagegroup-base-ipv6, packagegroup-base-nfs,
etc which are being included in the image. You can add packages to
these package groups by using a .bbappend for the "
packagegroup-base.bb" recipe.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [HELP] Create a new image recipe based on a (changed) existing one
2020-02-10 21:12 ` Andre McCurdy
@ 2020-02-13 17:34 ` Joao Carlos Cabral (P)
2020-02-14 23:33 ` Andre McCurdy
0 siblings, 1 reply; 5+ messages in thread
From: Joao Carlos Cabral (P) @ 2020-02-13 17:34 UTC (permalink / raw)
To: armccurdy; +Cc: bitbake-devel
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.
Thanks
João Cabral
On Mon, 2020-02-10 at 13:12 -0800, Andre McCurdy wrote:
> On Mon, Feb 10, 2020 at 6:15 AM Joao Carlos Cabral (P)
> <Joao.CCabral@parceiros.nos.pt> wrote:
> >
> > Hi,
> >
> > I'm trying to create a image recipe based on a existing one.
> > I've searched online, and I could find such an example.
> >
> > My problem is that the image I what to serve as a base is changed
> > in
> > another layer, and I want to include that changes.
> >
> > Ex:
> >
> > (tree)
> >
> > Prj_root
> > -> layer1
> > -> recipes-core
> > -> images
> > -> my-image.bb [This is the base recipe]
> > -> layer2
> > -> recipes-core
> > -> images
> > -> my-image.bbappend [This is the changed one]
> > -> layer3
> > -> recipes-core
> > -> images
> > -> my-image-dev.bb [this is the new image, based on
> > my-image]
> >
> > my-image.bbappend is something like this:
> >
> > --------------------- my-image.bbappend ---------
> > PROVIDES = "product"
> >
> > IMAGE_INSTALL += " \
> > <some_packages> \
> > "
> > IMAGE_INSTALL_remove += " \
> > <other-packeges>
> > "
> >
> > (+ other functions related with signing the image)
> > _________________________________________________
> >
> > The final image is created with 'bitbake product'.
> > And, I want to create a dev image that must be based on the current
> > "product" image (my-image.bb + my-image.bbappend) with some dev
> > packages.
> > So, I need to include the changes that my-image.bbapend does to
> > this
> > dev image I'm trying to create.
> >
> >
> > Tried simple create a new image that should be a copy of the
> > working
> > one, and then add the needed packages for development.
> > So I did the following...
> >
> > ---------------- my-image-dev.bbappend ----------
> >
> > SUMMARY = "dev Image"
> >
> > require layer1/recipes-core/images/my-image.bb
> > ------------------------------------------------
> >
> > I can run 'bitbake my-image-dev' and it runs, but doesn't produce
> > the
> > same output as 'bitbake product'.
> >
> > Also, If I run 'bitbake my-image-dev' 1st, it finishes fine.
> > Running
> > 'bitbake product' after makes a bunch of other tasks and finishes
> > fine.
> > Running again 'bitbake my-image-dev' finishes with an error on a
> > specific task. ( It shows that they are not building the same
> > thing)
> >
> > How can I do what I need?
> > NOTE: I can't change anything in the layer1 and layer2.
>
> For the future, the clean way to do this would be to for the base
> image to include a package group for dev tools. The dev tools package
> group would be defined by a recipe in layer 1 and empty by default.
> When you want to add dev tools you can create a .bbappend (in layer
> 3)
> for the dev tools recipe.
>
> If you can't modify layers 1 or 2 you can archieve something similar
> with a .bbappend in layer 3 which adds the dev tools to one of the
> package groups which _is_ being included in the image. For example,
> if
> you look in the manifest for the image you should see a number of
> package groups named packagegroup-base-ipv6, packagegroup-base-nfs,
> etc which are being included in the image. You can add packages to
> these package groups by using a .bbappend for the "
> packagegroup-base.bb" recipe.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [HELP] Create a new image recipe based on a (changed) existing one
2020-02-13 17:34 ` Joao Carlos Cabral (P)
@ 2020-02-14 23:33 ` Andre McCurdy
0 siblings, 0 replies; 5+ messages in thread
From: Andre McCurdy @ 2020-02-14 23:33 UTC (permalink / raw)
To: Joao Carlos Cabral (P); +Cc: bitbake-devel
On Thu, Feb 13, 2020 at 9:34 AM Joao Carlos Cabral (P)
<Joao.CCabral@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.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-02-14 23:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-09 23:17 [HELP] Create a new image recipe based on a (changed) existing one Joao Carlos Cabral (P)
2020-02-09 23:26 ` Joao Carlos Cabral (P)
2020-02-10 21:12 ` Andre McCurdy
2020-02-13 17:34 ` Joao Carlos Cabral (P)
2020-02-14 23:33 ` Andre McCurdy
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.