summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2014-09-01 11:20:32 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2014-09-01 12:18:36 -0300
commite3528efab77046e6e3841f79d29022b0855be46b (patch)
tree8ad646e6decdd25e2cfedba32143de2ff533df59
parent781a7691fcc8a3357da552748c7226af90184274 (diff)
downloadmeta-freescale-e3528efab77046e6e3841f79d29022b0855be46b.tar.gz
fsl-u-boot-localversion: Easy LOCALVERSION handling
This class allow for easy extending of U-Boot recipes to easy the LOCALVERSION handling, allowing to 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') This about avoid code duplication among Layerscape and i.MX. Change-Id: Icec618092d1f70606051619b6f6118f50e7f1ba5 Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--meta-fsl-arm/classes/fsl-u-boot-localversion.bbclass27
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-fsl-arm/classes/fsl-u-boot-localversion.bbclass b/meta-fsl-arm/classes/fsl-u-boot-localversion.bbclass
new file mode 100644
index 000000000..f7e097141
--- /dev/null
+++ b/meta-fsl-arm/classes/fsl-u-boot-localversion.bbclass
@@ -0,0 +1,27 @@
1# Freescale U-Boot LOCALVERSION extension
2#
3# This allow to easy reuse of code between different U-Boot recipes
4#
5# The following options are supported:
6#
7# SCMVERSION Puts the Git hash in U-Boot local version
8# LOCALVERSION Value used in LOCALVERSION (default to '+fslc')
9#
10# Copyright 2014 (C) O.S. Systems Software LTDA.
11
12SCMVERSION ??= "y"
13LOCALVERSION ??= "+fslc"
14
15UBOOT_LOCALVERSION = "${LOCALVERSION}"
16
17do_compile_prepend() {
18 if [ "${SCMVERSION}" = "y" ]; then
19 # Add GIT revision to the local version
20 head=`git rev-parse --verify --short HEAD 2> /dev/null`
21 printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${S}/.scmversion
22 printf "%s%s%s" "${UBOOT_LOCALVERSION}" +g $head > ${B}/.scmversion
23 else
24 printf "%s" "${UBOOT_LOCALVERSION}" > ${S}/.scmversion
25 printf "%s" "${UBOOT_LOCALVERSION}" > ${B}/.scmversion
26 fi
27}