summaryrefslogtreecommitdiff
path: root/classes/toradex-kernel-localversion.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/toradex-kernel-localversion.bbclass')
-rw-r--r--classes/toradex-kernel-localversion.bbclass12
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`