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

index 0ff68ced9881160ec7b126db39d5571f9a7f15d1..275691ab5b3c171d749e0ef62a11ba78115baa88 100644 (file)
@@ -9,6 +9,8 @@ require recipes-kernel/linux/linux-qoriq-sdk.inc
 
 PR = "${INC_PR}.1"
 
+SCMVERSION ?= "y"
+
 DEPENDS_append = " libgcc"
 KERNEL_CC_append = " ${TOOLCHAIN_OPTIONS}"
 KERNEL_LD_append = " ${TOOLCHAIN_OPTIONS}"
@@ -23,7 +25,13 @@ do_configure_prepend() {
        fi
 
        # append sdk version in kernel version if SDK_VERSION is defined
-       if [ -n "${SDK_VERSION}" ]; then
-               echo "CONFIG_LOCALVERSION=\"-${SDK_VERSION}\"" >> ${S}/.config
-       fi
+        if [ -n "${SDK_VERSION}" ]; then
+                 echo "CONFIG_LOCALVERSION=\"-${SDK_VERSION}\"" >> ${S}/.config
+        fi
+    
+        # Add GIT revision to the local version 
+        if [ "${SCMVERSION}" = "y" ]; then
+               head=`git rev-parse --verify --short HEAD 2> /dev/null`
+               printf "%s%s" +g $head > ${S}/.scmversion
+        fi
 }