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

b40290 at freescale.com b40290 at freescale.com
Wed Mar 26 22:46:20 PDT 2014


From: Chunrong Guo <B40290 at freescale.com>

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

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
-- 
1.8.3.2




More information about the meta-freescale mailing list