Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport scarthgap] Fix uboot localversion #1890

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions classes/fsl-u-boot-localversion.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ UBOOT_LOCALVERSION = "${LOCALVERSION}"
do_compile:prepend() {
if [ "${SCMVERSION}" = "y" ]; then
# Add GIT revision to the local version
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
printf "%s%s%s%s" +g $head +p $patches > ${B}/.scmversion
else
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%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${S}/.scmversion
printf "%s%s%s%s%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${B}/.scmversion
else
printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion
printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion
fi
Expand Down
Loading