* How to use different busybox defconfig's in the initramfs and rootfs image
@ 2015-02-02 13:21 Erwin.Rieger.ext
2015-02-03 1:48 ` ChenQi
2015-02-03 9:23 ` Erwin.Rieger.ext
0 siblings, 2 replies; 6+ messages in thread
From: Erwin.Rieger.ext @ 2015-02-02 13:21 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
Hello list,
i have used Yocto to create a initramfs linux kernel and a corresponding rootfs for a embedded linux system.
Things are working as expected, so far.
Now i want to fine-tune my setup and want to use a different busybox configuration in the initramfs as the one in the rootfs image.
For example, the initramfs busybox should contain support for switch-root and that is not needed in the rootfs.
On the other hand, the rootfs should contain a "full-fledged" busybox (with inetd enabled, for example).
So the question is: How can i build/install a package two times with differing configurations in one bitbake run?.
How can this be done the Yocto-way without copying busybox.bb and hacking it the way i need it?
I've tried various combinations, e.g. bb-appending busybox, inheriting from busybox and so on - but to no avail.
Maybe someone have an idea on how to do that?
PS:
* The kernel recipe is derived (bbappend) from core-image-minimal-initramfs.
* Rootfs recipe is derived from core-image-minimal.bb.
--
Erwin Rieger
--
[-- Attachment #2: Type: text/html, Size: 2963 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to use different busybox defconfig's in the initramfs and rootfs image
2015-02-02 13:21 How to use different busybox defconfig's in the initramfs and rootfs image Erwin.Rieger.ext
@ 2015-02-03 1:48 ` ChenQi
2015-02-03 9:23 ` Erwin.Rieger.ext
1 sibling, 0 replies; 6+ messages in thread
From: ChenQi @ 2015-02-03 1:48 UTC (permalink / raw)
To: Erwin.Rieger.ext, yocto
[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]
The only way I know is to make a new recipe, busybox-initramfs.bb, for
example.
Install busybox for image rootfs and busybox-initramfs for initramfs.
Best Regards,
Chen Qi
On 02/02/2015 09:21 PM, Erwin.Rieger.ext@rohde-schwarz.com wrote:
> Hello list,
>
> i have used Yocto to create a initramfs linux kernel and a
> corresponding rootfs for a embedded linux system.
>
> Things are working as expected, so far.
>
> Now i want to fine-tune my setup and want to use a different busybox
> configuration in the initramfs as the one in the rootfs image.
> For example, the initramfs busybox should contain support for
> switch-root and that is not needed in the rootfs.
> On the other hand, the rootfs should contain a "full-fledged" busybox
> (with inetd enabled, for example).
>
> So the question is: How can i build/install a package two times with
> differing configurations in one bitbake run?.
>
> How can this be done the Yocto-way without copying busybox.bb and
> hacking it the way i need it?
>
> I've tried various combinations, e.g. bb-appending busybox, inheriting
> from busybox and so on - but to no avail.
>
> Maybe someone have an idea on how to do that?
>
>
> PS:
> * The kernel recipe is derived (bbappend)
> from core-image-minimal-initramfs.
> * Rootfs recipe is derived from core-image-minimal.bb.
>
>
> --
> Erwin Rieger
> --
>
>
[-- Attachment #2: Type: text/html, Size: 4566 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to use different busybox defconfig's in the initramfs and rootfs image
2015-02-02 13:21 How to use different busybox defconfig's in the initramfs and rootfs image Erwin.Rieger.ext
2015-02-03 1:48 ` ChenQi
@ 2015-02-03 9:23 ` Erwin.Rieger.ext
2015-02-04 2:47 ` ChenQi
1 sibling, 1 reply; 6+ messages in thread
From: Erwin.Rieger.ext @ 2015-02-03 9:23 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 4446 bytes --]
Hello,
thank you for your reply.
I have a working solution now, but it is not as clean as i would like it to be and some new questions arose with it.
My current setup consists of a busybox.bbappend file that is used to customize the rootfs
busybox (defconfig, some /etc files and so on) and a busybox-initramfs.bb recipe for the initramfs busybox (as you
suggested).
The busybox.bbappend (see below) is straight forward, so no problem with that.
To create the busybox-initramfs.bb in my custom layer, i have included the base busybox recipe from the meta layer with
an 'require' statement.
Then i had to extend the FILESEXTRAPATHS variable to point back to the base recipe files-directory since it
no longer found the SRC_URI files from meta/busybox.bb and meta/busybox.inc. See the BUSYBOXBASEDIR
variable in the busybox-initramfs.bb below.
I feel that his construct is not that elegant, so here comes the first question:
Is there a nicer/cleaner way to include/reference the source files from the base busybox recipe in the meta layer?
The second question concerns the versioning: The busybox.bbappend file uses a 'version wildcard' (_%) to
match all versions of the base busybox recipe. But in the busybox-initramfs.bb recipe i have to hardwire the
version of the base recipe.
How can i use a 'version wildcard' in a 'require' statement?
I've tried 'require recipes-core/busybox/busybox_%.bb' but that gives me a parse error so it seems not to be
possible to use version wildcards together with require/include.
My current busybox-initramfs.bb recipe:
-------------------------------------------------------------------
DESCRIPTION = "Use different busybox defconfig for initramfs."
# require recipes-core/busybox/busybox_1.22.1.bb
PV = "1.22.1"
require recipes-core/busybox/busybox_${PV}.bb
S = "${WORKDIR}/busybox-${PV}"
# Point FILESPATH to base busybox files dir
BUSYBOXBASEDIR = "${THISDIR}/../../../meta/recipes-core/busybox"
FILESEXTRAPATHS_prepend := "${BUSYBOXBASEDIR}/busybox:"
FILESEXTRAPATHS_prepend := "${BUSYBOXBASEDIR}/files:"
# Include our initramfs busybox defconfig
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
BUSYBOX_SPLIT_SUID = "0"
-------------------------------------------------------------------
The busybox_%.bbappend for the rootfs busybox:
-------------------------------------------------------------------
DESCRIPTION = "Customize busybox."
# Include our rootfs busybox defconfig
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI += " \
file://inetd.conf \
"
do_install_append() {
install ${WORKDIR}/inetd.conf ${D}${sysconfdir}
}
BUSYBOX_SPLIT_SUID = "0"
-------------------------------------------------------------------
Best Regards, Erwin Rieger
-----ChenQi <Qi.Chen@windriver.com> schrieb: -----
An: <Erwin.Rieger.ext@rohde-schwarz.com>, <yocto@yoctoproject.org>
Von: ChenQi <Qi.Chen@windriver.com>
Datum: 03.02.2015 02:48
Betreff: Re: [yocto] How to use different busybox defconfig's in the initramfs and rootfs image
The only way I know is to make a new recipe, busybox-initramfs.bb, for example.
Install busybox for image rootfs and busybox-initramfs for initramfs.
Best Regards,
Chen Qi
On 02/02/2015 09:21 PM, Erwin.Rieger.ext@rohde-schwarz.com wrote:
Hello list,
i have used Yocto to create a initramfs linux kernel and a corresponding rootfs for a embedded linux system.
Things are working as expected, so far.
Now i want to fine-tune my setup and want to use a different busybox configuration in the initramfs as the one in the rootfs image.
For example, the initramfs busybox should contain support for switch-root and that is not needed in the rootfs.
On the other hand, the rootfs should contain a "full-fledged" busybox (with inetd enabled, for example).
So the question is: How can i build/install a package two times with differing configurations in one bitbake run?.
How can this be done the Yocto-way without copying busybox.bb and hacking it the way i need it?
I've tried various combinations, e.g. bb-appending busybox, inheriting from busybox and so on - but to no avail.
Maybe someone have an idea on how to do that?
PS:
* The kernel recipe is derived (bbappend) from core-image-minimal-initramfs.
* Rootfs recipe is derived from core-image-minimal.bb.
--
Erwin Rieger
--
[-- Attachment #2: Type: text/html, Size: 15125 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to use different busybox defconfig's in the initramfs and rootfs image
2015-02-03 9:23 ` Erwin.Rieger.ext
@ 2015-02-04 2:47 ` ChenQi
2015-02-04 8:48 ` Paul Eggleton
2015-02-04 8:49 ` Paul Eggleton
0 siblings, 2 replies; 6+ messages in thread
From: ChenQi @ 2015-02-04 2:47 UTC (permalink / raw)
To: Erwin.Rieger.ext, yocto
[-- Attachment #1: Type: text/plain, Size: 5315 bytes --]
On 02/03/2015 05:23 PM, Erwin.Rieger.ext@rohde-schwarz.com wrote:
>
> Hello,
>
> thank you for your reply.
>
> I have a working solution now, but it is not as clean as i would like
> it to be and some new questions arose with it.
>
> My current setup consists of a busybox.bbappend file that is used to
> customize the rootfs
> busybox (defconfig, some /etc files and so on) and a
> busybox-initramfs.bb recipe for the initramfs busybox (as you
> suggested).
>
> The busybox.bbappend (see below) is straight forward, so no problem
> with that.
>
> To create the busybox-initramfs.bb in my custom layer, i have included
> the base busybox recipe from the meta layer with
> an 'require' statement.
>
> Then i had to extend the FILESEXTRAPATHS variable to point back to the
> base recipe files-directory since it
> no longer found the SRC_URI files from meta/busybox.bb and
> meta/busybox.inc. See the BUSYBOXBASEDIR
> variable in the busybox-initramfs.bb below.
>
> I feel that his construct is not that elegant, so here comes the
> f*irst question*:
>
> Is there a nicer/cleaner way to include/reference the source files
> from the base busybox recipe in the meta layer?
>
How about using "${COREBASE}/meta/recipes-core/busybox"? I didn't try it
out, so I'm not sure whether it works.
> The *second question* concerns the versioning: The busybox.bbappend
> file uses a 'version wildcard' (_%) to
> match all versions of the base busybox recipe. But in
> the busybox-initramfs.bb recipe i have to hardwire the
> version of the base recipe.
>
How about change the recipe name to busybox-initramfs_1.22.1.bb? So that
the PV value is automatically extracted from the recipe name and there's
no need to set it in the recipe.
> How can i use a 'version wildcard' in a 'require' statement?
>
It's not supported, as far as I know.
Best Regards,
Chen Qi
> I've tried 'require recipes-core/busybox/busybox_%.bb' but that gives
> me a parse error so it seems not to be
> possible to use version wildcards together with require/include.
>
>
> My current busybox-initramfs.bb recipe:
>
> -------------------------------------------------------------------
> DESCRIPTION = "Use different busybox defconfig for initramfs."
>
> # require recipes-core/busybox/busybox_1.22.1.bb
>
> PV = "1.22.1"
> require recipes-core/busybox/busybox_${PV}.bb
>
> S = "${WORKDIR}/busybox-${PV}"
>
> # Point FILESPATH to base busybox files dir
> BUSYBOXBASEDIR = "${THISDIR}/../../../meta/recipes-core/busybox"
> FILESEXTRAPATHS_prepend := "${BUSYBOXBASEDIR}/busybox:"
> FILESEXTRAPATHS_prepend := "${BUSYBOXBASEDIR}/files:"
>
> # Include our initramfs busybox defconfig
> FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
>
> BUSYBOX_SPLIT_SUID = "0"
> -------------------------------------------------------------------
>
>
>
> The busybox_%.bbappend for the rootfs busybox:
>
> -------------------------------------------------------------------
> DESCRIPTION = "Customize busybox."
>
> # Include our rootfs busybox defconfig
> FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
>
> SRC_URI += " \
> file://inetd.conf \
> "
>
> do_install_append() {
> install ${WORKDIR}/inetd.conf ${D}${sysconfdir}
> }
>
> BUSYBOX_SPLIT_SUID = "0"
> -------------------------------------------------------------------
>
>
> Best Regards, Erwin Rieger
>
>
>
> -----ChenQi <Qi.Chen@windriver.com> schrieb: -----
> An: <Erwin.Rieger.ext@rohde-schwarz.com>, <yocto@yoctoproject.org>
> Von: ChenQi <Qi.Chen@windriver.com>
> Datum: 03.02.2015 02:48
> Betreff: Re: [yocto] How to use different busybox defconfig's in the
> initramfs and rootfs image
>
> The only way I know is to make a new recipe, busybox-initramfs.bb, for
> example.
> Install busybox for image rootfs and busybox-initramfs for initramfs.
>
> Best Regards,
> Chen Qi
>
> On 02/02/2015 09:21 PM, Erwin.Rieger.ext@rohde-schwarz.com wrote:
>> Hello list,
>>
>> i have used Yocto to create a initramfs linux kernel and a
>> corresponding rootfs for a embedded linux system.
>>
>> Things are working as expected, so far.
>>
>> Now i want to fine-tune my setup and want to use a different busybox
>> configuration in the initramfs as the one in the rootfs image.
>> For example, the initramfs busybox should contain support for
>> switch-root and that is not needed in the rootfs.
>> On the other hand, the rootfs should contain a "full-fledged" busybox
>> (with inetd enabled, for example).
>>
>> So the question is: How can i build/install a package two times with
>> differing configurations in one bitbake run?.
>>
>> How can this be done the Yocto-way without copying busybox.bb and
>> hacking it the way i need it?
>>
>> I've tried various combinations, e.g. bb-appending busybox,
>> inheriting from busybox and so on - but to no avail.
>>
>> Maybe someone have an idea on how to do that?
>>
>>
>> PS:
>> * The kernel recipe is derived (bbappend)
>> from core-image-minimal-initramfs.
>> * Rootfs recipe is derived from core-image-minimal.bb.
>>
>>
>> --
>> Erwin Rieger
>> --
>>
>>
>
>
>
[-- Attachment #2: Type: text/html, Size: 22397 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to use different busybox defconfig's in the initramfs and rootfs image
2015-02-04 2:47 ` ChenQi
@ 2015-02-04 8:48 ` Paul Eggleton
2015-02-04 8:49 ` Paul Eggleton
1 sibling, 0 replies; 6+ messages in thread
From: Paul Eggleton @ 2015-02-04 8:48 UTC (permalink / raw)
To: Erwin.Rieger.ext; +Cc: yocto
On Wednesday 04 February 2015 10:47:37 ChenQi wrote:
> On 02/03/2015 05:23 PM, Erwin.Rieger.ext@rohde-schwarz.com wrote:
> > I have a working solution now, but it is not as clean as i would like
> > it to be and some new questions arose with it.
> >
> > My current setup consists of a busybox.bbappend file that is used to
> > customize the rootfs
> > busybox (defconfig, some /etc files and so on) and a
> > busybox-initramfs.bb recipe for the initramfs busybox (as you
> > suggested).
> >
> > The busybox.bbappend (see below) is straight forward, so no problem
> > with that.
> >
> > To create the busybox-initramfs.bb in my custom layer, i have included
> > the base busybox recipe from the meta layer with
> > an 'require' statement.
> >
> > Then i had to extend the FILESEXTRAPATHS variable to point back to the
> > base recipe files-directory since it
> > no longer found the SRC_URI files from meta/busybox.bb and
> > meta/busybox.inc. See the BUSYBOXBASEDIR
> > variable in the busybox-initramfs.bb below.
> >
> > I feel that his construct is not that elegant, so here comes the
> > f*irst question*:
> >
> > Is there a nicer/cleaner way to include/reference the source files
> > from the base busybox recipe in the meta layer?
>
> How about using "${COREBASE}/meta/recipes-core/busybox"? I didn't try it
> out, so I'm not sure whether it works.
You shouldn't need ${COREBASE}/meta/ - the following should work just fine
(which is already in busybox-initramfs.bb):
require recipes-core/busybox/busybox_${PV}.bb
> > The *second question* concerns the versioning: The busybox.bbappend
> > file uses a 'version wildcard' (_%) to
> > match all versions of the base busybox recipe. But in
> > the busybox-initramfs.bb recipe i have to hardwire the
> > version of the base recipe.
>
> How about change the recipe name to busybox-initramfs_1.22.1.bb? So that
> the PV value is automatically extracted from the recipe name and there's
> no need to set it in the recipe.
I think this is really the only practical way to handle this.
> > How can i use a 'version wildcard' in a 'require' statement?
>
> It's not supported, as far as I know.
It isn't, no.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to use different busybox defconfig's in the initramfs and rootfs image
2015-02-04 2:47 ` ChenQi
2015-02-04 8:48 ` Paul Eggleton
@ 2015-02-04 8:49 ` Paul Eggleton
1 sibling, 0 replies; 6+ messages in thread
From: Paul Eggleton @ 2015-02-04 8:49 UTC (permalink / raw)
To: Erwin.Rieger.ext; +Cc: yocto
On Wednesday 04 February 2015 10:47:37 ChenQi wrote:
> On 02/03/2015 05:23 PM, Erwin.Rieger.ext@rohde-schwarz.com wrote:
> > I have a working solution now, but it is not as clean as i would like
> > it to be and some new questions arose with it.
> >
> > My current setup consists of a busybox.bbappend file that is used to
> > customize the rootfs
> > busybox (defconfig, some /etc files and so on) and a
> > busybox-initramfs.bb recipe for the initramfs busybox (as you
> > suggested).
> >
> > The busybox.bbappend (see below) is straight forward, so no problem
> > with that.
> >
> > To create the busybox-initramfs.bb in my custom layer, i have included
> > the base busybox recipe from the meta layer with
> > an 'require' statement.
> >
> > Then i had to extend the FILESEXTRAPATHS variable to point back to the
> > base recipe files-directory since it
> > no longer found the SRC_URI files from meta/busybox.bb and
> > meta/busybox.inc. See the BUSYBOXBASEDIR
> > variable in the busybox-initramfs.bb below.
> >
> > I feel that his construct is not that elegant, so here comes the
> > f*irst question*:
> >
> > Is there a nicer/cleaner way to include/reference the source files
> > from the base busybox recipe in the meta layer?
>
> How about using "${COREBASE}/meta/recipes-core/busybox"? I didn't try it
> out, so I'm not sure whether it works.
You shouldn't need ${COREBASE}/meta/ - the following should work just fine
(which is already in busybox-initramfs.bb):
require recipes-core/busybox/busybox_${PV}.bb
> > The *second question* concerns the versioning: The busybox.bbappend
> > file uses a 'version wildcard' (_%) to
> > match all versions of the base busybox recipe. But in
> > the busybox-initramfs.bb recipe i have to hardwire the
> > version of the base recipe.
>
> How about change the recipe name to busybox-initramfs_1.22.1.bb? So that
> the PV value is automatically extracted from the recipe name and there's
> no need to set it in the recipe.
I think this is really the only practical way to handle this.
> > How can i use a 'version wildcard' in a 'require' statement?
>
> It's not supported, as far as I know.
It isn't, no.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-02-04 8:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 13:21 How to use different busybox defconfig's in the initramfs and rootfs image Erwin.Rieger.ext
2015-02-03 1:48 ` ChenQi
2015-02-03 9:23 ` Erwin.Rieger.ext
2015-02-04 2:47 ` ChenQi
2015-02-04 8:48 ` Paul Eggleton
2015-02-04 8:49 ` Paul Eggleton
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.