]> code.ossystems Code Review - openembedded-core.git/commitdiff
yocto-kernel: fix kmachine to deal with overrides
authorBruce Ashfield <bruce.ashfield@windriver.com>
Wed, 22 Dec 2010 21:29:28 +0000 (16:29 -0500)
committerSaul Wold <sgw@linux.intel.com>
Wed, 29 Dec 2010 06:47:52 +0000 (22:47 -0800)
BSPs are built from a particular branch of the kernel repository
which is specfied via the mapping of MACHINE to KMACHINE. Unless
a global branch is being forced (like libc headers), KMACHINE
is an override on a per machine basis.

Because KMACHINE is typically override we must first try the
most specific variant KMACHINE_<machine> and if that is undefined
look for a fallack default. This allows any combination of
variables to work (and at the time the anonymous python
executes) safely and get us a properly defined branch for the
fetcher and build.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
meta/classes/kernel-yocto.bbclass

index f5418782b0d00bb9a7b7dfb851125e7e7979dc4b..7ebe5d69aaa616deb79e334b0821d7a1ebdfffca 100644 (file)
@@ -29,10 +29,13 @@ python __anonymous () {
         # The branch for a build is:
         #    yocto/<kernel type>/${KMACHINE} or
         #    yocto/<kernel type>/${KMACHINE}/base
-        bb.data.setVar("KBRANCH", bb.data.expand("${KMACHINE}",d), d)
+        mach = bb.data.getVar("KMACHINE_" + bb.data.expand("${MACHINE}",d), d, 1)
+        if mach == None:
+             mach = bb.data.getVar("KMACHINE", d, 1)
+
+        bb.data.setVar("KBRANCH", mach, d)
         bb.data.setVar("KMETA", "meta", d)
 
-        mach = bb.data.getVar("KMACHINE", d, 1)
         # drop the "/base" if it was on the KMACHINE
         kmachine = mach.replace('/base','')
         # drop everything but the last segment