summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2021-06-16 16:48:49 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-07-20 19:05:45 +0100
commita78596e9e191b9d4d76478417b5405bb14dd53e3 (patch)
treea389f318f8b9b0482ae3030fbf71031f98802aaf /meta
parenta85d14a72ecf692ceaed3154b14a5fd44fa90739 (diff)
downloadpoky-a78596e9e191b9d4d76478417b5405bb14dd53e3.tar.gz
linux-yocto-dev: base AUTOREV on specified version
linux-yocto-dev tracks the latest mainline kernel, and uses standard/* for that support. Archived -dev versions are under v<kernel version>/standard/base. This policy works, except that a released branch will still follow the new kernel versions, causing potential breakage with newer kernels than are supported in that release. Rather than lock the SRCREVs and update branches in old releases, we can preserve the AUTOREV nature of -dev, and allow them to switch automatically to the archived branch based on the LINUX_VERSION in the -dev recipe (which is unchanged in the release branch). This is consistent with the other branch switching done for the kernels and with the -dev workflow. (From OE-Core rev: b3228b4140575bfc20cb4e5bade0f3737d374e86) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 84e14b6116a7d1e52051c5c80be2d8e3db67c2d7) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/kernel-yocto.bbclass24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 30f07de4ca..d38b60f519 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -614,7 +614,31 @@ do_validate_branches() {
614 # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to 614 # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to
615 # check and we can exit early 615 # check and we can exit early
616 if [ "${machine_srcrev}" = "AUTOINC" ]; then 616 if [ "${machine_srcrev}" = "AUTOINC" ]; then
617 linux_yocto_dev='${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "1", "", d)}'
618 if [ -n "$linux_yocto_dev" ]; then
619 git checkout -q -f ${machine_branch}
620 ver=$(grep "^VERSION =" ${S}/Makefile | sed s/.*=\ *//)
621 patchlevel=$(grep "^PATCHLEVEL =" ${S}/Makefile | sed s/.*=\ *//)
622 sublevel=$(grep "^SUBLEVEL =" ${S}/Makefile | sed s/.*=\ *//)
623 kver="$ver.$patchlevel"
624 bbnote "dev kernel: performing version -> branch -> SRCREV validation"
625 bbnote "dev kernel: recipe version ${LINUX_VERSION}, src version: $kver"
626 echo "${LINUX_VERSION}" | grep -q $kver
627 if [ $? -ne 0 ]; then
628 version="$(echo ${LINUX_VERSION} | sed 's/\+.*$//g')"
629 versioned_branch="v$version/$machine_branch"
630
631 machine_branch=$versioned_branch
632 force_srcrev="$(git rev-parse $machine_branch 2> /dev/null)"
633 if [ $? -ne 0 ]; then
634 bbfatal "kernel version mismatch detected, and no valid branch $machine_branch detected"
635 fi
636
637 bbnote "dev kernel: adjusting branch to $machine_branch, srcrev to: $force_srcrev"
638 fi
639 else
617 bbnote "SRCREV validation is not required for AUTOREV" 640 bbnote "SRCREV validation is not required for AUTOREV"
641 fi
618 elif [ "${machine_srcrev}" = "" ]; then 642 elif [ "${machine_srcrev}" = "" ]; then
619 if [ "${SRCREV}" != "AUTOINC" ] && [ "${SRCREV}" != "INVALID" ]; then 643 if [ "${SRCREV}" != "AUTOINC" ] && [ "${SRCREV}" != "INVALID" ]; then
620 # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe 644 # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe