summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2023-11-28 08:36:56 -0300
committerGitHub <noreply@github.com>2023-11-28 08:36:56 -0300
commit0fc1504fb3c8721f80182f5ec54644efe1f1e842 (patch)
tree09035dd75d124e135cb26db443c65532ff9c77b5 /classes
parent7f0a7f3d19f564da0faf20e279b1b18a7f0068b6 (diff)
parent415373942a8f3ca4c6f04dff35823c065f43d696 (diff)
downloadmeta-freescale-0fc1504fb3c8721f80182f5ec54644efe1f1e842.tar.gz
Merge pull request #1694 from dwagenk/deterministic-localversion
classes: make localversion classes deterministic
Diffstat (limited to 'classes')
-rw-r--r--classes/fsl-kernel-localversion.bbclass5
-rw-r--r--classes/fsl-u-boot-localversion.bbclass7
2 files changed, 7 insertions, 5 deletions
diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-kernel-localversion.bbclass
index 98fcfa05..f7e0908f 100644
--- a/classes/fsl-kernel-localversion.bbclass
+++ b/classes/fsl-kernel-localversion.bbclass
@@ -25,8 +25,9 @@ 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 HEAD 2> /dev/null` 28 head=`git --git-dir=${S}/.git rev-parse --verify --short ${SRCREV} 2> /dev/null`
29 printf "%s%s" +g $head > ${S}/.scmversion 29 patches=`git --git-dir=${S}/.git rev-list --count ${SRCREV}..HEAD 2> /dev/null`
30 printf "%s%s%s%s" +g $head +p $patches > ${S}/.scmversion
30 31
31 sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config 32 sed -i -e "/CONFIG_LOCALVERSION_AUTO[ =]/d" ${B}/.config
32 echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config 33 echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config
diff --git a/classes/fsl-u-boot-localversion.bbclass b/classes/fsl-u-boot-localversion.bbclass
index ebde8ea7..d160ca98 100644
--- a/classes/fsl-u-boot-localversion.bbclass
+++ b/classes/fsl-u-boot-localversion.bbclass
@@ -17,9 +17,10 @@ UBOOT_LOCALVERSION = "${LOCALVERSION}"
17do_compile:prepend() { 17do_compile:prepend() {
18 if [ "${SCMVERSION}" = "y" ]; then 18 if [ "${SCMVERSION}" = "y" ]; then
19 # Add GIT revision to the local version 19 # Add GIT revision to the local version
20 head=`cd ${S} ; git rev-parse --verify --short HEAD 2> /dev/null` 20 head=`cd ${S} ; git rev-parse --verify --short ${SRCREV} 2> /dev/null`
21 printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${S}/.scmversion 21 patches=`cd ${S} ; git rev-list --count ${SRCREV}..HEAD 2> /dev/null`
22 printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${B}/.scmversion 22 printf "%s%s%s%s%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${S}/.scmversion
23 printf "%s%s%s%s%s" "${UBOOT_LOCALVERSION}" +g $head +p $patches > ${B}/.scmversion
23 else 24 else
24 printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion 25 printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion
25 printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion 26 printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion