summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2016-04-01 20:09:26 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-03 15:51:37 +0100
commit6b8f8a47bd03f230c3b6ad58fb95b4dbc6959818 (patch)
tree5539078ce7abc80916b44c91dedab4c2a61727fc /meta/classes/kernel-yocto.bbclass
parent6ebd43c88b3cac6a6616963ea31ba309cba686f3 (diff)
downloadpoky-6b8f8a47bd03f230c3b6ad58fb95b4dbc6959818.tar.gz
kernel-yocto: enforce SRC_URI specified branch
During the simplication and cleanup of branches and kernel meta data handling, the ability to force build a branch that didn't match the meta data was dropped. There are valid uses cases when a different branch should be built (testing, development, etc), so we restore the capability with this change. If after the kernel meta data is processed the current branch does not match the SRC_URI specified branch, a warning is generated about the impending branch switch and that the user should double check that they are building what they expect. WARNING: After meta data application, the kernel tree branch is standard/base. The WARNING: SRC_URI specified branch standard/gt. The branch will be forced to standard/gt, WARNING: but this means the board meta data (.scc files) do not match the SRC_URI specification. WARNING: The meta data and branch standard/gt should be inspected to ensure the proper WARNING: kernel is being built. Reported-by: Steve Sakoman" <steve.sakoman@intel.com> (From OE-Core rev: d91a668bc0f6c2cfc52174b4039c7ea0d84e8d4d) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 6a6a3a31d9..f86b3ef011 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -170,6 +170,17 @@ do_patch() {
170 fi 170 fi
171 fi 171 fi
172 172
173 current_branch=`git rev-parse --abbrev-ref HEAD`
174 machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
175 if [ "${current_branch}" != "${machine_branch}" ]; then
176 bbwarn "After meta data application, the kernel tree branch is ${current_branch}. The"
177 bbwarn "SRC_URI specified branch ${machine_branch}. The branch will be forced to ${machine_branch},"
178 bbwarn "but this means the board meta data (.scc files) do not match the SRC_URI specification."
179 bbwarn "The meta data and branch ${machine_branch} should be inspected to ensure the proper"
180 bbwarn "kernel is being built."
181 git checkout -f ${machine_branch}
182 fi
183
173 if [ "${machine_srcrev}" != "AUTOINC" ]; then 184 if [ "${machine_srcrev}" != "AUTOINC" ]; then
174 if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then 185 if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then
175 bberror "SRCREV ${machine_srcrev} was specified, but is not reachable" 186 bberror "SRCREV ${machine_srcrev} was specified, but is not reachable"