summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/kernel-yocto.bbclass37
1 files changed, 16 insertions, 21 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index fab5d4c..fb8e04e 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -358,31 +358,26 @@ do_validate_branches() {
358 fi 358 fi
359 done 359 done
360 360
361 ## KMETA branch validation 361 ## KMETA branch validation.
362 ## We do validation if the meta branch exists, and AUTOREV hasn't been set
362 meta_head=`git show-ref -s --heads ${KMETA}` 363 meta_head=`git show-ref -s --heads ${KMETA}`
363 target_meta_head="${SRCREV_meta}" 364 target_meta_head="${SRCREV_meta}"
364 git show-ref --quiet --verify -- "refs/heads/${KMETA}" 365 git show-ref --quiet --verify -- "refs/heads/${KMETA}"
365 if [ $? -eq 1 ]; then 366 if [ $? -eq 0 ] && [ "${target_meta_head}" != "AUTOINC" ]; then
366 return 367 if [ "$meta_head" != "$target_meta_head" ]; then
367 fi 368 ref=`git show ${target_meta_head} 2>&1 | head -n1 || true`
368 369 if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then
369 if [ "${target_meta_head}" = "AUTOINC" ]; then 370 echo "ERROR ${target_meta_head} is not a valid commit ID"
370 return 371 echo "The kernel source tree may be out of sync"
371 fi
372
373 if [ "$meta_head" != "$target_meta_head" ]; then
374 ref=`git show ${target_meta_head} 2>&1 | head -n1 || true`
375 if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then
376 echo "ERROR ${target_meta_head} is not a valid commit ID"
377 echo "The kernel source tree may be out of sync"
378 exit 1
379 else
380 echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}"
381 git branch -m ${KMETA} ${KMETA}-orig
382 git checkout -q -b ${KMETA} ${target_meta_head}
383 if [ $? -ne 0 ];then
384 echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}"
385 exit 1 372 exit 1
373 else
374 echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}"
375 git branch -m ${KMETA} ${KMETA}-orig
376 git checkout -q -b ${KMETA} ${target_meta_head}
377 if [ $? -ne 0 ];then
378 echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}"
379 exit 1
380 fi
386 fi 381 fi
387 fi 382 fi
388 fi 383 fi