Skip to contentSkip to conversation

kernel u-boot: Fix formulation of LOCALVERSION

PATCH In review Ryan Eatmon 2 participants 3 messages Jul 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kernel u-boot: Fix formulation of LOCALVERSION

devtool does not work with the current formulation of the LOCALVERSION variables. We need to use SRCPV to avoid AUTOREV on bleeding builds, but there will be no
+ in the string, so we cannot split on that. Just use SRCPV directly.

---
v2: More testing showed the first pass caused some problems.

 recipes-bsp/u-boot/u-boot-ti.inc         | 2 +-
 recipes-kernel/linux/setup-defconfig.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
recipes-bsp/u-boot/u-boot-ti.inc +1 -1
index e7c93335..1f8fb6de 100644
@@ -1,6 +1,6 @@
 # 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).split('+')[1]}"
+UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
 
 UBOOT_SUFFIX ?= "img"
 SPL_BINARY ?= "MLO"
recipes-kernel/linux/setup-defconfig.inc +1 -1
index 1e97acc0..df7d9ac8 100644
@@ -1,6 +1,6 @@
 # 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).split('+')[1]}"
+KERNEL_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
 
 # 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
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Ryan Eatmon via lists.yoctoproject.org

devtool does not work with the current formulation of the LOCALVERSION variables. We need to use SRCPV to avoid AUTOREV on bleeding builds, but there will be no
+ in the string, so we cannot split on that. Just use SRCPV directly.

I guess the description is a bit off?

Quoted 35 lines

---
v2: More testing showed the first pass caused some problems.

 recipes-bsp/u-boot/u-boot-ti.inc         | 2 +-
 recipes-kernel/linux/setup-defconfig.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
recipes-bsp/u-boot/u-boot-ti.inc +1 -1
index e7c93335..1f8fb6de 100644
@@ -1,6 +1,6 @@
 # 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).split('+')[1]}"
+UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
 
 UBOOT_SUFFIX ?= "img"
 SPL_BINARY ?= "MLO"
recipes-kernel/linux/setup-defconfig.inc +1 -1
index 1e97acc0..df7d9ac8 100644
@@ -1,6 +1,6 @@
 # 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).split('+')[1]}"
+KERNEL_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
 
 # 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
Signature · 1 line
2.17.1
#2 lore raw
Quoted 8 lines · Denys Dmytriyenko
Quoted 5 lines · Ryan Eatmon via lists.yoctoproject.org

devtool does not work with the current formulation of the LOCALVERSION variables. We need to use SRCPV to avoid AUTOREV on bleeding builds, but there will be no
+ in the string, so we cannot split on that. Just use SRCPV directly.

I guess the description is a bit off?

The description should still be valid because the code that is being replaced is doing a blind split and expecting that to work. The new code works if the + is there or not. I could rework the description if needed...

Quoted 36 lines
Quoted 36 lines

---
v2: More testing showed the first pass caused some problems.

  recipes-bsp/u-boot/u-boot-ti.inc         | 2 +-
  recipes-kernel/linux/setup-defconfig.inc | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
recipes-bsp/u-boot/u-boot-ti.inc +1 -1
index e7c93335..1f8fb6de 100644
@@ -1,6 +1,6 @@
  # 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).split('+')[1]}"
+UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
 
  UBOOT_SUFFIX ?= "img"
  SPL_BINARY ?= "MLO"
recipes-kernel/linux/setup-defconfig.inc +1 -1
index 1e97acc0..df7d9ac8 100644
@@ -1,6 +1,6 @@
  # 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).split('+')[1]}"
+KERNEL_LOCALVERSION = "-g${@d.getVar('SRCPV', True).replace('AUTOINC+','')[:10]}"
 
  # 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
Signature · 1 line
2.17.1
Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS