summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Mabäcker <petter@technux.se>2015-07-08 21:02:03 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-16 15:09:19 +0100
commit3f9658a48261d2bb6be2781e81c84dd709f15754 (patch)
tree0fcacfb80effe06ab81d39d383da2ca52e8de4cd
parent525ba4ce29d4220b9a726d42295946df139aebe7 (diff)
downloadpoky-3f9658a48261d2bb6be2781e81c84dd709f15754.tar.gz
kernel-yocto: fix machine_srcrev check in do_patch
do_patch is currently doing checks with machine_srcrev without initiate it which leads to below (additional debug added): DEBUG: Executing shell function do_patch . . . + [ 0 -ne 0 ] + [ != AUTOINC ] + git rev-parse --verify ~0 fatal: Needed a single revision + git merge-base HEAD usage: git merge-base [-a|--all] <commit> <commit>... or: git merge-base [-a|--all] --octopus <commit>... or: git merge-base --independent <commit>... or: git merge-base --is-ancestor <commit> <commit> or: git merge-base --fork-point <ref> [<commit>] -a, --all output all common ancestors --octopus find ancestors for a single n-way merge --independent list revs not reachable from others --is-ancestor is the first one ancestor of the other? --fork-point find where <commit> forked from reflog of <ref> + [ = ] + set +x DEBUG: Shell function do_patch finished Only reason it works today is because 'rev-parse/merge-base' with empty machine_srcrev will result in "false positive". Solve this by adding a similar non-empty check and use SRCREV as fallback as in 'do_kernel_metadata' (From OE-Core rev: 5f7403151fc8bfd5b1d77f6626717c8b84d33d93) Signed-off-by: Petter Mabäcker <petter@technux.se> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/kernel-yocto.bbclass10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 6fd025ef1e..fb14926fad 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -168,6 +168,16 @@ do_patch() {
168 168
169 # check to see if the specified SRCREV is reachable from the final branch. 169 # check to see if the specified SRCREV is reachable from the final branch.
170 # if it wasn't something wrong has happened, and we should error. 170 # if it wasn't something wrong has happened, and we should error.
171 machine_srcrev="${SRCREV_machine}"
172 if [ -z "${machine_srcrev}" ]; then
173 # fallback to SRCREV if a non machine_meta tree is being built
174 machine_srcrev="${SRCREV}"
175 # if SRCREV cannot be reached something is wrong.
176 if [ -z "${machine_srcrev}" ]; then
177 bbfatal "Neither SRCREV_machine or SRCREV was specified!"
178 fi
179 fi
180
171 if [ "${machine_srcrev}" != "AUTOINC" ]; then 181 if [ "${machine_srcrev}" != "AUTOINC" ]; then
172 if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then 182 if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then
173 bberror "SRCREV ${machine_srcrev} was specified, but is not reachable" 183 bberror "SRCREV ${machine_srcrev} was specified, but is not reachable"