diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-06-16 16:48:49 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-06-17 13:42:31 +0100 |
commit | 676f68ba8f6f3fdd102ca0ab6bec5e390ac48266 (patch) | |
tree | 277a1c09934e08a568ef7c1e6cc03c14039f1812 /meta/classes | |
parent | 4052a66ba3f6ebf68390af1230d04c56459bfb44 (diff) | |
download | poky-676f68ba8f6f3fdd102ca0ab6bec5e390ac48266.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: 84e14b6116a7d1e52051c5c80be2d8e3db67c2d7)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index ba139dd7f8..0df61cdef0 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass | |||
@@ -631,7 +631,31 @@ do_validate_branches() { | |||
631 | # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to | 631 | # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to |
632 | # check and we can exit early | 632 | # check and we can exit early |
633 | if [ "${machine_srcrev}" = "AUTOINC" ]; then | 633 | if [ "${machine_srcrev}" = "AUTOINC" ]; then |
634 | linux_yocto_dev='${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "1", "", d)}' | ||
635 | if [ -n "$linux_yocto_dev" ]; then | ||
636 | git checkout -q -f ${machine_branch} | ||
637 | ver=$(grep "^VERSION =" ${S}/Makefile | sed s/.*=\ *//) | ||
638 | patchlevel=$(grep "^PATCHLEVEL =" ${S}/Makefile | sed s/.*=\ *//) | ||
639 | sublevel=$(grep "^SUBLEVEL =" ${S}/Makefile | sed s/.*=\ *//) | ||
640 | kver="$ver.$patchlevel" | ||
641 | bbnote "dev kernel: performing version -> branch -> SRCREV validation" | ||
642 | bbnote "dev kernel: recipe version ${LINUX_VERSION}, src version: $kver" | ||
643 | echo "${LINUX_VERSION}" | grep -q $kver | ||
644 | if [ $? -ne 0 ]; then | ||
645 | version="$(echo ${LINUX_VERSION} | sed 's/\+.*$//g')" | ||
646 | versioned_branch="v$version/$machine_branch" | ||
647 | |||
648 | machine_branch=$versioned_branch | ||
649 | force_srcrev="$(git rev-parse $machine_branch 2> /dev/null)" | ||
650 | if [ $? -ne 0 ]; then | ||
651 | bbfatal "kernel version mismatch detected, and no valid branch $machine_branch detected" | ||
652 | fi | ||
653 | |||
654 | bbnote "dev kernel: adjusting branch to $machine_branch, srcrev to: $force_srcrev" | ||
655 | fi | ||
656 | else | ||
634 | bbnote "SRCREV validation is not required for AUTOREV" | 657 | bbnote "SRCREV validation is not required for AUTOREV" |
658 | fi | ||
635 | elif [ "${machine_srcrev}" = "" ]; then | 659 | elif [ "${machine_srcrev}" = "" ]; then |
636 | if [ "${SRCREV}" != "AUTOINC" ] && [ "${SRCREV}" != "INVALID" ]; then | 660 | if [ "${SRCREV}" != "AUTOINC" ] && [ "${SRCREV}" != "INVALID" ]; then |
637 | # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe | 661 | # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe |