summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2014-03-18 21:16:10 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-01 14:35:40 +0100
commit95bfc6ab5167818c1bc208d11518280b215f375b (patch)
tree2c8beae64b6f061eb5863661a0d28e5f88f8284a /meta/classes/kernel-yocto.bbclass
parent254bc3a28348b541dae3599e66014a4da0d39733 (diff)
downloadpoky-95bfc6ab5167818c1bc208d11518280b215f375b.tar.gz
kernel-yocto: remove branch existence checking in do_validate_branches
Now that the fetcher will enforce branch existence, we no longer need to confirm that a branch exists, and that it was the branch requested to be built. We know the branch exists and we'll confirm that the specified SRCREV is going to be built after we've patched the tree. (From OE-Core rev: 93a7c7bd8e860e621af7174ef10d571b0d8622b2) 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.bbclass29
1 files changed, 8 insertions, 21 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 3bef841ae8..d51748e556 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -309,13 +309,19 @@ python do_kernel_configcheck() {
309# their SRCREV values. If they are NOT on the right commits, the branches 309# their SRCREV values. If they are NOT on the right commits, the branches
310# are corrected to the proper commit. 310# are corrected to the proper commit.
311do_validate_branches() { 311do_validate_branches() {
312 set +e
312 cd ${S} 313 cd ${S}
313 export KMETA=${KMETA} 314 export KMETA=${KMETA}
314 315
315 machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}" 316 machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
316 machine_srcrev="${SRCREV_machine}" 317 machine_srcrev="${SRCREV_machine}"
317 318
318 set +e 319 # if the machine branch doesn't exist, lets build master
320 git show-ref --quiet --verify -- "refs/heads/${machine_branch}"
321 if [ $? -eq 1 ]; then
322 machine_branch = "master"
323 fi
324
319 # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to 325 # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to
320 # check and we can exit early 326 # check and we can exit early
321 if [ "${machine_srcrev}" = "AUTOINC" ] || [ "${machine_srcrev}" = "INVALID" ] || 327 if [ "${machine_srcrev}" = "AUTOINC" ] || [ "${machine_srcrev}" = "INVALID" ] ||
@@ -324,19 +330,6 @@ do_validate_branches() {
324 return 330 return
325 fi 331 fi
326 332
327 # If something other than the default branch was requested, it must
328 # exist in the tree, and it's a hard error if it wasn't
329 git show-ref --quiet --verify -- "refs/heads/${machine_branch}"
330 if [ $? -eq 1 ]; then
331 if [ -n "${KBRANCH_DEFAULT}" ] &&
332 [ "${machine_branch}" != "${KBRANCH_DEFAULT}" ]; then
333 echo "ERROR: branch ${machine_branch} was set for kernel compilation, "
334 echo " but it does not exist in the kernel repository."
335 echo " Check the value of KBRANCH and ensure that it describes"
336 echo " a valid banch in the source kernel repository"
337 exit 1
338 fi
339 fi
340 333
341 git cat-file -t ${machine_srcrev} > /dev/null 334 git cat-file -t ${machine_srcrev} > /dev/null
342 if [ if $? -ne 0 ]; then 335 if [ if $? -ne 0 ]; then
@@ -369,13 +362,7 @@ do_validate_branches() {
369 fi 362 fi
370 fi 363 fi
371 364
372 git show-ref --quiet --verify -- "refs/heads/${machine_branch}" 365 git checkout -q -f ${machine_branch}
373 if [ $? -eq 0 ]; then
374 # restore the branch for builds
375 git checkout -q -f ${machine_branch}
376 else
377 git checkout -q master
378 fi
379} 366}
380 367
381# Many scripts want to look in arch/$arch/boot for the bootable 368# Many scripts want to look in arch/$arch/boot for the bootable