[yocto] How to copy recipe and have different target names

Andrea Adami andrea.adami at gmail.com
Wed Jun 18 01:25:23 PDT 2014


On Tue, Jun 17, 2014 at 10:11 PM, Brian Smucker <bds at bsmucker.eu.org> wrote:
> Hi Andrea and all,
>
> So I am using your suggestion to make another variant of busybox:
> busybox-static, and I add the static.bblcass file.
>
> So when I try to do bitbake busybox-static, it ends up unpacking to
> busybox-static-1.20.2-r2/busybox-1.20.2 (which does not correspond to the S
> variable).
> And it errors out when it attempts to patch to
> busybox-static-1.20.2-r2/busybox-static-1.20.2 (the S variable path).
>
> What am I missing?
>

Hi,
sorry but I couldn't do a build-test yet so take my observations with
a grain of salt.
As I prevously hinted there are cases like this requiring some vars
adjustements because you have changed the BPN and PN (base/package
name).

In your -static recipe you could try to redefine

S = "${WORKDIR}/busybox-${PV}

Neverthless, busybox recipe is a special one because it is used
instead of a lot of single utilities.
This implies there are special cares to take to avoid conflicts with
busybox when a recipe is providing the same stuff.

AFAIS packaging should work because the recipe is using ${PN} so
you'll get distinct packages but check the manual about U_A (update
alternatives) and provider conflicts.

You have chosen one of the most complicate recipes to play with ;)

Cheers

Andrea
>
> Thanks,
>
> Brian
>
>
>
> On 6/17/2014 9:31 AM, Andrea Adami wrote:
>>
>> On Tue, Jun 17, 2014 at 5:41 PM, Brian Smucker <bds at bsmucker.eu.org>
>> wrote:
>>>
>>> Hello,
>>>
>>> I would like to have yocto generate two copies of busybox, one
>>> statically-linked and one dynamically linked. So I try to make a copy of
>>> the
>>> busybox recipe and give it a new name like busybox-s_xxxxx.bb
>>>
>>> But my knowlege of yocto comes up short and I get lots of errors.
>>>
>>> Is there a way to do this cleanly?  Or should I be trying to do a
>>> different
>>> approach?
>>>
>>> Thanks,
>>>
>>> Brian
>>> --
>>> _______________________________________________
>>> yocto mailing list
>>> yocto at yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/yocto
>>
>> Brian,
>>
>> I don't think there is an 'official' way to do that.
>> For a similar purpose (buidling static binaries against klibc) I have
>> developed two solutions, both using a custom class:
>>
>> 1) for easy-to-adapt recipes, BBCLASSEXTEND +  the custom class
>>
>> http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb
>>
>> 2) for the stubborn cases, create a copy of the recipe and may need to
>> adjust some vars (S, FILESPATH or better FILESEXTRAPATHS, ...)
>> see  i.e.
>>
>> http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.5.0.bb
>>
>> http://cgit.openembedded.org/meta-openembedded/tree/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_2.0.2.bb
>>
>> I guess busybox belongs to the heavy ones...
>>
>> Cheers
>>
>> Andrea
>
>



More information about the yocto mailing list