[oe] the awkwardness of using core-image.bbclass
Robert P. J. Day
rpjday at crashcourse.ca
Fri Jul 11 16:51:54 UTC 2014
some observations/questions on core-image.bbclass, and whether it
can be used more understandably. this is being written from the
perspective of someone who has had the occasional student ask, "why
was it done *that* way?"
so here's the important part of core-image.bbclass:
CORE_IMAGE_BASE_INSTALL = '\
packagegroup-core-boot \
packagegroup-base-extended \
\
${CORE_IMAGE_EXTRA_INSTALL} \
'
CORE_IMAGE_EXTRA_INSTALL ?= ""
IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}"
inherit image
whose job is obviously to define the final contents in IMAGE_INSTALL
to be handed off to image.bbclass. so far, so good. but notice first
that while IMAGE_INSTALL and CORE_IMAGE_EXTRA_INSTALL are weakly
assigned, CORE_IMAGE_BASE_INSTALL is *not*, which -- if one is
perusing that file -- strongly suggests that if you're inheriting
from this class file, you really should use that value. but it doesn't
work that way.
first, here's (the relevant parts of) core-image-base.bb:
IMAGE_FEATURES += "splash"
inherit core-image
that's perfect -- define an additional feature, then pull in
core-image to take care of the rest. perfectly understandable.
core-image-minimal.bb is *not* so clean:
IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
inherit core-image
i consider this recipe file potentially confusing since, although it
inherits core-image, it effectively stomps on the settings in there,
and just rams an overriding value into IMAGE_INSTALL. in short, rather
than "inheriting" cleanly from core-image and extending or enhancing
the recipe, core-image-mimimal simply kicks IMAGE_INSTALL out of the
way and sets its own final value.
a final issue is, if you define a new core-image variation and
simply want to add some extra packages to it, what's the proper way to
do that? at first glance, i might have just created a new .bb file and
assigned some extra package names to CORE_IMAGE_EXTRA_INSTALL,
wouldn't that work? but the ref manual states quite clearly that you
are supposed to use that variable *only* in your local.conf file? any
reason for that?
as i read it, the accepted way is to use:
IMAGE_INSTALL += "mtd-utils"
but is there some reason one can't use CORE_IMAGE_EXTRA_INSTALL from
within a recipe file? it seems like that would make recipe files
easier to read.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
More information about the Openembedded-devel
mailing list