diff options
author | Ming Liu <ming.liu@toradex.com> | 2020-02-13 22:56:14 +0100 |
---|---|---|
committer | Ming Liu <ming.liu@toradex.com> | 2020-02-13 23:04:19 +0100 |
commit | 6ed31afaffb7e94f077b421c61722b6bfc2a340d (patch) | |
tree | 7fd73e49449ac0544fd994b362eae7c8ef1c49e7 | |
parent | f9d7fe8962838dbb8a166f8ec991b397fde28a5f (diff) |
toradex-kernel-localversion.bbclass: use origin branch set scmversion
For kernel-yocto, the commit hash of HEAD is different for every run of
do_patch if there is any patch in SRC_URI, this is breaking the recipes
that relying on KERNEL_VERSION which contains scmversion, so we should
let scmversion stick to the original head instead of the HEAD after
do_patch, this will make scmversion stable and hence will make
KERNEL_VERSION stable for the recipes that relying on it.
Signed-off-by: Ming Liu <ming.liu@toradex.com>
-rw-r--r-- | classes/toradex-kernel-localversion.bbclass | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/classes/toradex-kernel-localversion.bbclass b/classes/toradex-kernel-localversion.bbclass index ce9597c..0892adf 100644 --- a/classes/toradex-kernel-localversion.bbclass +++ b/classes/toradex-kernel-localversion.bbclass @@ -21,7 +21,13 @@ kernel_do_configure_append() { sed -i -e /CONFIG_LOCALVERSION_AUTO/d ${B}/.config if [ "${SCMVERSION}" = "y" ]; then # Add GIT revision to the local version - head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` + 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` + else + head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` + fi printf "+git.%s" $head > ${S}/.scmversion echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config else |