[meta-freescale] [meta-fsl-ppc][PATCH v2] linux-qoriq-sdk: add git revision to the local version

b40290 at freescale.com b40290 at freescale.com
Wed Mar 26 22:41:02 PDT 2014


From: Chunrong Guo <B40290 at freescale.com>

Signed-off-by: Chunrong Guo <B40290 at freescale.com>
---
 recipes-kernel/linux/linux-qoriq-sdk.bb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/recipes-kernel/linux/linux-qoriq-sdk.bb b/recipes-kernel/linux/linux-qoriq-sdk.bb
index 0ff68ce..275691a 100644
--- a/recipes-kernel/linux/linux-qoriq-sdk.bb
+++ b/recipes-kernel/linux/linux-qoriq-sdk.bb
@@ -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
 }
-- 
1.8.3.2




More information about the meta-freescale mailing list