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

classes: make localversion classes deterministic #1694

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions classes/fsl-kernel-localversion.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ do_kernel_localversion() {

if [ "${SCMVERSION}" = "y" ]; then
# Add GIT revision to the local version
head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null`
printf "%s%s" +g $head > ${S}/.scmversion
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`
printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion

sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config
echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config
Expand Down
7 changes: 4 additions & 3 deletions classes/fsl-u-boot-localversion.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ UBOOT_LOCALVERSION = "${LOCALVERSION}"
do_compile:prepend() {
if [ "${SCMVERSION}" = "y" ]; then
# Add GIT revision to the local version
head=`cd ${S} ; git rev-parse --verify --short HEAD 2> /dev/null`
printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${S}/.scmversion
printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${B}/.scmversion
head=`cd ${S} ; git rev-parse --verify --short ${SRCREV} 2> /dev/null`
patches=`cd ${S} ; git rev-list --count ${SRCREV}..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
Expand Down
Loading