diff mbox series

[meta-ti,master/kirkstone,2/2] u-boot-ti: Change from UBOOT_LOCALVERSION and SRCPV

Message ID 20240228221655.19511-2-reatmon@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,master/kirkstone,1/2] linux-ti-staging: Update KERNEL_LOCALVERSION | expand

Commit Message

Ryan Eatmon Feb. 28, 2024, 10:16 p.m. UTC
Stop using UBOOT_LOCALVERSION, and copy what is done in the kernel recipe.  This
allows us to set the correct SHA into the version string even if AUTOREV is used
since SRCPV is no longer set in oe-core.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
index 855307d9..2c0d4fc4 100644
--- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
+++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc
@@ -1,6 +1,9 @@ 
-# UBOOT_LOCALVERSION can be set to add a tag to the end of the
-# U-boot version string.  such as the commit id
-UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
+do_compile:prepend () {
+    scm_version=$(printf '%s%s' -ti-g $(git -C ${S} rev-parse --verify HEAD 2>/dev/null | cut -c1-12))
+
+    echo ${scm_version} > ${B}/.scmversion
+    echo ${scm_version} > ${S}/.scmversion
+}
 
 UBOOT_SUFFIX ?= "img"
 SPL_BINARY ?= "MLO"