diff options
-rw-r--r-- | classes/fsl-kernel-localversion.bbclass | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass index c782a3d3..d4322e25 100644 --- a/classes/fsl-kernel-localversion.bbclass +++ b/classes/fsl-kernel-localversion.bbclass | |||
@@ -12,34 +12,25 @@ | |||
12 | SCMVERSION ??= "y" | 12 | SCMVERSION ??= "y" |
13 | LOCALVERSION ??= "+fslc" | 13 | LOCALVERSION ??= "+fslc" |
14 | 14 | ||
15 | kernel_conf_variable() { | 15 | # LINUX_VERSION_EXTENSION is used as CONFIG_LOCALVERSION by kernel-yocto class |
16 | CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" | 16 | LINUX_VERSION_EXTENSION ?= "${LOCALVERSION}" |
17 | if test "$2" = "n" | ||
18 | then | ||
19 | echo "# CONFIG_$1 is not set" >> ${B}/.config | ||
20 | else | ||
21 | echo "CONFIG_$1=$2" >> ${B}/.config | ||
22 | fi | ||
23 | } | ||
24 | 17 | ||
25 | do_kernel_localversion[dirs] += "${S} ${B}" | 18 | do_kernel_localversion[dirs] += "${S} ${B}" |
26 | do_kernel_localversion() { | 19 | do_kernel_localversion() { |
27 | mkdir -p ${B} | ||
28 | echo "" > ${B}/.config | ||
29 | CONF_SED_SCRIPT="" | ||
30 | 20 | ||
31 | kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\"" | 21 | # Fallback for recipes not able to use LINUX_VERSION_EXTENSION |
32 | if [ "${SCMVERSION}" = "y" ]; then | 22 | if [ "${@bb.data.inherits_class('kernel-yocto', d)}" = "False" ]; then |
33 | kernel_conf_variable LOCALVERSION_AUTO y | 23 | echo "CONFIG_LOCALVERSION=${LOCALVERSION}" >> ${B}/.config |
34 | fi | 24 | fi |
35 | 25 | ||
36 | sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' | ||
37 | |||
38 | if [ "${SCMVERSION}" = "y" ]; then | 26 | if [ "${SCMVERSION}" = "y" ]; then |
39 | # Add GIT revision to the local version | 27 | # Add GIT revision to the local version |
40 | head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` | 28 | head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` |
41 | printf "%s%s" +g $head > ${S}/.scmversion | 29 | printf "%s%s" +g $head > ${S}/.scmversion |
30 | |||
31 | sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config | ||
32 | echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config | ||
42 | fi | 33 | fi |
43 | } | 34 | } |
44 | 35 | ||
45 | addtask kernel_localversion before do_configure after do_patch do_kernel_metadata | 36 | addtask kernel_localversion before do_configure after do_patch do_kernel_configme |