diff options
Diffstat (limited to 'classes/fsl-kernel-localversion.bbclass')
| -rw-r--r-- | classes/fsl-kernel-localversion.bbclass | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass index fae3fe1d9..9b44fe194 100644 --- a/classes/fsl-kernel-localversion.bbclass +++ b/classes/fsl-kernel-localversion.bbclass | |||
| @@ -13,36 +13,35 @@ SCMVERSION ??= "y" | |||
| 13 | LOCALVERSION ??= "+fslc" | 13 | LOCALVERSION ??= "+fslc" |
| 14 | 14 | ||
| 15 | # LINUX_VERSION_EXTENSION is used as CONFIG_LOCALVERSION by kernel-yocto class | 15 | # LINUX_VERSION_EXTENSION is used as CONFIG_LOCALVERSION by kernel-yocto class |
| 16 | LINUX_VERSION_EXTENSION ?= \ | 16 | LINUX_VERSION_EXTENSION ?= "${@bb.utils.contains('SCMVERSION', 'y', '', '${LOCALVERSION}', d)}" |
| 17 | "${@bb.utils.contains('SCMVERSION', 'y', '', '${LOCALVERSION}', d)}" | ||
| 18 | 17 | ||
| 19 | do_kernel_localversion[dirs] += "${S} ${B}" | 18 | do_kernel_localversion[dirs] += "${S} ${B}" |
| 20 | do_kernel_localversion() { | 19 | do_kernel_localversion() { |
| 21 | 20 | ||
| 22 | # Fallback for recipes not able to use LINUX_VERSION_EXTENSION | 21 | # Fallback for recipes not able to use LINUX_VERSION_EXTENSION |
| 23 | if [ "${@bb.data.inherits_class('kernel-yocto', d)}" = "False" ]; then | 22 | if [ "${@bb.data.inherits_class('kernel-yocto', d)}" = "False" ]; then |
| 24 | echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >> ${B}/.config | 23 | echo 'CONFIG_LOCALVERSION="${LOCALVERSION}"' >> ${B}/.config |
| 25 | fi | 24 | fi |
| 26 | 25 | ||
| 27 | if [ "${SCMVERSION}" = "y" ]; then | 26 | if [ "${SCMVERSION}" = "y" ]; then |
| 28 | # Add GIT revision to the local version | 27 | # Add GIT revision to the local version |
| 29 | if [ "${SRCREV}" = "INVALID" ]; then | 28 | if [ "${SRCREV}" = "INVALID" ]; then |
| 30 | hash=${SRCREV_machine} | 29 | hash=${SRCREV_machine} |
| 31 | else | 30 | else |
| 32 | hash=${SRCREV} | 31 | hash=${SRCREV} |
| 33 | fi | 32 | fi |
| 34 | if [ "$hash" = "AUTOINC" ]; then | 33 | if [ "$hash" = "AUTOINC" ]; then |
| 35 | branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` | 34 | branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD` |
| 36 | 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` |
| 37 | else | 36 | else |
| 38 | 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` |
| 39 | fi | 38 | fi |
| 40 | 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` |
| 41 | printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion | 40 | printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion |
| 42 | 41 | ||
| 43 | sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config | 42 | sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config |
| 44 | echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config | 43 | echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config |
| 45 | fi | 44 | fi |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 48 | addtask kernel_localversion before do_configure after do_patch do_kernel_configme | 47 | addtask kernel_localversion before do_configure after do_patch do_kernel_configme |
