aboutsummaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2010-11-11 01:23:38 -0500
committerSaul Wold <sgw@linux.intel.com>2010-11-14 21:08:28 -0800
commit9aaa15c8edf8100da452f989f4eaa10406e5a28e (patch)
tree65fb34b4724ad79e472f7bfd7f0e7294799aff3b /meta
parent0ec9475c6f37015e55735e41bb664476917afb65 (diff)
downloadopenembedded-core-contrib-9aaa15c8edf8100da452f989f4eaa10406e5a28e.tar.gz
linux-wrs: implement BSP bootstrapping via fallback branches
When creating a new BSP there isn't always an upstream branch to validate SRCREVs against. Therefore, creating a new BSP required extra manipulations of the git repository, even though the branch for the build would be dynamically created. To fix this, provide a fallback to the 'standard' branch if WRMACHINE is not assigned a specific value for the given MACHINE. The fallback saved in KBRANCH, and represents the branch that we should build, even if no fallback is required. Some substeps of the recipe have been updated to use KBRANCH rather than enforcing MACHINE-KERNELTYPE. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-kernel/linux/linux-wrs_git.bb40
1 files changed, 32 insertions, 8 deletions
diff --git a/meta/recipes-kernel/linux/linux-wrs_git.bb b/meta/recipes-kernel/linux/linux-wrs_git.bb
index 1f2b11e975..209648b8e7 100644
--- a/meta/recipes-kernel/linux/linux-wrs_git.bb
+++ b/meta/recipes-kernel/linux/linux-wrs_git.bb
@@ -10,10 +10,10 @@ PV = "2.6.34+git${SRCPV}"
# To use a staged, on-disk bare clone of a Wind River Kernel, use a
# variant of the below
# SRC_URI = "git://///path/to/kernel/default_kernel.git;fullclone=1"
-SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${WRMACHINE}-${LINUX_KERNEL_TYPE};name=machine \
+SRC_URI = "git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;fullclone=1;branch=${KBRANCH};name=machine \
git://git.pokylinux.org/linux-2.6-windriver.git;protocol=git;noclone=1;branch=wrs_meta;name=meta"
-WRMACHINE = "${MACHINE}"
+WRMACHINE = "UNDEFINED"
WRMACHINE_qemux86 = "common_pc"
WRMACHINE_qemux86-64 = "common_pc_64"
WRMACHINE_qemuppc = "qemu_ppc32"
@@ -24,11 +24,33 @@ WRMACHINE_routerstationpro = "routerstationpro"
WRMACHINE_mpc8315e-rdb = "fsl-mpc8315e-rdb"
WRMACHINE_beagleboard = "beagleboard"
+# Determine which branch to fetch and build. Not all branches are in the
+# upstream repo (but will be locally created after the fetchers run) so
+# a fallback branch needs to be chosen.
+#
+# The default machine 'UNDEFINED'. If the machine is not set to a specific
+# branch in this recipe or in a recipe extension, then we fallback to a
+# branch that is always present 'standard'. This sets the KBRANCH variable
+# and is used in the SRC_URI. The machine is then set back to ${MACHINE},
+# since futher processing will use that to create local branches
+python __anonymous () {
+ import bb, re
+
+ bb.data.setVar("KBRANCH", "${WRMACHINE}-${LINUX_KERNEL_TYPE}", d)
+ mach = bb.data.getVar("WRMACHINE", d, 1)
+ if mach == "UNDEFINED":
+ bb.data.setVar("KBRANCH", "standard", d)
+ bb.data.setVar("WRMACHINE", "${MACHINE}", d)
+ # track the global configuration on a bootstrapped BSP
+ bb.data.setVar("SRCREV_machine", "${SRCREV_meta}", d)
+ bb.data.setVar("BOOTSTRAP", "t", d)
+}
+
COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemux86-64|atom-pc|routerstationpro|mpc8315e-rdb|beagleboard)"
LINUX_VERSION = "v2.6.34"
LINUX_VERSION_EXTENSION = "-wr-${LINUX_KERNEL_TYPE}"
-PR = "r12"
+PR = "r13"
S = "${WORKDIR}/linux"
B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build"
@@ -69,7 +91,7 @@ do_patch() {
}
validate_branches() {
- branch_head=`git show-ref -s --heads ${WRMACHINE}-${LINUX_KERNEL_TYPE}`
+ branch_head=`git show-ref -s --heads ${KBRANCH}`
meta_head=`git show-ref -s --heads wrs_meta`
target_branch_head="${SRCREV_machine}"
target_meta_head="${SRCREV_meta}"
@@ -132,14 +154,16 @@ IFS='
cd ${S}
# checkout and clobber and unimportant files
- git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE}
-
- validate_branches
+ git checkout -f ${KBRANCH}
+
+ if [ -z "${BOOTSTRAP}" ]; then
+ validate_branches
+ fi
# this second checkout is intentional, we want to leave ourselves
# on the branch to be built, but validate_branches could have changed
# our initial checkout. So we do it a second time to be sure
- git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE}
+ git checkout -f ${KBRANCH}
}
do_wrlinux_checkout[dirs] = "${S}"