[oe-commits] [openembedded-core] 18/22: kernel-yocto: enforce SRC_URI specified branch

git at git.openembedded.org git at git.openembedded.org
Sun Apr 3 14:54:24 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit d91a668bc0f6c2cfc52174b4039c7ea0d84e8d4d
Author: Bruce Ashfield <bruce.ashfield at windriver.com>
AuthorDate: Fri Apr 1 20:09:26 2016 -0400

    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 at intel.com>
    Signed-off-by: Bruce Ashfield <bruce.ashfield at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/kernel-yocto.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 6a6a3a3..f86b3ef 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -170,6 +170,17 @@ do_patch() {
 		fi
 	fi
 
+        current_branch=`git rev-parse --abbrev-ref HEAD`
+        machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+        if [ "${current_branch}" != "${machine_branch}" ]; then
+            bbwarn "After meta data application, the kernel tree branch is ${current_branch}. The"
+            bbwarn "SRC_URI specified branch ${machine_branch}. The branch will be forced to ${machine_branch},"
+            bbwarn "but this means the board meta data (.scc files) do not match the SRC_URI specification."
+            bbwarn "The meta data and branch ${machine_branch} should be inspected to ensure the proper"
+            bbwarn "kernel is being built."
+            git checkout -f ${machine_branch}
+        fi
+
 	if [ "${machine_srcrev}" != "AUTOINC" ]; then
 		if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then
 			bberror "SRCREV ${machine_srcrev} was specified, but is not reachable"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list