From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 4C05CE0083A; Tue, 3 Feb 2015 18:47:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, HTML_FONT_FACE_BAD, HTML_MESSAGE,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [147.11.1.11 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 1.0 HTML_FONT_FACE_BAD BODY: HTML font face is not a word Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id ED567E0076F for ; Tue, 3 Feb 2015 18:47:49 -0800 (PST) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.9/8.14.5) with ESMTP id t142ldS2013039 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 3 Feb 2015 18:47:39 -0800 (PST) Received: from [128.224.162.226] (128.224.162.226) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 3 Feb 2015 18:47:38 -0800 Message-ID: <54D18849.7020003@windriver.com> Date: Wed, 4 Feb 2015 10:47:37 +0800 From: ChenQi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: , References: <54D028EC.3010001@windriver.com>, In-Reply-To: X-Originating-IP: [128.224.162.226] Subject: Re: How to use different busybox defconfig's in the initramfs and rootfs image X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2015 02:47:54 -0000 Content-Type: multipart/alternative; boundary="------------080305060604010200050105" --------------080305060604010200050105 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit 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 schrieb: ----- > An: , > Von: ChenQi > 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 >> -- >> >> > > > --------------080305060604010200050105 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: 8bit
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 first 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 += " \
    "

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






--------------080305060604010200050105--