[meta-freescale] [meta-fsl-arm][PATCH v3 1/5] fsl-kernel-localversion: Easy LOCALVERSION handling
zhenhua.luo at freescale.com
zhenhua.luo at freescale.com
Tue Sep 2 03:14:49 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 1/5] fsl-kernel-
> localversion: Easy LOCALVERSION handling
>
> This class allow for easy extending of kernel recipes to easy the
> LOCALVERSION handling, allowing to reuse of code between different kernel
> recipes
>
> The following options are supported:
>
> SCMVERSION Puts the Git hash in kernel local version
> LOCALVERSION Value used in LOCALVERSION (default to '+fslc')
>
> This about avoid code duplication among Layerscape and i.MX.
>
> Change-Id: I3999dbdc2cb761063fe5f83dea65ddb14adec80c
> Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> ---
> classes/fsl-kernel-localversion.bbclass | 39
> +++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
> create mode 100644 classes/fsl-kernel-localversion.bbclass
>
> diff --git a/classes/fsl-kernel-localversion.bbclass b/classes/fsl-
> kernel-localversion.bbclass
> new file mode 100644
> index 0000000..bb4bdf5
> --- /dev/null
> +++ b/classes/fsl-kernel-localversion.bbclass
> @@ -0,0 +1,39 @@
> +# Freescale Kernel LOCALVERSION extension # # This allow to easy reuse
> +of code between different kernel recipes # # The following options are
> +supported:
> +#
> +# SCMVERSION Puts the Git hash in kernel local version
> +# LOCALVERSION Value used in LOCALVERSION (default to '+fslc')
> +#
> +# Copyright 2014 (C) O.S. Systems Software LTDA.
> +
> +SCMVERSION ??= "y"
> +LOCALVERSION ??= "+fslc"
> +
> +kernel_conf_variable() {
> + CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;"
> + if test "$2" = "n"
> + then
> + echo "# CONFIG_$1 is not set" >> ${S}/.config
> + else
> + echo "CONFIG_$1=$2" >> ${S}/.config
> + fi
> +}
> +
> +do_configure_prepend() {
> + echo "" > ${S}/.config
> + CONF_SED_SCRIPT=""
> +
> + kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\""
> + kernel_conf_variable LOCALVERSION_AUTO y
> +
> + sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >>
> '${S}/.config'
> +
> + if [ "${SCMVERSION}" = "y" ]; then
> + # Add GIT revision to the local version
> + head=`git rev-parse --verify --short HEAD 2> /dev/null`
> + printf "%s%s" +g $head > ${S}/.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