From 2aa3a1ccfa820c8dd3188567a1fbc04ccef21a15 Mon Sep 17 00:00:00 2001 From: Chunrong Guo Date: Thu, 27 Mar 2014 13:46:20 +0800 Subject: [PATCH] u-boot: add git revision to the local version Signed-off-by: Chunrong Guo --- meta-fsl-ppc/recipes-bsp/u-boot/u-boot_git.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta-fsl-ppc/recipes-bsp/u-boot/u-boot_git.bb b/meta-fsl-ppc/recipes-bsp/u-boot/u-boot_git.bb index 4f8690c2..406914cb 100644 --- a/meta-fsl-ppc/recipes-bsp/u-boot/u-boot_git.bb +++ b/meta-fsl-ppc/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 -- 2.40.1