Skip to content

Commit

Permalink
Merge pull request #1697 from Freescale/backport-1696-to-kirkstone
Browse files Browse the repository at this point in the history
[Backport kirkstone] fsl-kernel-localversion: fix SRCREV_machine and AUTOREV use cases
  • Loading branch information
otavio authored Dec 4, 2023
2 parents 6245254 + 84c08eb commit 457465c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions classes/fsl-kernel-localversion.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,18 @@ do_kernel_localversion() {

if [ "${SCMVERSION}" = "y" ]; then
# Add GIT revision to the local version
head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV} 2> /dev/null`
patches=`git --git-dir=${S}/.git rev-list --count ${SRCREV}..HEAD 2> /dev/null`
if [ "${SRCREV}" = "INVALID" ]; then
hash=${SRCREV_machine}
else
hash=${SRCREV}
fi
if [ "$hash" = "AUTOINC" ]; then
branch=`git --git-dir=${S}/.git symbolic-ref --short -q HEAD`
head=`git --git-dir=${S}/.git rev-parse --verify --short origin/${branch} 2> /dev/null`
else
head=`git --git-dir=${S}/.git rev-parse --verify --short $hash 2> /dev/null`
fi
patches=`git --git-dir=${S}/.git rev-list --count $head..HEAD 2> /dev/null`
printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion

sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config
Expand Down

0 comments on commit 457465c

Please sign in to comment.