summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2010-09-25 01:39:02 -0400
committerSaul Wold <Saul.Wold@intel.com>2010-09-30 10:08:55 -0700
commit8d5b2224bd042940769ebffd521d68ec3eefbb55 (patch)
tree37b6a8eba47eea29c0d893aa817ad6916bcc05f9 /meta/recipes-kernel
parent06c19f0cd0c71bb721084294a2a3cb60d1855dfd (diff)
downloadpoky-8d5b2224bd042940769ebffd521d68ec3eefbb55.tar.gz
linux-wrs: validate commits when forcing branches
Fixes [BUGID #372] If for some unknown reason, the kernel git repository hasn't been properly updated and is *older* than the revisions listed in default-revisions the branch sanity checking kicks in and tries to force branches to the right revs. The problem is, the revisions it is looking for don't exist in the tree. As a result, error messages are thrown about invalid commit IDs. These aren't helpful, and are simply confusing for the user. Instead we can test for the commit ID, and if it isn't valid, indicate that the commit ID isn't valid and that the tree is potentially out of sync. This situation is not common, but it is an easy test and the extra sanity checking is useful. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/linux/linux-wrs_git.bb29
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}