diff options
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
| -rw-r--r-- | meta/classes/kernel-yocto.bbclass | 29 |
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. |
| 311 | do_validate_branches() { | 311 | do_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 |
