From 064bcee9a61f85f6320ded4038f9dbaacdd5579a Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 2 Oct 2012 11:50:45 -0300 Subject: [PATCH] linux-imx.inc: Add support to include GIT hash in local version 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 --- meta-fsl-arm/recipes-kernel/linux/linux-imx.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx.inc b/meta-fsl-arm/recipes-kernel/linux/linux-imx.inc index 69095821..06a10f14 100644 --- a/meta-fsl-arm/recipes-kernel/linux/linux-imx.inc +++ b/meta-fsl-arm/recipes-kernel/linux/linux-imx.inc @@ -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 -- 2.40.1