]> code.ossystems Code Review - meta-freescale.git/commitdiff
u-boot: add git revision to the local version
authorChunrong Guo <B40290@freescale.com>
Thu, 27 Mar 2014 05:46:20 +0000 (13:46 +0800)
committerZhenhua Luo <zhenhua.luo@freescale.com>
Wed, 2 Apr 2014 03:16:11 +0000 (11:16 +0800)
Signed-off-by: Chunrong Guo <B40290@freescale.com>
meta-fsl-ppc/recipes-bsp/u-boot/u-boot_git.bb

index 4f8690c237d14f95e83777e77fb09437bef3ade6..406914cbeff8fede0367a9896b006b566006d1ac 100644 (file)
@@ -74,8 +74,9 @@ do_compile () {
 
     if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
     then
-        echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
-        echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
+        head=`git rev-parse --verify --short HEAD 2> /dev/null`
+        printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head > ${B}/.scmversion
+        printf "%s%s%s" ${UBOOT_LOCALVERSION} +g $head > ${S}/.scmversion
     fi
 
     if [ "x${UBOOT_MACHINES}" = "x" ]; then