diff options
author | Ming Liu <ming.liu@toradex.com> | 2020-03-04 13:53:35 +0000 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2020-03-04 16:56:38 +0000 |
commit | f22318fe5a27258a02a9923629c9b8399b387d92 (patch) | |
tree | 7d0abab33266994d38a6dfc8d36b0dff98278a6d | |
parent | 60f4dbc77be23abfe2995f9f2bd448694157d020 (diff) |
toradex-kernel-localversion.bbclass: use SRCREV to set scmversion
In commit 32df2d41:
[ toradex-kernel-localversion.bbclass: use origin branch set scmversion ]
we changed to use origin branch to set scmversion, but that's not good
enough, we should stick to SRCREV which is the latest original commit
in the source.
Related-to: TOR-694
Signed-off-by: Ming Liu <ming.liu@toradex.com>
(cherry picked from commit a49daf2f134e019d528566cf1903d4a3ce211297)
-rw-r--r-- | classes/toradex-kernel-localversion.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/classes/toradex-kernel-localversion.bbclass b/classes/toradex-kernel-localversion.bbclass index 0892adf..6792d18 100644 --- a/classes/toradex-kernel-localversion.bbclass +++ b/classes/toradex-kernel-localversion.bbclass @@ -21,10 +21,10 @@ 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 "${KBRANCH}" ]; then - head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${KBRANCH} 2> /dev/null` - elif [ -n "${SRCBRANCH}" ]; then - head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${SRCBRANCH} 2> /dev/null` + if [ -n "${SRCREV_machine}" -a "${SRCREV_machine}" != "INVALID" ]; then + head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV_machine} 2> /dev/null` + elif [ -n "${SRCREV}" -a "${SRCREV}" != "INVALID" ]; then + head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV} 2> /dev/null` else head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` fi |