meta-freescale/classes/fsl-kernel-localversion.bbclass
Otavio Salvador f8517afc7a Move meta-fsl-arm content to layer root
The meta-fsl-arm is going to be used as the base for this layer. It
contains a clean history and allowing a more granullar set of changes.

This commit is just a rename of all contents of meta-fsl-arm
subdirectory to this layer's root, subsequent changes are based on top
of that.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2015-07-16 15:01:29 -03:00

40 lines
1.0 KiB
Plaintext

# Freescale Kernel LOCALVERSION extension
#
# This allow to easy reuse of code between different kernel recipes
#
# The following options are supported:
#
# SCMVERSION Puts the Git hash in kernel local version
# LOCALVERSION Value used in LOCALVERSION (default to '+fslc')
#
# Copyright 2014, 2015 (C) O.S. Systems Software LTDA.
SCMVERSION ??= "y"
LOCALVERSION ??= "+fslc"
kernel_conf_variable() {
CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
if test "$2" = "n"
then
echo "# CONFIG_$1 is not set" >> ${B}/.config
else
echo "CONFIG_$1=$2" >> ${B}/.config
fi
}
do_configure_prepend() {
echo "" > ${B}/.config
CONF_SED_SCRIPT=""
kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
kernel_conf_variable LOCALVERSION_AUTO y
sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config'
if [ "${SCMVERSION}" = "y" ]; then
# Add GIT revision to the local version
head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null`
printf "%s%s" +g $head > ${S}/.scmversion
fi
}