summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2014-09-01 11:20:30 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2014-09-01 12:18:36 -0300
commitf1f4115f32562f6fe6c34bbbad5d367b1a2da65f (patch)
tree85ec1998105bbb9d337f3ed963622218f1613f66 /classes
parentf082dda2ca452041ae62500f85cbb5ee44ddb277 (diff)
downloadmeta-fsl-arm-f1f4115f32562f6fe6c34bbbad5d367b1a2da65f.tar.gz
fsl-kernel-localversion: Easy LOCALVERSION handling
This class allow for easy extending of kernel recipes to easy the LOCALVERSION handling, allowing to 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') This about avoid code duplication among Layerscape and i.MX. Change-Id: I3999dbdc2cb761063fe5f83dea65ddb14adec80c Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'classes')
-rw-r--r--classes/fsl-kernel-localversion.bbclass39
1 files changed, 39 insertions, 0 deletions
diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass
new file mode 100644
index 0000000..bb4bdf5
--- /dev/null
+++ b/classes/fsl-kernel-localversion.bbclass
@@ -0,0 +1,39 @@
1# Freescale Kernel LOCALVERSION extension
2#
3# This allow to easy reuse of code between different kernel recipes
4#
5# The following options are supported:
6#
7# SCMVERSION Puts the Git hash in kernel local version
8# LOCALVERSION Value used in LOCALVERSION (default to '+fslc')
9#
10# Copyright 2014 (C) O.S. Systems Software LTDA.
11
12SCMVERSION ??= "y"
13LOCALVERSION ??= "+fslc"
14
15kernel_conf_variable() {
16 CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
17 if test "$2" = "n"
18 then
19 echo "# CONFIG_$1 is not set" >> ${S}/.config
20 else
21 echo "CONFIG_$1=$2" >> ${S}/.config
22 fi
23}
24
25do_configure_prepend() {
26 echo "" > ${S}/.config
27 CONF_SED_SCRIPT=""
28
29 kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
30 kernel_conf_variable LOCALVERSION_AUTO y
31
32 sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${S}/.config'
33
34 if [ "${SCMVERSION}" = "y" ]; then
35 # Add GIT revision to the local version
36 head=`git rev-parse --verify --short HEAD 2> /dev/null`
37 printf "%s%s" +g $head > ${S}/.scmversion
38 fi
39}