diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2020-03-06 23:46:19 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2020-03-06 23:51:22 +0100 |
commit | cac029d529426d031c5542fb1918b4341dcb160d (patch) | |
tree | 62c1427f244568c6b50ebfa1f56138c0e4a00e1e /classes/toradex-kernel-localversion.bbclass | |
parent | d70db23d8fc23218039973fd5df597a8bd44657e (diff) |
toradex-kernel-localversion.bbclass: fix set scmversion with autorev
Handle the case where SRCREV_machine is set to AUTOREV.
As SRCREV_machine isn't set to INVALID as its default drop checking for INVALID.
fixes: f22318f toradex-kernel-localversion.bbclass: use SRCREV to set scmversion
Related-to: TOR-694
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
(cherry picked from commit 319f84b395d5b129c7dca90554746589d2bb9f52)
Diffstat (limited to 'classes/toradex-kernel-localversion.bbclass')
-rw-r--r-- | classes/toradex-kernel-localversion.bbclass | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/classes/toradex-kernel-localversion.bbclass b/classes/toradex-kernel-localversion.bbclass index 766bd0a..f23ee58 100644 --- a/classes/toradex-kernel-localversion.bbclass +++ b/classes/toradex-kernel-localversion.bbclass @@ -21,8 +21,16 @@ kernel_do_configure_append() { sed -i -e /CONFIG_LOCALVERSION_AUTO/d ${B}/.config if [ "${SCMVERSION}" = "y" ]; then # Add GIT revision to the local version - if [ -n "${SRCREV_machine}" -a "${SRCREV_machine}" != "INVALID" ]; then - head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV_machine} 2> /dev/null` + # SRCREV_machine is used in kernel recipes using kernel-yocto.bbclass, + # e.g. our linux-toradex-mainline recipe + if [ -n "${SRCREV_machine}" ]; then + if [ "${SRCREV_machine}" = "AUTOINC" ]; then + branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` + head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null` + else + head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV_machine} 2> /dev/null` + fi + # SRCREV is used by linux-toradex recipes elif [ -n "${SRCREV}" -a "${SRCREV}" = "AUTOINC" ]; then branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null` |