[meta-freescale] [meta-fsl-arm][PATCH v3 3/5] fsl-u-boot-localversion: Easy LOCALVERSION handling

zhenhua.luo at freescale.com zhenhua.luo at freescale.com
Tue Sep 2 03:18:45 PDT 2014


+1 

> -----Original Message-----
> From: meta-freescale-bounces at yoctoproject.org [mailto:meta-freescale-
> bounces at yoctoproject.org] On Behalf Of Otavio Salvador
> Sent: Monday, September 01, 2014 10:21 PM
> To: meta-freescale Mailing List
> Cc: Otavio Salvador
> Subject: [meta-freescale] [meta-fsl-arm][PATCH v3 3/5] 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 at ossystems.com.br>
> ---
>  classes/fsl-u-boot-localversion.bbclass |   27
> +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>  create mode 100644 classes/fsl-u-boot-localversion.bbclass
> 
> 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 @@
> +# Freescale 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')
> +#
> +# Copyright 2014 (C) O.S. Systems Software LTDA.
> +
> +SCMVERSION ??= "y"
> +LOCALVERSION ??= "+fslc"
> +
> +UBOOT_LOCALVERSION = "${LOCALVERSION}"
> +
> +do_compile_prepend() {
> +	if [ "${SCMVERSION}" = "y" ]; then
> +		# Add GIT revision to the local version
> +		head=`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
> +}
> --
> 1.7.10.4
> 
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale


More information about the meta-freescale mailing list