From 6ea9021f930c9df2615f3b4a9b3d529e3450a9db Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 2 Dec 2019 13:54:21 +0000 Subject: 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 --- classes/toradex-u-boot-localversion.bbclass | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 classes/toradex-u-boot-localversion.bbclass 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 +} -- cgit v1.2.3