diff options
Diffstat (limited to 'meta/recipes-kernel/linux')
-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" | |||
29 | S = "${WORKDIR}/linux" | 29 | S = "${WORKDIR}/linux" |
30 | B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build" | 30 | B = "${WORKDIR}/linux-${WRMACHINE}-${LINUX_KERNEL_TYPE}-build" |
31 | 31 | ||
32 | # functionality flags | ||
33 | force_revisions = "t" | ||
34 | |||
32 | do_patch() { | 35 | do_patch() { |
33 | cd ${S} | 36 | cd ${S} |
34 | if [ -f ${WORKDIR}/defconfig ]; then | 37 | if [ -f ${WORKDIR}/defconfig ]; then |
@@ -54,6 +57,29 @@ do_patch() { | |||
54 | fi | 57 | fi |
55 | } | 58 | } |
56 | 59 | ||
60 | validate_branches() { | ||
61 | branch_head=`git show-ref -s --heads ${WRMACHINE}-${LINUX_KERNEL_TYPE}` | ||
62 | meta_head=`git show-ref -s --heads wrs_meta` | ||
63 | target_branch_head="${SRCREV_pn-linux-wrs_machine}" | ||
64 | target_meta_head="${SRCREV_pn-linux-wrs_meta}" | ||
65 | |||
66 | if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then | ||
67 | if [ -n "${force_revisions}" ]; then | ||
68 | echo "Forcing branch ${WRMACHINE}-${LINUX_KERNEL_TYPE} to ${target_branch_head}" | ||
69 | git branch -m ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${WRMACHINE}-${LINUX_KERNEL_TYPE}-orig | ||
70 | git checkout -b ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${target_branch_head} | ||
71 | fi | ||
72 | fi | ||
73 | |||
74 | if [ "$meta_head" != "$target_meta_head" ]; then | ||
75 | if [ -n "${force_revisions}" ]; then | ||
76 | echo "Forcing branch wrs_meta to ${target_meta_head}" | ||
77 | git branch -m wrs_meta wrs_meta-orig | ||
78 | git checkout -b wrs_meta ${target_meta_head} | ||
79 | fi | ||
80 | fi | ||
81 | } | ||
82 | |||
57 | do_wrlinux_checkout() { | 83 | do_wrlinux_checkout() { |
58 | if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then | 84 | if [ -d ${WORKDIR}/.git/refs/remotes/origin ]; then |
59 | echo "Fixing up git directory for ${WRMACHINE}-${LINUX_KERNEL_TYPE}" | 85 | echo "Fixing up git directory for ${WRMACHINE}-${LINUX_KERNEL_TYPE}" |
@@ -79,6 +105,15 @@ IFS=' | |||
79 | fi | 105 | fi |
80 | fi | 106 | fi |
81 | cd ${S} | 107 | cd ${S} |
108 | |||
109 | # checkout and clobber and unimportant files | ||
110 | git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE} | ||
111 | |||
112 | validate_branches | ||
113 | |||
114 | # this second checkout is intentional, we want to leave ourselves | ||
115 | # on the branch to be built, but validate_branches could have changed | ||
116 | # our initial checkout. So we do it a second time to be sure | ||
82 | git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE} | 117 | git checkout -f ${WRMACHINE}-${LINUX_KERNEL_TYPE} |
83 | } | 118 | } |
84 | do_wrlinux_checkout[dirs] = "${S}" | 119 | do_wrlinux_checkout[dirs] = "${S}" |