u-boot: Add UBOOT_LOCALVERSION to control version string

Submitted by chase maupin on April 10, 2013, 9:38 p.m.


Message ID 1365629886-6391-1-git-send-email-Chase.Maupin@ti.com
State New
Headers show

Commit Message

chase maupin April 10, 2013, 9:38 p.m.
* Add a variable called UBOOT_LOCALVERSION which when set will
  place a version string in the .scmversion file of the u-boot
  sources.  This string will be picked up by the u-boot Makefile
  and will be appended to the u-boot version.  This is done to
  make it easier to identify what revision of the u-boot sources
  are being run.  For example you can use a setting like the
  following to add the short commit id to the u-boot version

UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV', True).partition('+')[2][0:7]}"

Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
 meta/recipes-bsp/u-boot/u-boot.inc |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index ae53b90..366093e 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -16,6 +16,10 @@  python () {
 		raise bb.parse.SkipPackage("because UBOOT_MACHINE is not set")
+# Allow setting an additional version string that will be picked up by the
+# u-boot build system and appended to the u-boot version.
 # Some versions of u-boot use .bin and others use .img.  By default use .bin
 # but enable individual recipes to change this value.
 UBOOT_SUFFIX ?= "bin"
@@ -40,6 +44,9 @@  do_compile () {
 	unset LDFLAGS
 	unset CFLAGS
 	unset CPPFLAGS
+	echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
+	echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
 	oe_runmake ${UBOOT_MACHINE}
 	oe_runmake ${UBOOT_MAKE_TARGET}