summaryrefslogtreecommitdiffstats
path: root/classes/fsl-kernel-localversion.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/fsl-kernel-localversion.bbclass')
-rw-r--r--classes/fsl-kernel-localversion.bbclass44
1 files changed, 22 insertions, 22 deletions
diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass
index 479d113e8..9b44fe194 100644
--- a/classes/fsl-kernel-localversion.bbclass
+++ b/classes/fsl-kernel-localversion.bbclass
@@ -18,30 +18,30 @@ LINUX_VERSION_EXTENSION ?= "${@bb.utils.contains('SCMVERSION', 'y', '', '${LOCAL
18do_kernel_localversion[dirs] += "${S} ${B}" 18do_kernel_localversion[dirs] += "${S} ${B}"
19do_kernel_localversion() { 19do_kernel_localversion() {
20 20
21 # Fallback for recipes not able to use LINUX_VERSION_EXTENSION 21 # Fallback for recipes not able to use LINUX_VERSION_EXTENSION
22 if [ "${@bb.data.inherits_class('kernel-yocto', d)}" = "False" ]; then 22 if [ "${@bb.data.inherits_class('kernel-yocto', d)}" = "False" ]; then
23 echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >> ${B}/.config 23 echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >> ${B}/.config
24 fi 24 fi
25 25
26 if [ "${SCMVERSION}" = "y" ]; then 26 if [ "${SCMVERSION}" = "y" ]; then
27 # Add GIT revision to the local version 27 # Add GIT revision to the local version
28 if [ "${SRCREV}" = "INVALID" ]; then 28 if [ "${SRCREV}" = "INVALID" ]; then
29 hash=${SRCREV_machine} 29 hash=${SRCREV_machine}
30 else 30 else
31 hash=${SRCREV} 31 hash=${SRCREV}
32 fi 32 fi
33 if [ "$hash" = "AUTOINC" ]; then 33 if [ "$hash" = "AUTOINC" ]; then
34 branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` 34 branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD`
35 head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null` 35 head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null`
36 else 36 else
37 head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null` 37 head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null`
38 fi 38 fi
39 patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null` 39 patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null`
40 printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion 40 printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion
41 41
42 sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config 42 sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config
43 echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config 43 echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config
44 fi 44 fi
45} 45}
46 46
47addtask kernel_localversion before do_configure after do_patch do_kernel_configme 47addtask kernel_localversion before do_configure after do_patch do_kernel_configme