summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2011-02-08 21:46:45 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-09 11:11:07 +0000
commit9ce72c28bb1e85062cde227bc0c71962286a4d44 (patch)
tree13a8e83e8c0a012e5c43f9bde3be44b57f0c1636 /meta/classes/kernel-yocto.bbclass
parent3150c5a0c210da6bce9ccd3d1a110a4d7058166d (diff)
downloadpoky-9ce72c28bb1e85062cde227bc0c71962286a4d44.tar.gz
linux-yocto: streamline BSP bootstrapping
In order to build BSPs that were not already integrated into the upstream linux yocto kernel AND keep the git fetcher happy, some fairly complex anonymous python sections were required. These sections cause problems with variable expansion and SRCREV processing. With the updated git fetcher code, we can streamline the BSP boostrapping process and drop 99% of the anonymous python code. This commit has the following changes to support BSP boot strapping and simplication for existing BSPs. - KMETA is set per-recipe rather than in python code - undefined machines are no longer used, but instead common branch names are set per-recipe - fallback machine SRCREVs are present in the default revisions file - A new variable YOCTO_KERNEL_EXTERNAL_BRANCH should be set in the local.conf for new BSPs instead of being programatically determined in the anonymous python. - No more explicity KMACHINE variable expansion and manipulation, since the tools and build phases no longer require it due to the per-recipe fallbacks. Integrated/merged BSPs are unaffected by the changes and have been regression tested. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> foo Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass71
1 files changed, 10 insertions, 61 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 4c52bca43a..15802fabdf 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -1,61 +1,5 @@
1S = "${WORKDIR}/linux" 1S = "${WORKDIR}/linux"
2 2
3# Determine which branch to fetch and build. Not all branches are in the
4# upstream repo (but will be locally created after the fetchers run) so
5# a fallback branch needs to be chosen.
6#
7# The default machine 'UNDEFINED'. If the machine is not set to a specific
8# branch in this recipe or in a recipe extension, then we fallback to a
9# branch that is always present 'standard'. This sets the KBRANCH variable
10# and is used in the SRC_URI. The machine is then set back to ${MACHINE},
11# since futher processing will use that to create local branches
12
13SRCPV_prepend = "${@yoctokernel_variables_fixup(d)}"
14
15def yoctokernel_variables_fixup(d):
16 if d.getVar("PVFIXUPDONE", False) is "done":
17 return ""
18
19 import bb, re, string
20
21 version = bb.data.getVar("LINUX_VERSION", d, 1)
22 # 2.6.34 signifies the old-style tree, so we need some temporary
23 # conditional processing based on the kernel version.
24 if version == "2.6.34":
25 bb.data.setVar("KBRANCH", "${KMACHINE}-${LINUX_KERNEL_TYPE}", d)
26 bb.data.setVar("KMETA", "wrs_meta", d)
27 mach = bb.data.getVar("KMACHINE", d, 1)
28 if mach == "UNDEFINED":
29 bb.data.setVar("KBRANCH", "standard", d)
30 bb.data.setVar("KMACHINE", "${MACHINE}", d)
31 # track the global configuration on a bootstrapped BSP
32 bb.data.setVar("SRCREV_machine", "${SRCREV_meta}", d)
33 bb.data.setVar("BOOTSTRAP", bb.data.expand("${MACHINE}",d) + "-standard", d)
34 else:
35 # The branch for a build is:
36 # yocto/<kernel type>/${KMACHINE} or
37 # yocto/<kernel type>/${KMACHINE}/base
38 mach = bb.data.getVar("KMACHINE_" + bb.data.expand("${MACHINE}",d), d, 1)
39 if mach == None:
40 mach = bb.data.getVar("KMACHINE", d, 1)
41
42 bb.data.setVar("KBRANCH", mach, d)
43 bb.data.setVar("KMETA", "meta", d)
44
45 # drop the "/base" if it was on the KMACHINE
46 kmachine = mach.replace('/base','')
47 # drop everything but the last segment
48 kmachine = os.path.basename( kmachine )
49 # and then write KMACHINE back
50 bb.data.setVar('KMACHINE_' + bb.data.expand("${MACHINE}",d), kmachine, d)
51
52 if mach == "UNDEFINED":
53 bb.data.setVar('KMACHINE_' + bb.data.expand("${MACHINE}",d), bb.data.expand("${MACHINE}",d), d)
54 bb.data.setVar("KBRANCH", "yocto/standard/base", d)
55 bb.data.setVar("BOOTSTRAP", "yocto/standard/" + bb.data.expand("${MACHINE}",d), d)
56 d.setVar("PVFIXUPDONE", "done")
57 return ""
58
59do_patch() { 3do_patch() {
60 cd ${S} 4 cd ${S}
61 if [ -f ${WORKDIR}/defconfig ]; then 5 if [ -f ${WORKDIR}/defconfig ]; then
@@ -63,12 +7,11 @@ do_patch() {
63 fi 7 fi
64 8
65 kbranch=${KBRANCH} 9 kbranch=${KBRANCH}
66 if [ -n "${BOOTSTRAP}" ]; then 10 if [ -n "${YOCTO_KERNEL_EXTERNAL_BRANCH}" ]; then
67 # switch from a generic to a specific branch 11 # switch from a generic to a specific branch
68 kbranch=${BOOTSTRAP} 12 kbranch=${YOCTO_KERNEL_EXTERNAL_BRANCH}
69 fi 13 fi
70 14
71
72 # simply ensures that a branch of the right name has been created 15 # simply ensures that a branch of the right name has been created
73 createme ${ARCH} ${kbranch} ${defconfig} 16 createme ${ARCH} ${kbranch} ${defconfig}
74 if [ $? -ne 0 ]; then 17 if [ $? -ne 0 ]; then
@@ -131,8 +74,14 @@ addtask kernel_checkout before do_patch after do_unpack
131do_kernel_configme() { 74do_kernel_configme() {
132 echo "[INFO] doing kernel configme" 75 echo "[INFO] doing kernel configme"
133 76
77 kbranch=${KBRANCH}
78 if [ -n "${YOCTO_KERNEL_EXTERNAL_BRANCH}" ]; then
79 # switch from a generic to a specific branch
80 kbranch=${YOCTO_KERNEL_EXTERNAL_BRANCH}
81 fi
82
134 cd ${S} 83 cd ${S}
135 configme --reconfig --output ${B} ${KBRANCH} ${MACHINE} 84 configme --reconfig --output ${B} ${kbranch} ${MACHINE}
136 if [ $? -ne 0 ]; then 85 if [ $? -ne 0 ]; then
137 echo "ERROR. Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}" 86 echo "ERROR. Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}"
138 exit 1 87 exit 1
@@ -165,7 +114,7 @@ do_validate_branches() {
165 target_meta_head="${SRCREV_meta}" 114 target_meta_head="${SRCREV_meta}"
166 115
167 # nothing to do if bootstrapping 116 # nothing to do if bootstrapping
168 if [ -n "${BOOTSTRAP}" ]; then 117 if [ -n "${YOCTO_KERNEL_EXTERNAL_BRANCH}" ]; then
169 return 118 return
170 fi 119 fi
171 120