[yocto] Can anything be done about do_rootfs speed?

Nicolas Dechesne nicolas.dechesne at linaro.org
Wed Sep 4 23:56:22 PDT 2013


On Thu, Sep 5, 2013 at 1:50 AM, Paul D. DeRocco <pderocco at ix.netcom.com>wrote:

> > From: Samuel Stirtzel
> >
> > If you change:
> >
> > COMPRESS_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}.rootfs.${type} >
> > ${IMAGE_NAME}.rootfs.${type}.gz"
> > COMPRESS_CMD_bz2 = "bzip2 -f -k ${IMAGE_NAME}.rootfs.${type}"
> >
> > in [...]/meta/classes/image_types.bbclass, then can try
> > pbzip2 / pigz.
>
> This raises a question that has come up for me before: is there a way to
> override something in a .bbclass, without just editing the file and
> therefore losing it whenever new metadata is released?
>

yes, you can ;-)


>  I really have
> little sense of the order in which things are read or obeyed in the whole
> bitbake process. Those variables look like they're read by the
> get_imagecmds() script; is there an opportunity for a recipe to change the
> value of COMPRESS_CMD_gz or _bz2 after it's defined, but before that
> script gets called?
>

there are 2 types of 'files'. Configuration files and recipes (.bb,
.bbclass, .bbappend). Configuration files are read in the order defined in
meta/conf/bitbake.conf (see toward the end, all .conf files are being
included). The order there will dicdacte "who overrides what". Then you can
use the various operators ( =, ?=, +=, ...).

For 'recipes' my understanding is that they are parsed line by line from
the beginning of the .bb file till the end. When reading a .bb file when
the parser encounters a 'require/include' or a 'inherit' it then parses the
corresponding file.

in your specific case, COMPRESS_CMD_gz is set in
 meta/classes/image_types.bbclass, which is inherited in image.bbclass. So
if you want to override it, you need to do it *after* your inherit "image"
in your own image .bb file (or core-image, if that's what you use).

you can how bitbake parsed a variable with:

bitbake -e <image> | grep ^VARIABLE.

E.g. in my image, after adding:

inherit core-image
+COMPRESS_CMD_gz="my_own_gz"



$ bitbake -e my-generic-image | grep ^COMPRESS_CMD_gz
COMPRESS_CMD_gz="my_own_gz"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20130905/5f564ce9/attachment.html>


More information about the yocto mailing list