summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2022-08-01 12:30:59 -0300
committerGitHub <noreply@github.com>2022-08-01 12:30:59 -0300
commitc4347b507c2ba0d7eb3917303f83631244bf5048 (patch)
treed987117e44e590fe3d5416495d6ea3697bc7cbb3
parentdbfb1f0101b57de5375b2efee367b093bdbcc933 (diff)
parenta3667f03b7ab54b555a4f06278a29b10a914608d (diff)
downloadmeta-freescale-c4347b507c2ba0d7eb3917303f83631244bf5048.tar.gz
Merge pull request #1156 from Freescale/backport-1155-to-dunfell
[Backport dunfell] classes: fsl-kernel-localversion: fix usage with devtool
-rw-r--r--classes/fsl-kernel-localversion.bbclass27
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 @@
12SCMVERSION ??= "y" 12SCMVERSION ??= "y"
13LOCALVERSION ??= "+fslc" 13LOCALVERSION ??= "+fslc"
14 14
15kernel_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;" 16LINUX_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
25do_kernel_localversion[dirs] += "${S} ${B}" 18do_kernel_localversion[dirs] += "${S} ${B}"
26do_kernel_localversion() { 19do_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
45addtask kernel_localversion before do_configure after do_patch do_kernel_metadata 36addtask kernel_localversion before do_configure after do_patch do_kernel_configme