Skip to contentSkip to conversation

strange explanation of how to add a package to an existing recipe

DISCUSSION Rifenbark, Scott M 4 participants 5 messages Nov 21, 2013 – Nov 22, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): alpine.DEB.2.02.1311211327360.10963@oneiric

#1 lore raw

Robert,

Moving this to the discussion group as there is likely issues involved here beyond me.

Scott

Quoted 36 lines

-----Original Message-----
From: Robert P. J. Day [mailto:[email protected]]
Sent: Thursday, November 21, 2013 10:32 AM
To: Rifenbark, Scott M
Subject: strange explanation of how to add a package to an existing recipe

dev manual here:

http://www.yoctoproject.org/docs/latest/dev-manual/dev-
manual.html#usingpoky-extend-customimage-custombb

suggests that, to customize an image, you should copy the existing .bb file for that image to another name and add a line like:

IMAGE_INSTALL += "strace"

but rather than *copy* the entire image file, isn't it easier to use what's already being used; that is, just "include" or "require" the existing .bb file.
example: core-image-minimal-mtdutils.bb contains:

require core-image-minimal.bb

DESCRIPTION = "Small image capable of booting a device with support for the \ Minimal MTD Utilities, which let the user interact with the MTD subsystem in \ the kernel to perform operations on flash devices."

IMAGE_INSTALL += "mtd-utils"

no copying involved -- just "require" the existing image file, and add a package. or am i misreading something?

rday

#2 lore raw
Quoted 12 lines · Scott M
Quoted 1 line

suggests that, to customize an image, you should copy the existing .bb

file for

Quoted 5 lines

that image to another name and add a line like:

IMAGE_INSTALL += "strace"

but rather than *copy* the entire image file, isn't it easier to use

what's

Quoted 1 line

already being used; that is, just "include" or "require" the existing .bb

file.

Quoted 1 line

example: core-image-minimal-mtdutils.bb contains:

i would agree with the doc. while it is tempting to include/require a 'minimal' image, and it is simpler at first sight, eventually you will need to have full control of all your image. especially when your 'image' is your 'product' that gets deployed. In such circumstances I believe it is more appropriate to not rely on an external recipe. e.g. if the minimal image you include change, all your derived images change too...

it's kind of a 'taste' choice, and you might want to choose to do differently, but still the best recommendation to me is to own your image recipes completely...

alternatively, there can be some corner case when you include/require as the parsing of the recipe is done 'serially'. so the place where you include/require in your .bb file might matter, if you play around with some CORE IMAGE variable... and that's kind of tough things to debug.

#3 lore raw
Quoted 20 lines · Nicolas Dechesne

On Thu, Nov 21, 2013 at 7:35 PM, Rifenbark, Scott M <[email protected]> wrote:
>suggests that, to customize an image, you should copy the existing .bb file for >that image to another name and add a line like:
>
>  IMAGE_INSTALL += "strace"
>
>but rather than *copy* the entire image file, isn't it easier to use what's >already being used; that is, just "include" or "require" the existing .bb file. >example: core-image-minimal-mtdutils.bb contains:

i would agree with the doc. while it is tempting to include/require a 'minimal' image, and it is simpler at first sight, eventually you will need to have full control of all your image. especially when your 'image' is your 'product' that gets deployed. In such circumstances I believe it is more appropriate to not rely on an external recipe. e.g. if the minimal image you include change, all your derived images change too...

Quoted 3 lines

it's kind of a 'taste' choice, and you might want to choose to do differently, but still the best recommendation to me is to own your image recipes completely...

your logic is sound; however, it's also reasonable to suspect that
if someone is going to create a new, initial image over which they want full control, they may very well want to create some subtle variants of that image (as is done with all those core images).

so perhaps both approaches should be documented with the appropriate
caveats?

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
========================================================================
#4 lore raw

Hi Robert,

Quoted 2 lines · On Friday 22 November 2013 05:50:39 Robert P. J. Day wrote:
Quoted 1 line · Nicolas Dechesne

On Thu, Nov 21, 2013 at 7:35 PM, Rifenbark, Scott M

Quoted 22 lines · <[email protected]> wrote:
Quoted 18 lines

>suggests that, to customize an image, you should copy the existing
>.bb file for> >
>that image to another name and add a line like:
> IMAGE_INSTALL += "strace"
>
>but rather than *copy* the entire image file, isn't it easier to >use what's
>already being used; that is, just "include" or "require" the >existing .bb file.>
>example: core-image-minimal-mtdutils.bb contains:
i would agree with the doc. while it is tempting to include/require a 'minimal' image, and it is simpler at first sight, eventually you will need to have full control of all your image. especially when your 'image' is your 'product' that gets deployed. In such circumstances I believe it is more appropriate to not rely on an external recipe. e.g. if the minimal image you include change, all your derived images change too...

Quoted 3 lines

it's kind of a 'taste' choice, and you might want to choose to do differently, but still the best recommendation to me is to own your image recipes completely...

Quoted 7 lines

your logic is sound; however, it's also reasonable to suspect that
if someone is going to create a new, initial image over which they want full control, they may very well want to create some subtle variants of that image (as is done with all those core images).

so perhaps both approaches should be documented with the appropriate
caveats?

Maybe, but this is really no different than any other type of recipe. I'd much rather us have some documentation on how to share commonality between recipes (where we discuss the usage and relative merits of include/require and bbclass files, for example) and just note in the image recipe section that image recipes are recipes and point to that generic documentation.

I had a hand in writing this section so I'm completely biased, but I agree with Nicolas - including any of the core-image-* in your own recipe isn't giving you much of an advantage and may in fact cause unexpected changes when you come to upgrade. Image recipes tend to be fairly trivial, so it's simplest to just have your own discrete recipe (although if you want to have variants of that recipe that you also control, by all means use includes or classes to share the common parts.)

Cheers,
Paul

Cheers,
Paul

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

#5 lore raw
Quoted 43 lines · Paul Eggleton

Hi Robert,

Quoted 2 lines · On Friday 22 November 2013 05:50:39 Robert P. J. Day wrote:
Quoted 1 line · Nicolas Dechesne

On Thu, Nov 21, 2013 at 7:35 PM, Rifenbark, Scott M

Quoted 22 lines · <[email protected]> wrote:
Quoted 18 lines

>suggests that, to customize an image, you should copy the existing
>.bb file for> >
>that image to another name and add a line like:
> IMAGE_INSTALL += "strace"
>
>but rather than *copy* the entire image file, isn't it easier to >use what's
>already being used; that is, just "include" or "require" the >existing .bb file.>
>example: core-image-minimal-mtdutils.bb contains:
i would agree with the doc. while it is tempting to include/require a 'minimal' image, and it is simpler at first sight, eventually you will need to have full control of all your image. especially when your 'image' is your 'product' that gets deployed. In such circumstances I believe it is more appropriate to not rely on an external recipe. e.g. if the minimal image you include change, all your derived images change too...

Quoted 3 lines

it's kind of a 'taste' choice, and you might want to choose to do differently, but still the best recommendation to me is to own your image recipes completely...

Quoted 7 lines

your logic is sound; however, it's also reasonable to suspect that
if someone is going to create a new, initial image over which they want full control, they may very well want to create some subtle variants of that image (as is done with all those core images).

so perhaps both approaches should be documented with the appropriate
caveats?

Maybe, but this is really no different than any other type of recipe. I'd much rather us have some documentation on how to share commonality between recipes (where we discuss the usage and relative merits of include/require and bbclass files, for example) and just note in the image recipe section that image recipes are recipes and point to that generic documentation.

Quoted 8 lines

I had a hand in writing this section so I'm completely biased, but I agree with Nicolas - including any of the core-image-* in your own recipe isn't giving you much of an advantage and may in fact cause unexpected changes when you come to upgrade. Image recipes tend to be fairly trivial, so it's simplest to just have your own discrete recipe (although if you want to have variants of that recipe that you also control, by all means use includes or classes to share the common parts.)

ok, this makes sense. i'll shut up now.

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
========================================================================