Skip to contentSkip to conversation

linux-ti-staging: Update KERNEL_LOCALVERSION

PATCH New Ryan Eatmon 1 participant 2 messages Feb 28, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 linux-ti-staging: Update KERNEL_LOCALVERSION

The use of KERNEL_LOCALVERSION for controlling the kernel version has changed recently. Placing the value of KERNEL_LOCALVERSION in .scmversion was causing it to duplicate the string in the final version.

Instead, drop KERNEL_LOCALVERSION to just identify that it comes from TI, and that it is an RT kernel. Additionally, place the commit sha for the kernel into the .scmversion file explicitly to be both backward and forward compatible.

---
 .../recipes-kernel/linux/linux-ti-staging-rt_6.1.bb    |  2 ++
 meta-ti-bsp/recipes-kernel/linux/setup-defconfig.inc   | 10 +++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)
meta-ti-bsp/recipes-kernel/linux/linux-ti-staging-rt_6.1.bb +2 -0
index e78707f4..b7426aff 100644
@@ -1,5 +1,7 @@
 require linux-ti-staging_6.1.bb
 
+KERNEL_LOCALVERSION:append = "-rt"
+
 # Look in the generic major.minor directory for files
 # This will have priority over generic non-rt path
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-6.1:"
meta-ti-bsp/recipes-kernel/linux/setup-defconfig.inc +5 -5
index df7d9ac8..8da90c79 100644
@@ -1,6 +1,4 @@
-# KERNEL_LOCALVERSION can be set to add a tag to the end of the
-# kernel version string.  such as the commit id
-KERNEL_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
+KERNEL_LOCALVERSION = "-ti"
 
 # Check the defconfig file and see if it points to an in kernel
 # defconfig that should be used, or if it is a complete config file
@@ -13,8 +11,10 @@ do_configure() {
     # tree config
     cp ${WORKDIR}/defconfig ${B}/.config
 
-    echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
-    echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
+    scm_version=$(printf '%s%s' -g $(git -C ${S} rev-parse --verify HEAD 2>/dev/null | cut -c1-12))
+
+    echo ${scm_version} > ${B}/.scmversion
+    echo ${scm_version} > ${S}/.scmversion
 
     # Zero, when using "tisdk" configs, pass control to defconfig_builder
     config=`cat ${B}/.config | grep use-tisdk-config | cut -d= -f2`
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 u-boot-ti: Change from UBOOT_LOCALVERSION and SRCPV

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.

---
 meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc +6 -3
index 855307d9..2c0d4fc4 100644
@@ -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"
Signature · 1 line
2.17.1