summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorTing Liu <ting.liu@freescale.com>2015-12-22 16:16:49 +0800
committerZhenhua Luo <zhenhua.luo@nxp.com>2015-12-28 10:59:00 +0800
commitfbf43a99c0fe81d5ad83c2a69910038451580a05 (patch)
tree0084e7878faca7ec1c32a59500814b5f708f14c0 /classes
parentb46c906b0eff13a2ef610b6389a88382862e2e5d (diff)
downloadmeta-fsl-ppc-fbf43a99c0fe81d5ad83c2a69910038451580a05.tar.gz
fsl-u-boot-localversion.bbclass: import from meta-fsl-arm
Prepare for fsl-arm/ppc merge. Signed-off-by: Ting Liu <ting.liu@freescale.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/fsl-u-boot-localversion.bbclass27
1 files changed, 27 insertions, 0 deletions
diff --git a/classes/fsl-u-boot-localversion.bbclass b/classes/fsl-u-boot-localversion.bbclass
new file mode 100644
index 0000000..f7e0971
--- /dev/null
+++ b/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}