From 9f56bcb81ee6e2887ad81e23ebe896668426084a Mon Sep 17 00:00:00 2001 From: Chunrong Guo Date: Thu, 27 Mar 2014 13:46:20 +0800 Subject: u-boot: add git revision to the local version Signed-off-by: Chunrong Guo --- recipes-bsp/u-boot/u-boot_git.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'recipes-bsp/u-boot') 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 -- cgit v1.2.3-54-g00ecf