summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-04-05 15:56:06 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-04-10 09:11:43 +0200
commite88090f9bc1631779bc2d11383b4080e7b4fb437 (patch)
treed2ea619423b6e2467dda3e35eab40164c1d1dcb4
parent80384c3824aa4c6d7a30dd74949b90b711006034 (diff)
apalis/colibri-t20/t30/tk1: u-boot: new version plus git hash
Use the new version variables plus the git hash. Inspired by meta-freescale/classes/fsl-u-boot-localversion.bbclass. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--classes/tegra-u-boot-localversion.bbclass29
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb1
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex_git.bb1
3 files changed, 31 insertions, 0 deletions
diff --git a/classes/tegra-u-boot-localversion.bbclass b/classes/tegra-u-boot-localversion.bbclass
new file mode 100644
index 0000000..fba638c
--- /dev/null
+++ b/classes/tegra-u-boot-localversion.bbclass
@@ -0,0 +1,29 @@
+# Toradex Tegra U-Boot LOCALVERSION extension
+#
+# This allow to easy reuse of code between different U-Boot recipes
+#
+# The following options are supported:
+#
+# SCMVERSION Puts the Git hash in U-Boot local version
+# LOCALVERSION Value used in LOCALVERSION (default to '+fslc')
+#
+# Copied from meta-freescale/classes/fsl-u-boot-localversion.bbclass
+# Copyright 2014 (C) O.S. Systems Software LTDA.
+# Copyright 2017 (C) Toradex Inc.
+
+SCMVERSION ??= "y"
+LOCALVERSION ??= "-${TDX_VER_INT}"
+
+UBOOT_LOCALVERSION = "${LOCALVERSION}"
+
+do_compile_prepend() {
+ if [ "${SCMVERSION}" = "y" ]; then
+ # Add GIT revision to the local version
+ head=`cd ${S} ; git rev-parse --verify --short HEAD 2> /dev/null`
+ printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${S}/.scmversion
+ printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${B}/.scmversion
+ else
+ printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion
+ printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion
+ fi
+}
diff --git a/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb b/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb
index 0666387..6a1eece 100644
--- a/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb
+++ b/recipes-bsp/u-boot/u-boot-toradex-fw-utils_git.bb
@@ -6,6 +6,7 @@ PROVIDES = "u-boot-fw-utils"
DEPENDS = "mtd-utils"
include conf/tdx_version.conf
+inherit tegra-u-boot-localversion
COMPATIBLE_MACHINE = "(apalis-t30|apalis-tk1|colibri-t20|colibri-t30)"
diff --git a/recipes-bsp/u-boot/u-boot-toradex_git.bb b/recipes-bsp/u-boot/u-boot-toradex_git.bb
index bf715a7..06ae5d1 100644
--- a/recipes-bsp/u-boot/u-boot-toradex_git.bb
+++ b/recipes-bsp/u-boot/u-boot-toradex_git.bb
@@ -1,5 +1,6 @@
require recipes-bsp/u-boot/u-boot.inc
include conf/tdx_version.conf
+inherit tegra-u-boot-localversion
PROVIDES = "u-boot virtual/bootloader"
DEPENDS += "dtc-native"