diff options
-rw-r--r-- | meta/recipes-kernel/linux/linux-wrs_git.bb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-wrs_git.bb b/meta/recipes-kernel/linux/linux-wrs_git.bb index 2978ed95cb..696b7d407a 100644 --- a/meta/recipes-kernel/linux/linux-wrs_git.bb +++ b/meta/recipes-kernel/linux/linux-wrs_git.bb @@ -29,6 +29,9 @@ PR = "r6" S = "${WORKDIR}/linux" B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build" +# functionality flags +force_revisions = "t" + do_patch() { cd ${S} if [ -f ${WORKDIR}/defconfig ]; then @@ -54,6 +57,29 @@ do_patch() { fi } +validate_branches() { + branch_head=`git show-ref -s --heads ${WRMACHINE}-${LINUX_KERNEL_TYPE}` + meta_head=`git show-ref -s --heads wrs_meta` + target_branch_head="${SRCREV_pn-linux-wrs_machine}" + target_meta_head="${SRCREV_pn-linux-wrs_meta}" + + if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then + if [ -n "${force_revisions}" ]; then + echo "Forcing branch ${WRMACHINE}-${LINUX_KERNEL_TYPE} to ${target_branch_head}" + git branch -m ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${WRMACHINE}-${LINUX_KERNEL_TYPE}-orig + git checkout -b ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${target_branch_head} + fi + fi + + if [ "$meta_head" != "$target_meta_head" ]; then + if [ -n "${force_revisions}" ]; then + echo "Forcing branch wrs_meta to ${target_meta_head}" + git branch -m wrs_meta wrs_meta-orig + git checkout -b wrs_meta ${target_meta_head} + fi + fi +} + do_wrlinux_checkout() { if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then echo "Fixing up git directory for ${WRMACHINE}-${LINUX_KERNEL_TYPE}" @@ -79,6 +105,15 @@ IFS=' fi fi cd ${S} + + # checkout and clobber and unimportant files + git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE} + + validate_branches + + # this second checkout is intentional, we want to leave ourselves + # on the branch to be built, but validate_branches could have changed + # our initial checkout. So we do it a second time to be sure git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE} } do_wrlinux_checkout[dirs] = "${S}" |