summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2015-07-21 11:21:04 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-25 14:41:44 +0100
commitc29aac6a8b5b417ad46f3cdf9c1a2d61c4f6cdd5 (patch)
tree58976b68efd8acddecc7fc7b8975ed25f3294fd3 /meta/classes/kernel-yocto.bbclass
parent741a44c06b1e53b641f2a5c48985a81e3c1e27cf (diff)
downloadpoky-c29aac6a8b5b417ad46f3cdf9c1a2d61c4f6cdd5.tar.gz
linux-yocto: split meta data from kernel repository
The linux-yocto tree has always been a combined set of kernel changes and configuration (meta) data carried in a single tree. While this format is effective at keeping kernel configuration and source modifications synchronized, it isn't always obvious to developers on how to manipulate the meta data versus the source. With this change, we remove the meta data processing from the kernel-yocto class and use the external meta-data repository that has always been used to seed the linux-yocto meta branch. After this change, linux-yocto can no longer process combined trees, and is simplified as a result. (From OE-Core rev: 523e4f6a6913b64453579d27a02467e14f7df42e) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass76
1 files changed, 5 insertions, 71 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 2f9a41f34d..231e08deba 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -33,6 +33,7 @@ def find_kernel_feature_dirs(d):
33 for url in fetch.urls: 33 for url in fetch.urls:
34 urldata = fetch.ud[url] 34 urldata = fetch.ud[url]
35 parm = urldata.parm 35 parm = urldata.parm
36 type=""
36 if "type" in parm: 37 if "type" in parm:
37 type = parm["type"] 38 type = parm["type"]
38 if "destsuffix" in parm: 39 if "destsuffix" in parm:
@@ -112,17 +113,6 @@ do_kernel_metadata() {
112 fi 113 fi
113 fi 114 fi
114 115
115 # if we have a defined/set meta branch we should not be generating
116 # any meta data. The passed branch has what we need.
117 if [ -n "${KMETA}" ]; then
118 createme_flags="--disable-meta-gen --meta ${KMETA}"
119 fi
120
121 createme -v -v ${createme_flags} ${ARCH} ${machine_branch}
122 if [ $? -ne 0 ]; then
123 bbfatal_log "Could not create ${machine_branch}"
124 fi
125
126 sccs="$sccs ${@" ".join(find_sccs(d))}" 116 sccs="$sccs ${@" ".join(find_sccs(d))}"
127 patches="${@" ".join(find_patches(d))}" 117 patches="${@" ".join(find_patches(d))}"
128 feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}" 118 feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
@@ -189,34 +179,18 @@ do_patch() {
189do_kernel_checkout() { 179do_kernel_checkout() {
190 set +e 180 set +e
191 181
192 # A linux yocto SRC_URI should use the bareclone option. That
193 # ensures that all the branches are available in the WORKDIR version
194 # of the repository.
195 source_dir=`echo ${S} | sed 's%/$%%'` 182 source_dir=`echo ${S} | sed 's%/$%%'`
196 source_workdir="${WORKDIR}/git" 183 source_workdir="${WORKDIR}/git"
197 if [ -d "${WORKDIR}/git/" ] && [ -d "${WORKDIR}/git/.git" ]; then 184 if [ -d "${WORKDIR}/git/" ]; then
198 # case2: the repository is a non-bare clone 185 # case: git repository (bare or non-bare)
199
200 # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree. 186 # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
201 if [ "${source_dir}" != "${source_workdir}" ]; then 187 if [ "${source_dir}" != "${source_workdir}" ]; then
202 rm -rf ${S} 188 rm -rf ${S}
203 mv ${WORKDIR}/git ${S} 189 mv ${WORKDIR}/git ${S}
204 fi 190 fi
205 cd ${S} 191 cd ${S}
206 elif [ -d "${WORKDIR}/git/" ] && [ ! -d "${WORKDIR}/git/.git" ]; then
207 # case2: the repository is a bare clone
208
209 # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
210 if [ "${source_dir}" != "${source_workdir}" ]; then
211 rm -rf ${S}
212 mkdir -p ${S}/.git
213 mv ${WORKDIR}/git/* ${S}/.git
214 rm -rf ${WORKDIR}/git/
215 fi
216 cd ${S}
217 git config core.bare false
218 else 192 else
219 # case 3: we have no git repository at all. 193 # case: we have no git repository at all.
220 # To support low bandwidth options for building the kernel, we'll just 194 # To support low bandwidth options for building the kernel, we'll just
221 # convert the tree to a git repo and let the rest of the process work unchanged 195 # convert the tree to a git repo and let the rest of the process work unchanged
222 196
@@ -235,7 +209,6 @@ do_kernel_checkout() {
235 git commit -q -m "baseline commit: creating repo for ${PN}-${PV}" 209 git commit -q -m "baseline commit: creating repo for ${PN}-${PV}"
236 git clean -d -f 210 git clean -d -f
237 fi 211 fi
238 # end debare
239 212
240 # convert any remote branches to local tracking ones 213 # convert any remote branches to local tracking ones
241 for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do 214 for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
@@ -246,24 +219,8 @@ do_kernel_checkout() {
246 fi 219 fi
247 done 220 done
248 221
249 # If KMETA is defined, the branch must exist, but a machine branch
250 # can be missing since it may be created later by the tools.
251 if [ -n "${KMETA}" ]; then
252 git show-ref --quiet --verify -- "refs/heads/${KMETA}"
253 if [ $? -eq 1 ]; then
254 bberror "The branch '${KMETA}' is required and was not found"
255 bberror "Ensure that the SRC_URI points to a valid linux-yocto"
256 bbfatal_log "kernel repository"
257 fi
258 fi
259
260
261 # Create a working tree copy of the kernel by checking out a branch 222 # Create a working tree copy of the kernel by checking out a branch
262 machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}" 223 machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
263 git show-ref --quiet --verify -- "refs/heads/${machine_branch}"
264 if [ $? -ne 0 ]; then
265 machine_branch="master"
266 fi
267 224
268 # checkout and clobber any unimportant files 225 # checkout and clobber any unimportant files
269 git checkout -f ${machine_branch} 226 git checkout -f ${machine_branch}
@@ -313,7 +270,7 @@ python do_kernel_configcheck() {
313 kmeta = "." + kmeta 270 kmeta = "." + kmeta
314 271
315 pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH', True), "${S}/scripts/util/") 272 pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH', True), "${S}/scripts/util/")
316 cmd = d.expand("cd ${S}; kconf_check -config- %s/meta-series ${S} ${B}" % kmeta) 273 cmd = d.expand("cd ${S}; kconf_check -config %s/meta-series ${S} ${B}" % kmeta)
317 ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd)) 274 ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
318 275
319 config_check_visibility = int(d.getVar( "KCONF_AUDIT_LEVEL", True ) or 0) 276 config_check_visibility = int(d.getVar( "KCONF_AUDIT_LEVEL", True ) or 0)
@@ -351,7 +308,6 @@ python do_kernel_configcheck() {
351do_validate_branches() { 308do_validate_branches() {
352 set +e 309 set +e
353 cd ${S} 310 cd ${S}
354 export KMETA=${KMETA}
355 311
356 machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}" 312 machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
357 machine_srcrev="${SRCREV_machine}" 313 machine_srcrev="${SRCREV_machine}"
@@ -377,28 +333,6 @@ do_validate_branches() {
377 force_srcrev=${machine_srcrev} 333 force_srcrev=${machine_srcrev}
378 fi 334 fi
379 335
380 ## KMETA branch validation.
381 target_meta_head="${SRCREV_meta}"
382 if [ "${target_meta_head}" = "AUTOINC" ] || [ "${target_meta_head}" = "" ]; then
383 bbnote "SRCREV validation skipped for AUTOREV or empty meta branch"
384 else
385 meta_head=`git show-ref -s --heads ${KMETA}`
386
387 git cat-file -t ${target_meta_head} > /dev/null
388 if [ $? -ne 0 ]; then
389 bberror "${target_meta_head} is not a valid commit ID"
390 bbfatal_log "The kernel source tree may be out of sync"
391 fi
392 if [ "$meta_head" != "$target_meta_head" ]; then
393 bbnote "Setting branch ${KMETA} to ${target_meta_head}"
394 git branch -m ${KMETA} ${KMETA}-orig
395 git checkout -q -b ${KMETA} ${target_meta_head}
396 if [ $? -ne 0 ];then
397 bbfatal_log "Could not checkout ${KMETA} branch from known hash ${target_meta_head}"
398 fi
399 fi
400 fi
401
402 git checkout -q -f ${machine_branch} 336 git checkout -q -f ${machine_branch}
403 if [ -n "${force_srcrev}" ]; then 337 if [ -n "${force_srcrev}" ]; then
404 # see if the branch we are about to patch has been properly reset to the defined 338 # see if the branch we are about to patch has been properly reset to the defined