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

login
register
mail settings
Submitter chunrong guo
Date March 26, 2014, 10:31 a.m.
Message ID <1395829885-5108-1-git-send-email-b40290@freescale.com>
Download mbox | patch
Permalink /patch/69255/
State Superseded
Headers show

Comments

chunrong guo - March 26, 2014, 10:31 a.m.
From: Chunrong Guo <B40290@freescale.com>

Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
 recipes-kernel/linux/linux-qoriq-sdk.bb | 8 ++++++++
 1 file changed, 8 insertions(+)
Zhenhua Luo - March 26, 2014, 12:41 p.m.
Please do not mix space character and tab, replace tab with space character. 


Best Regards,

Zhenhua

> -----Original Message-----
> From: b40290@freescale.com [mailto:b40290@freescale.com]
> Sent: Wednesday, March 26, 2014 6:31 PM
> To: meta-freescale@yoctoproject.org
> Cc: Liu Ting-B28495; Luo Zhenhua-B19537; Guo Chunrong-B40290
> Subject: [meta-fsl-ppc][PATCH] linux-qoriq-sdk: add git revision to the
> local version
> 
> From: Chunrong Guo <B40290@freescale.com>
> 
> Signed-off-by: Chunrong Guo <B40290@freescale.com>
> ---
>  recipes-kernel/linux/linux-qoriq-sdk.bb | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/recipes-kernel/linux/linux-qoriq-sdk.bb b/recipes-
> kernel/linux/linux-qoriq-sdk.bb
> index 0ff68ce..50d6e62 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}"
> @@ -26,4 +28,10 @@ do_configure_prepend() {
>  	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
>

Patch

diff --git a/recipes-kernel/linux/linux-qoriq-sdk.bb b/recipes-kernel/linux/linux-qoriq-sdk.bb
index 0ff68ce..50d6e62 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}"
@@ -26,4 +28,10 @@  do_configure_prepend() {
 	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
 }