On Thu, Sep 5, 2013 at 1:50 AM, Paul D. DeRocco <pdero...@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"
_______________________________________________ yocto mailing list yocto@yoctoproject.org https://lists.yoctoproject.org/listinfo/yocto