diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2023-12-04 11:31:10 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 11:31:10 -0300 |
commit | 457465ca5c2063c49a4c230dcc2634d6c7e5bc63 (patch) | |
tree | 554692e0d8082ff25dbe5df8fd446f608632373f | |
parent | 62452549927794e9857bff6b49b368303ea4fbf4 (diff) | |
parent | 84c08eb2921c6c35cdfee142356a7ae6f48eb23d (diff) | |
download | meta-freescale-457465ca5c2063c49a4c230dcc2634d6c7e5bc63.tar.gz |
Merge pull request #1697 from Freescale/backport-1696-to-kirkstone
[Backport kirkstone] fsl-kernel-localversion: fix SRCREV_machine and AUTOREV use cases
-rw-r--r-- | classes/fsl-kernel-localversion.bbclass | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass index f7e0908f..9ef0a62f 100644 --- a/classes/fsl-kernel-localversion.bbclass +++ b/classes/fsl-kernel-localversion.bbclass | |||
@@ -25,8 +25,18 @@ do_kernel_localversion() { | |||
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 | head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV} 2> /dev/null` | 28 | if [ "${SRCREV}" = "INVALID" ]; then |
29 | patches=`git --git-dir=${S}/.git rev-list --count ${SRCREV}..HEAD 2> /dev/null` | 29 | hash=${SRCREV_machine} |
30 | else | ||
31 | hash=${SRCREV} | ||
32 | fi | ||
33 | if [ "$hash" = "AUTOINC" ]; then | ||
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` | ||
36 | else | ||
37 | head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null` | ||
38 | fi | ||
39 | patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null` | ||
30 | printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion | 40 | printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion |
31 | 41 | ||
32 | sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config | 42 | sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config |