]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-imx.inc: Add support to include GIT hash in local version
authorOtavio Salvador <otavio@ossystems.com.br>
Tue, 2 Oct 2012 14:50:45 +0000 (11:50 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 2 Oct 2012 17:53:13 +0000 (14:53 -0300)
When SCMVERSION is 'y' the GIT version is include in the local version
along the value at LOCALVERSION setting.

Change-Id: I973c2d098910c88db6e26ee6006fadaa23c09204
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/recipes-kernel/linux/linux-imx.inc

index 690958219d2445bc4ea18c2d6ea396448578d9f7..06a10f14dfbc689ef0315443b2311fe457e22c3b 100644 (file)
@@ -5,12 +5,13 @@ DESCRIPTION = "Linux kernel for imx platforms"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 
-INC_PR = "r30"
+INC_PR = "r31"
 
 inherit kernel
 
 # Put a local version until we have a true SRCREV to point to
-LOCALVERSION ?= "+yocto-${DATE}"
+LOCALVERSION ?= "+yocto"
+SCMVERSION ?= "y"
 
 SRC_URI = "git://git.freescale.com/imx/linux-2.6-imx.git \
            file://defconfig \
@@ -36,6 +37,12 @@ do_configure_prepend() {
        kernel_conf_variable LOCALVERSION_AUTO n
 
        sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${S}/.config'
+
+       if [ "${SCMVERSION}" = "y" ]; then
+               # Add GIT revision to the local version
+               head=`git rev-parse --verify --short HEAD 2> /dev/null`
+               printf "%s%s" +g $head > ${S}/.scmversion
+       fi
 }
 
 # install nedded headers for imx-test compilation