diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-kernel/linux/linux-wrs_git.bb | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/meta/recipes-kernel/linux/linux-wrs_git.bb b/meta/recipes-kernel/linux/linux-wrs_git.bb index cf910e0a6b..0e27890a94 100644 --- a/meta/recipes-kernel/linux/linux-wrs_git.bb +++ b/meta/recipes-kernel/linux/linux-wrs_git.bb | |||
@@ -38,18 +38,21 @@ do_patch() { | |||
38 | defconfig=${WORKDIR}/defconfig | 38 | defconfig=${WORKDIR}/defconfig |
39 | fi | 39 | fi |
40 | 40 | ||
41 | # simply ensures that a branch of the right name has been created | ||
41 | createme ${ARCH} ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${defconfig} | 42 | createme ${ARCH} ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${defconfig} |
42 | if [ $? -ne 0 ]; then | 43 | if [ $? -ne 0 ]; then |
43 | echo "ERROR. Could not create ${WRMACHINE}-${LINUX_KERNEL_TYPE}" | 44 | echo "ERROR. Could not create ${WRMACHINE}-${LINUX_KERNEL_TYPE}" |
44 | exit 1 | 45 | exit 1 |
45 | fi | 46 | fi |
46 | 47 | ||
48 | # updates or generates the target description | ||
47 | updateme ${WORKDIR} | 49 | updateme ${WORKDIR} |
48 | if [ $? -ne 0 ]; then | 50 | if [ $? -ne 0 ]; then |
49 | echo "ERROR. Could not update ${WRMACHINE}-${LINUX_KERNEL_TYPE}" | 51 | echo "ERROR. Could not update ${WRMACHINE}-${LINUX_KERNEL_TYPE}" |
50 | exit 1 | 52 | exit 1 |
51 | fi | 53 | fi |
52 | 54 | ||
55 | # executes and modifies the source tree as required | ||
53 | patchme ${WRMACHINE}-${LINUX_KERNEL_TYPE} | 56 | patchme ${WRMACHINE}-${LINUX_KERNEL_TYPE} |
54 | if [ $? -ne 0 ]; then | 57 | if [ $? -ne 0 ]; then |
55 | echo "ERROR. Could not modify ${WRMACHINE}-${LINUX_KERNEL_TYPE}" | 58 | echo "ERROR. Could not modify ${WRMACHINE}-${LINUX_KERNEL_TYPE}" |
@@ -65,17 +68,31 @@ validate_branches() { | |||
65 | 68 | ||
66 | if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then | 69 | if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then |
67 | if [ -n "${force_revisions}" ]; then | 70 | if [ -n "${force_revisions}" ]; then |
68 | echo "Forcing branch ${WRMACHINE}-${LINUX_KERNEL_TYPE} to ${target_branch_head}" | 71 | git show ${target_branch_head} > /dev/null 2>&1 |
69 | git branch -m ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${WRMACHINE}-${LINUX_KERNEL_TYPE}-orig | 72 | if [ $? -eq 0 ]; then |
70 | git checkout -b ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${target_branch_head} | 73 | echo "Forcing branch ${WRMACHINE}-${LINUX_KERNEL_TYPE} to ${target_branch_head}" |
74 | git branch -m ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${WRMACHINE}-${LINUX_KERNEL_TYPE}-orig | ||
75 | git checkout -b ${WRMACHINE}-${LINUX_KERNEL_TYPE} ${target_branch_head} | ||
76 | else | ||
77 | echo "ERROR ${target_branch_head} is not a valid commit ID." | ||
78 | echo "The kernel source tree may be out of sync" | ||
79 | exit 1 | ||
80 | fi | ||
71 | fi | 81 | fi |
72 | fi | 82 | fi |
73 | 83 | ||
74 | if [ "$meta_head" != "$target_meta_head" ]; then | 84 | if [ "$meta_head" != "$target_meta_head" ]; then |
75 | if [ -n "${force_revisions}" ]; then | 85 | if [ -n "${force_revisions}" ]; then |
76 | echo "Forcing branch wrs_meta to ${target_meta_head}" | 86 | git show ${target_meta_head} > /dev/null 2>&1 |
77 | git branch -m wrs_meta wrs_meta-orig | 87 | if [ $? -eq 0 ]; then |
78 | git checkout -b wrs_meta ${target_meta_head} | 88 | echo "Forcing branch wrs_meta to ${target_meta_head}" |
89 | git branch -m wrs_meta wrs_meta-orig | ||
90 | git checkout -b wrs_meta ${target_meta_head} | ||
91 | else | ||
92 | echo "ERROR ${target_meta_head} is not a valid commit ID" | ||
93 | echo "The kernel source tree may be out of sync" | ||
94 | exit 1 | ||
95 | fi | ||
79 | fi | 96 | fi |
80 | fi | 97 | fi |
81 | } | 98 | } |