[yocto] How to use different busybox defconfig's in the initramfs and rootfs image

Paul Eggleton paul.eggleton at linux.intel.com
Wed Feb 4 00:48:44 PST 2015


On Wednesday 04 February 2015 10:47:37 ChenQi wrote:
> On 02/03/2015 05:23 PM, Erwin.Rieger.ext at 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



More information about the yocto mailing list