Re: [PATCH 5/6] linux-yocto: skip kernel meta data branches when finding machine branch

Saul Wold
2015-10-26T18:04:33Z

On Fri, 2015-10-23 at 16:18 -0400, Bruce Ashfield wrote:
> Before the fetcher validated the specified SRCREV was reachable on a
> specified branch, linux-yocto style kernel's were comparing the value
> of KBRANCH and branch on the SRC_URI and then allowing a SRC_URI
> specified branch to override KBRANCH.
>
> With the introduction of kernel meta data on the SRC_URI, this routine
> is incorrectly picking up a kernel-cache repository and then attempting
> to apply that branch information to the kernel repository.
>
> The rationalization of the branch specification is largely no longer
> required, and will may be removed in the future. But for now, to keep
> changes minimal, we can simply not return branch information that comes
> from kernel meta data by checking the 'type' parameter and skipping
> if it is of type 'kmeta'.
>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Tested-by: Saul Wold <sgw@linux.intel.com>

> ---
> meta/classes/kernel-yocto.bbclass | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
> index 325f94c73560..00d9667fe0a6 100644
> --- a/meta/classes/kernel-yocto.bbclass
> +++ b/meta/classes/kernel-yocto.bbclass
> @@ -52,7 +52,9 @@ def get_machine_branch(d, default):
> parm = urldata.parm
> if "branch" in parm:
> branches = urldata.parm.get("branch").split(',')
> - return branches[0]
> + btype = urldata.parm.get("type")
> + if btype != "kmeta":
> + return branches[0]
>
> return default
>