summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/kernel-yocto.bbclass49
1 files changed, 24 insertions, 25 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 087fbb0c37..0ac1572471 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -311,37 +311,36 @@ do_validate_branches() {
311 if [ "${machine_srcrev}" = "AUTOINC" ] || [ "${machine_srcrev}" = "INVALID" ] || 311 if [ "${machine_srcrev}" = "AUTOINC" ] || [ "${machine_srcrev}" = "INVALID" ] ||
312 [ "${machine_srcrev}" = "" ]; then 312 [ "${machine_srcrev}" = "" ]; then
313 bbnote "INFO: SRCREV validation is not required for AUTOREV or empty/invalid settings, returning" 313 bbnote "INFO: SRCREV validation is not required for AUTOREV or empty/invalid settings, returning"
314 return 314 else
315 fi 315 git cat-file -t ${machine_srcrev} > /dev/null
316 316 if [ if $? -ne 0 ]; then
317 317 echo "ERROR ${machine_srcrev} is not a valid commit ID."
318 git cat-file -t ${machine_srcrev} > /dev/null 318 echo "The kernel source tree may be out of sync"
319 if [ if $? -ne 0 ]; then 319 exit 1
320 echo "ERROR ${machine_srcrev} is not a valid commit ID." 320 fi
321 echo "The kernel source tree may be out of sync"
322 exit 1
323 fi 321 fi
324 322
325 ## KMETA branch validation. 323 ## KMETA branch validation.
326 ## We do validation if the meta branch exists, and AUTOREV hasn't been set 324 ## We do validation if the meta branch exists, and AUTOREV hasn't been set
327 meta_head=`git show-ref -s --heads ${KMETA}` 325 target_meta_head="${SRCREV_meta}"
328 target_meta_head="${SRCREV_meta}" 326 if [ "${target_meta_head}" = "AUTOINC" ] || [ "${target_meta_head}" = "" ]; then
329 git show-ref --quiet --verify -- "refs/heads/${KMETA}" 327 bbnote "INFO: SRCREV validation skipped for AUTOREV or empty meta branch"
330 if [ $? -eq 0 ] && [ "${target_meta_head}" != "AUTOINC" ]; then 328 else
329 meta_head=`git show-ref -s --heads ${KMETA}`
330
331 git cat-file -t ${target_meta_head} > /dev/null
332 if [ $? -ne 0 ]; then
333 echo "ERROR ${target_meta_head} is not a valid commit ID"
334 echo "The kernel source tree may be out of sync"
335 exit 1
336 fi
331 if [ "$meta_head" != "$target_meta_head" ]; then 337 if [ "$meta_head" != "$target_meta_head" ]; then
332 git cat-file -t ${target_meta_head} > /dev/null 338 echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}"
333 if [ $? -ne 0 ]; then 339 git branch -m ${KMETA} ${KMETA}-orig
334 echo "ERROR ${target_meta_head} is not a valid commit ID" 340 git checkout -q -b ${KMETA} ${target_meta_head}
335 echo "The kernel source tree may be out of sync" 341 if [ $? -ne 0 ];then
342 echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}"
336 exit 1 343 exit 1
337 else
338 echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}"
339 git branch -m ${KMETA} ${KMETA}-orig
340 git checkout -q -b ${KMETA} ${target_meta_head}
341 if [ $? -ne 0 ];then
342 echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}"
343 exit 1
344 fi
345 fi 344 fi
346 fi 345 fi
347 fi 346 fi