Skip to contentSkip to conversation

trying to clarify PREFERRED_VERSION processing

DISCUSSION Robert P. J. Day 1 participant 1 message Jun 18, 2014

lore
Share & tools
lore
#0 lore raw

still working my way through the bitbake user manual, currently in
section 2.3, "Preferences and Providers", and i think this section is unnecessarily confusing as it tries to discuss both preferences and providers at the same time, which i think are two separate concepts that should be covered independently, so let me ask some questions about just PREFERRED_VERSION processing using an actual example ripped from the oe/poky codebase.

(side note: i'm writing up a bunch of examples of bitbake processing
for my courses and, rather than use generic labels like "foo" and "bar", i want to use actual examples from the codebase so i can show the results with things like "bitbake -s".)

consider (from my poky checkout) the two possibilities for the
busybox recipe:

busybox_1.22.1.bb
busybox_git.bb

obviously, there are two versions available to me and, if i examine the respective .bb files, i can see in the git version:

DEFAULT_PREFERENCE = "-1"

making that the *unpreferred* version. let's verify that with "bitbake -s" (using my build for beaglebone/core-image-minimal):

$ bitbake -s
...
busybox                                           :1.22.1-r32
...
$

good, that's what i expected -- the fixed version recipe is the one
that would be selected. now say i wanted to use the other (git) version, what would be the appropriate line i would add to local.conf? it seems i can just use wildcarding, as in:

PREFERRED_VERSION_busybox = "1.22.1+git%"

at which point i can see:

$ bitbake -s
...
busybox                                           :1.22.1-r32 :1.22.1+gitAUTOINC+d9e0c438e1-r0
...
$

from what i read from "bitbake -h", what is being printed is the
"current" version, followed by the "preferred" version, so i'm interpreting that as the first value would be the version selected if i didn't override it, and the second value is the version that will actually be used given that i've explicitly preferred a version for that recipe. is that the proper way to describe that?

also, what would be the proper PREFERRED_VERSION line in my
local.conf if i wanted to prefer *precisely* that git version of busybox? i know wildcarding works, as in:

PREFERRED_VERSION_busybox = "1.22.1+git%"

but what value would i use to match *precisely* that git-based version? something involving SRCREV or SRCPV or something like that?

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================