From: Chunrong Guo Date: Thu, 27 Mar 2014 05:41:02 +0000 (+0800) Subject: linux-qoriq-sdk: add git revision to the local version X-Git-Tag: 2.1~534^2~168 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=18eb1a43e33ec477ba7ec3a4a8f0bdb427206ed5;p=meta-freescale.git linux-qoriq-sdk: add git revision to the local version Signed-off-by: Chunrong Guo --- diff --git a/meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb b/meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb index 0ff68ced..275691ab 100644 --- a/meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb +++ b/meta-fsl-ppc/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 }