[oe] [RFC] A case of distro config overriding DISTRO var

Paul Sokolovsky pmiscml at gmail.com
Tue Jan 29 00:31:05 UTC 2008


Hello Richard,

On Mon, 28 Jan 2008 23:22:50 +0000
Richard Purdie <rpurdie at rpsys.net> wrote:

> On Tue, 2008-01-29 at 01:16 +0200, Paul Sokolovsky wrote:
> > I'd like to know what's the idea behind overriding DISTRO var from
> > the value being set by user? For example, angstrom.inc does:
> > 
> > DISTRO = "angstrom" 
> 
> It means that the override in active use becomes "angstrom" and we
> don't have 1001 different overrides (angstrom2007, angstrom1008 etc.)
> all over the tree.

That means that we use the same var for 2 different purposes, and
that's where problem is.

> 
> > The problem with is that real distro name is lost, as thus
> > cannot be passed to some other tool (e.g., bbimage).
> > 
> > If there're good reasons to do that, and we would be lazy enough to
> > convert to something like: DISTRO_FOO = "${DISTRO}" in bitbake.conf,
> > and let those good reasons apply to DISTRO_FOO, which must replace
> > DISTRO in the appropriate places, then I at least propose to do:
> > 
> > DISTRO_ORIGINAL := "${DISTRO}"
> > 
> > in bitbake.conf, so we always have real distro config name handy.
> 
> What you didn't say is where exactly in bitbake.conf you are going to
> define that?
> 
> You need to put the := directly before the code that changes DISTRO.
> Yes, you could add this in bitbake.conf after local.conf and before
> including ${DISTRO}.conf but that seems ugly to me.

Ugly (or better, unclean) is to reuse top-level input parameter from
user for different purpose. So, at first, the meaning of DISTRO is
"name of the distro config", and then suddenly it changes to "value to
use for overrides, etc". The second use should have different name then,
as again, DISTRO is user's primary input param for OE. That would be
clean solution...

> 
> I'd prefer USERDISTRO = "${DISTRO}" in bitbake.conf and then having
> angstrom overriding that using := if it really has to...

... But as we don't want to revamp OE up to that level ;-), then we
should find good place to work that around. The issue here is that
overriding DISTRO is common practice, we even have pe(a)rls like:

DISTRO = "Jornada Linux Mobility Edition"

So, it should be worked around on OE's level (== bitbake.conf), not on
distro's level.

Also, what's exactly ugly? ":="? Then we for sure should make exception
for bitbake.conf, simply because := is unavoidable for meta-stuff, and
bitbake.conf already has bunch of them. IMHO, it's uglier to have
something defined as "=" in bitbake.conf, and require distro to
override that with ":=".

So the patch I have now below. It assumes that local.conf is what may
set DISTRO, so captures it after that.


--- conf/bitbake.conf   5044eed5572b1c9c12c31cf7952ccedc1648524c
+++ conf/bitbake.conf   d28d0f5816ecef6736cc0b1cd2b48ce41d4a656e
@@ -529,6 +531,8 @@ include conf/local.conf
 include conf/site.conf
 include conf/auto.conf
 include conf/local.conf
+# DISTRO may be overriden, so preserve real config name
+DISTRO_ORIGINAL := "${DISTRO}"
 include conf/build/${BUILD_SYS}.conf
 include conf/target/${TARGET_SYS}.conf
 include conf/machine/${MACHINE}.conf

--- classes/image.bbclass       4d92381733b09bae07a07da35bd0024744924c3c
+++ classes/image.bbclass       dbdb61a027253ac692cf3fb722fd4a3549d31f78
@@ -90,6 +90,7 @@ fakeroot do_rootfs () {
        ${IMAGE_PREPROCESS_COMMAND}
 
        export TOPDIR=${TOPDIR}
+       export DISTRO=${DISTRO_ORIGINAL}
        export MACHINE=${MACHINE}
 
        for type in ${IMAGE_FSTYPES}; do


> 
> Regards,
> 
> Richard
> 




More information about the Openembedded-devel mailing list