Patchwork [meta-fsl-ppc] u-boot: add git revision to the local version

login
register
mail settings
Submitter chunrong guo
Date March 27, 2014, 5:46 a.m.
Message ID <1395899180-4126-1-git-send-email-b40290@freescale.com>
Download mbox | patch
Permalink /patch/69363/
State Accepted
Headers show

Comments

chunrong guo - March 27, 2014, 5:46 a.m.
From: Chunrong Guo <B40290@freescale.com>

Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
 recipes-bsp/u-boot/u-boot_git.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/recipes-bsp/u-boot/u-boot_git.bb b/recipes-bsp/u-boot/u-boot_git.bb
index 4f8690c..406914c 100644
--- a/recipes-bsp/u-boot/u-boot_git.bb
+++ b/recipes-bsp/u-boot/u-boot_git.bb
@@ -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