summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2019-12-02 13:54:21 +0000
committerStefan Agner <stefan.agner@toradex.com>2019-12-02 13:54:21 +0000
commit6ea9021f930c9df2615f3b4a9b3d529e3450a9db (patch)
tree032c8cf3d8fb3130d1805ec8ed0a6166dd0e7284
parent98dbc9f5c52616618cbf722965ce2f5dd90409db (diff)
toradex-u-boot-localversion: add Toradex specific local version
Add Toradex specific local version implementation. This is very similar to what meta-freescale carries, but allows us to reuse the class in all U-Boot recipes used by Toradex. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--classes/toradex-u-boot-localversion.bbclass25
1 files changed, 25 insertions, 0 deletions
diff --git a/classes/toradex-u-boot-localversion.bbclass b/classes/toradex-u-boot-localversion.bbclass
new file mode 100644
index 0000000..d2b4910
--- /dev/null
+++ b/classes/toradex-u-boot-localversion.bbclass
@@ -0,0 +1,25 @@
+# Toradex 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
+#
+# Copied from meta-freescale/classes/fsl-u-boot-localversion.bbclass
+# Copyright 2014 (C) O.S. Systems Software LTDA.
+# Copyright 2017-2019 (C) Toradex Inc.
+
+SCMVERSION ??= "y"
+LOCALVERSION ??= "-${TDX_VERSION}"
+
+UBOOT_LOCALVERSION = "${LOCALVERSION}"
+
+do_compile_prepend() {
+ if [ "${SCMVERSION}" = "y" ]; then
+ head=`cd ${S} ; git rev-parse --verify --short HEAD 2> /dev/null`
+ printf "%s+git.%s" "${UBOOT_LOCALVERSION}" $head > ${S}/.scmversion
+ printf "%s+git.%s" "${UBOOT_LOCALVERSION}" $head > ${B}/.scmversion
+ fi
+}