diff options
| -rw-r--r-- | meta/classes/kernel-yocto.bbclass | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index d38b60f519..8878573f6f 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
| @@ -341,6 +341,21 @@ do_kernel_checkout() { | |||
| 341 | fi | 341 | fi |
| 342 | fi | 342 | fi |
| 343 | cd ${S} | 343 | cd ${S} |
| 344 | |||
| 345 | # convert any remote branches to local tracking ones | ||
| 346 | for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do | ||
| 347 | b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`; | ||
| 348 | git show-ref --quiet --verify -- "refs/heads/$b" | ||
| 349 | if [ $? -ne 0 ]; then | ||
| 350 | git branch $b $i > /dev/null | ||
| 351 | fi | ||
| 352 | done | ||
| 353 | |||
| 354 | # Create a working tree copy of the kernel by checking out a branch | ||
| 355 | machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}" | ||
| 356 | |||
| 357 | # checkout and clobber any unimportant files | ||
| 358 | git checkout -f ${machine_branch} | ||
| 344 | else | 359 | else |
| 345 | # case: we have no git repository at all. | 360 | # case: we have no git repository at all. |
| 346 | # To support low bandwidth options for building the kernel, we'll just | 361 | # To support low bandwidth options for building the kernel, we'll just |
| @@ -362,21 +377,6 @@ do_kernel_checkout() { | |||
| 362 | git commit -q -m "baseline commit: creating repo for ${PN}-${PV}" | 377 | git commit -q -m "baseline commit: creating repo for ${PN}-${PV}" |
| 363 | git clean -d -f | 378 | git clean -d -f |
| 364 | fi | 379 | fi |
| 365 | |||
| 366 | # convert any remote branches to local tracking ones | ||
| 367 | for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do | ||
| 368 | b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`; | ||
| 369 | git show-ref --quiet --verify -- "refs/heads/$b" | ||
| 370 | if [ $? -ne 0 ]; then | ||
| 371 | git branch $b $i > /dev/null | ||
| 372 | fi | ||
| 373 | done | ||
| 374 | |||
| 375 | # Create a working tree copy of the kernel by checking out a branch | ||
| 376 | machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}" | ||
| 377 | |||
| 378 | # checkout and clobber any unimportant files | ||
| 379 | git checkout -f ${machine_branch} | ||
| 380 | } | 380 | } |
| 381 | do_kernel_checkout[dirs] = "${S} ${WORKDIR}" | 381 | do_kernel_checkout[dirs] = "${S} ${WORKDIR}" |
| 382 | 382 | ||
