[yocto] How to require image recipe from another layer?

autif khan autif.mlist at gmail.com
Thu Dec 29 10:14:20 PST 2011


Another recipe question along the same path.

The following recipe does not actually put helloworld in the image -
it does not even build it.

require recipes-sato/images/core-image-sato.bb
IMAGE_FEATURES += "helloworld"

The following one does.

require recipes-sato/images/core-image-sato.bb
IMAGE_INSTALL += "helloworld"

I am guessing that if I have several recipes in my layer (say) hw1,
hw2, hw3 etc, I would have to use the following recipe.

require recipes-sato/images/core-image-sato.bb
IMAGE_INSTALL += "hw1 hw2 hw3 etc"

However, I am sure there is a way to ties these up with
"IMAGE_FEATURE" variable.

Can you please help me with setting up my recipes so that all the
hello world apps are included when I use the following recipe.

require recipes-sato/images/core-image-sato.bb
IMAGE_FEATURES += "helloworld"

I am guessing that I would have to tell the hw1 recipe that it is a
helloworld feature. How do I go about doing this?

Here it is for reference:

DESCRIPTION = "hello world app"
SECTION = "autif"
LICENSE = "SomeLic"
LIC_FILES_CHKSUM = "file://COPYING;md5=178c09540123ca26c1b9c1ccbfbcde87"
PR = "r0"

SRC_URI = "file://COPYING \
		   file://helloworld.c"

S = "${WORKDIR}"

do_compile () {
	${CC} helloworld.c -o helloworld
}

do_install () {
	install -d ${D}${bindir}
	install -m 0755 helloworld ${D}${bindir}
}


Thanks again!

Autif

On Wed, Dec 28, 2011 at 3:43 PM, autif khan <autif.mlist at gmail.com> wrote:
> Must be the hangover from the holidays!
>
> I typed the path as you suggested (I did replace recipes-core with
> recipes-sato), but I must have had a type somewhere and it did not
> work and gave the same error. I then tried the relative path - which I
> copied and pasted - instead of typing and it worked. So I assumed
> thats what it must have been.
>
> Now, I have the following as my recipe and it works just fine. As I
> said - must be the hangover from the holidays.
>
> require recipes-sato/images/core-image-sato.bb
> IMAGE_FEATURES += "helloworld"
>
> Thanks again
>
> Autif
>
> On Wed, Dec 28, 2011 at 3:31 PM, Chris Larson <clarson at kergoth.com> wrote:
>> On Wed, Dec 28, 2011 at 1:22 PM, autif khan <autif.mlist at gmail.com> wrote:
>>> Thats right. Accounting for the relative, path, the following recipe
>>> seems to works.
>>>
>>> require ../../../meta/recipes-sato/images/core-image-sato.bb
>>> IMAGE_FEATURES += "helloworld"
>>
>>
>> That's not what I was referring to. You don't need the full relative
>> path. It will automatically search BBPATH if you require a relative
>> path. if you do require recipes-sato/images/core-image-sato.bb, it
>> will search your layers and find it.
>> --
>> Christopher Larson
>> clarson at kergoth dot com
>> Founder - BitBake, OpenEmbedded, OpenZaurus
>> Maintainer - Tslib
>> Senior Software Engineer, Mentor Graphics



More information about the yocto mailing list