From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Tom Rini <tom.rini@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] image.bbclass: Ensure IMAGE_FSTYPES is fully evaluated before live/live logic
Date: Fri, 27 Jun 2014 15:54:30 +0100 [thread overview]
Message-ID: <1403880870.28648.11.camel@ted> (raw)
In-Reply-To: <20140627141649.GT9006@bill-the-cat>
On Fri, 2014-06-27 at 10:16 -0400, Tom Rini wrote:
> On Fri, Jun 27, 2014 at 02:40:44PM +0100, Richard Purdie wrote:
> > On Thu, 2014-06-26 at 08:27 -0400, Tom Rini wrote:
> > > Incase we have overrides applied to IMAGE_FSTYPES we need to make sure
> > > that we evaluate it fully before performing the live and vmdk logic
> > > checks.
> > >
> > > Signed-off-by: Tom Rini <tom.rini@gmail.com>
> > > ---
> > > meta/classes/image.bbclass | 9 +++++----
> > > 1 file changed, 5 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> > > index 79de5a2..ccfa1b1 100644
> > > --- a/meta/classes/image.bbclass
> > > +++ b/meta/classes/image.bbclass
> > > @@ -78,10 +78,11 @@ do_rootfs[vardeps] += "BAD_RECOMMENDATIONS NO_RECOMMENDATIONS"
> > >
> > > do_build[depends] += "virtual/kernel:do_deploy"
> > >
> > > +EVALED_IMAGE_FSTYPES := "${IMAGE_FSTYPES}"
> > > def build_live(d):
> > > - if base_contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
> > > - d.setVar('NOISO', base_contains('IMAGE_FSTYPES', "iso", "0", "1", d))
> > > - d.setVar('NOHDD', base_contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
> > > + if base_contains("EVALED_IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
> > > + d.setVar('NOISO', base_contains('EVALED_IMAGE_FSTYPES', "iso", "0", "1", d))
> > > + d.setVar('NOHDD', base_contains('EVALED_IMAGE_FSTYPES', "hddimg", "0", "1", d))
> > > if d.getVar('NOISO', True) == "0" or d.getVar('NOHDD', True) == "0":
> > > return "image-live"
> > > return ""
> >
> > The trouble is this doesn't add up.
> >
> > EVALED_IMAGE_FSTYPES := "${IMAGE_FSTYPES}"
> >
> > basically sets EVALED_... to the expanded value of IMAGE_FSTYPES
> >
> > base_contains() also expands the variable its passed.
> >
> > I'm a little concerned as to why those two expansions of the same thing
> > should result in something different.
>
> Well, they're happening at different parts in the parse. The vmdk
> example is clearer I think since it's not another "big" python function.
>
> > From your later explaination, it would appear the use of the override is
> > causing problems but I don't understand how immediate expansion would
> > work around that :/.
> >
> > So before this merges, more investigation is needed as there is
> > something not adding up...
>
> Well, I think the high level answer is that no, we aren't applying
> OVERRIDES at the point when we're parsing classes still rather than a
> specific task. Adding an immediate eval at this level does force things
> and then we see what we're supposed to. My gut feeling here is that if
> we poke deeply enough at base_contains we'll see that we aren't passing
> along the expand flag when we thought we were.
I wondered about that but I did already check and:
http://git.yoctoproject.org/cgit.cgi/poky/tree/bitbake/lib/bb/utils.py
def contains(variable, checkvalues, truevalue, falsevalue, d):
val = d.getVar(variable, True)
so it is being expanded afaict...
Cheers,
Richard
next prev parent reply other threads:[~2014-06-27 14:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-26 12:27 [PATCH] image.bbclass: Ensure IMAGE_FSTYPES is fully evaluated before live/live logic Tom Rini
2014-06-26 17:25 ` Otavio Salvador
2014-06-27 12:42 ` Tom Rini
2014-06-27 13:11 ` Otavio Salvador
2014-06-27 13:40 ` Richard Purdie
2014-06-27 14:16 ` Tom Rini
2014-06-27 14:54 ` Richard Purdie [this message]
2014-06-27 15:17 ` Tom Rini
2014-06-28 8:35 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403880870.28648.11.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=tom.rini@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox