From e88090f9bc1631779bc2d11383b4080e7b4fb437 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 5 Apr 2017 15:56:06 +0200 Subject: 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 Acked-by: Max Krummenacher --- classes/tegra-u-boot-localversion.bbclass | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 classes/tegra-u-boot-localversion.bbclass (limited to 'classes') 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 +} -- cgit v1.2.3