summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/fsl-kernel-localversion.bbclass14
-rw-r--r--classes/fsl-u-boot-localversion.bbclass20
2 files changed, 27 insertions, 7 deletions
diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass
index f7e0908fd..9ef0a62f6 100644
--- a/classes/fsl-kernel-localversion.bbclass
+++ b/classes/fsl-kernel-localversion.bbclass
@@ -25,8 +25,18 @@ do_kernel_localversion() {
25 25
26 if [ "${SCMVERSION}" = "y" ]; then 26 if [ "${SCMVERSION}" = "y" ]; then
27 # Add GIT revision to the local version 27 # Add GIT revision to the local version
28 head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV} 2> /dev/null` 28 if [ "${SRCREV}" = "INVALID" ]; then
29 patches=`git --git-dir=${S}/.git rev-list --count ${SRCREV}..HEAD 2> /dev/null` 29 hash=${SRCREV_machine}
30 else
31 hash=${SRCREV}
32 fi
33 if [ "$hash" = "AUTOINC" ]; then
34 branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD`
35 head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null`
36 else
37 head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null`
38 fi
39 patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null`
30 printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion 40 printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion
31 41
32 sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config 42 sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config
diff --git a/classes/fsl-u-boot-localversion.bbclass b/classes/fsl-u-boot-localversion.bbclass
index d160ca985..94b30c04e 100644
--- a/classes/fsl-u-boot-localversion.bbclass
+++ b/classes/fsl-u-boot-localversion.bbclass
@@ -17,11 +17,21 @@ UBOOT_LOCALVERSION = "${LOCALVERSION}"
17do_compile:prepend() { 17do_compile:prepend() {
18 if [ "${SCMVERSION}" = "y" ]; then 18 if [ "${SCMVERSION}" = "y" ]; then
19 # Add GIT revision to the local version 19 # Add GIT revision to the local version
20 head=`cd ${S} ; git rev-parse --verify --short ${SRCREV} 2> /dev/null` 20 if [ "${SRCREV}" = "INVALID" ]; then
21 patches=`cd ${S} ; git rev-list --count ${SRCREV}..HEAD 2> /dev/null` 21 hash=${SRCREV_machine}
22 printf "%s%s%s%s%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${S}/.scmversion 22 else
23 printf "%s%s%s%s%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${B}/.scmversion 23 hash=${SRCREV}
24 else 24 fi
25 if [ "$hash" = "AUTOINC" ]; then
26 branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD`
27 head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null`
28 else
29 head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null`
30 fi
31 patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null`
32 printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion
33 printf "%s%s%s%s" +g $head +p $patches > ${B}/.scmversion
34 else
25 printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion 35 printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion
26 printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion 36 printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion
27 fi 37 fi