[yocto] How to specify a default value for a variable in a recipe

Patrick Doyle wpdster at gmail.com
Fri Jun 13 06:08:41 PDT 2014


OK, I've got to ask this, because it totally confuses me.  I wrote a
recipe to build a custom application (gstreamer plugin, actually) that
I wanted to fetch from our SCM.  Bitbake told me I needed to specify a
source revision and even gave me a clue of what to put in.  Looking at
the development manual, I decided I wanted to use the latest revision
from our repository by default, so I added the following line to my
recipe:

SRCREV_default_pn-gstxbac = "${AUTOREV}"

But now I'm curious.  Why couldn't I use (I haven't tried this yet)

SRCREV_pn-gstxbac ?= "${AUTOREV}"

and even more confusingly, why isn't the syntax something more like:

SRCREV_pn-gstxbac_default = "${AUTOREV}"

What's going on here?

Does one syntax (BLAH_default vs BLAH ?=) get evaluated early in the
bitbake process and the other get evaluated late?

Does the location of the letters "default" in a variable name matter?

At some point, I really need to wrap my head around Bitbake, it's
syntax, and how it operates and internalize all of that.

--wpd



More information about the yocto mailing list