Patchwork [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control version string

login
register
mail settings
Submitter chase maupin
Date April 11, 2013, 1:03 p.m.
Message ID <1365685393-611-2-git-send-email-Chase.Maupin@ti.com>
Download mbox | patch
Permalink /patch/47929/
State Accepted
Commit 566298409408c6103f7a9871bb13ae5449c4fd64
Headers show

Comments

chase maupin - April 11, 2013, 1:03 p.m.
* Add a variable called UBOOT_LOCALVERSION which when set will
  place a version string in the .scmversion file of the u-boot
  sources.  This string will be picked up by the u-boot Makefile
  and will be appended to the u-boot version.  This is done to
  make it easier to identify what revision of the u-boot sources
  are being run.  For example you can use a setting like the
  following to add the short commit id to the u-boot version
  string:

UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV', True).partition('+')[2][0:7]}"

Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
---
* Updated in version 2
    * Check if the .scmversion file already exists and don't
      overwrite it if it does.
    * Based on feedback from
      Bruce Ashfield <bruce.ashfield@gmail.com]
---
 meta/recipes-bsp/u-boot/u-boot.inc |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
chase maupin - April 16, 2013, 11:59 a.m.
> -----Original Message-----
> From: Maupin, Chase
> Sent: Thursday, April 11, 2013 8:03 AM
> To: openembedded-core@lists.openembedded.org
> Cc: Maupin, Chase
> Subject: [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control
> version string
> 
> * Add a variable called UBOOT_LOCALVERSION which when set will
>   place a version string in the .scmversion file of the u-boot
>   sources.  This string will be picked up by the u-boot Makefile
>   and will be appended to the u-boot version.  This is done to
>   make it easier to identify what revision of the u-boot sources
>   are being run.  For example you can use a setting like the
>   following to add the short commit id to the u-boot version
>   string:
> 
> UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV',
> True).partition('+')[2][0:7]}"
> 

Ping on this patch

> Signed-off-by: Chase Maupin <Chase.Maupin@ti.com>
> ---
> * Updated in version 2
>     * Check if the .scmversion file already exists and don't
>       overwrite it if it does.
>     * Based on feedback from
>       Bruce Ashfield <bruce.ashfield@gmail.com]
> ---
>  meta/recipes-bsp/u-boot/u-boot.inc |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-
> bsp/u-boot/u-boot.inc
> index ae53b90..6bbe457 100644
> --- a/meta/recipes-bsp/u-boot/u-boot.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot.inc
> @@ -16,6 +16,11 @@ python () {
>  		raise bb.parse.SkipPackage("because UBOOT_MACHINE is
> not set")
>  }
> 
> +# Allow setting an additional version string that will be picked
> up by the
> +# u-boot build system and appended to the u-boot version.  If
> the .scmversion
> +# file already exists it will not be overwritten.
> +UBOOT_LOCALVERSION ?= ""
> +
>  # Some versions of u-boot use .bin and others use .img.  By
> default use .bin
>  # but enable individual recipes to change this value.
>  UBOOT_SUFFIX ?= "bin"
> @@ -40,6 +45,13 @@ do_compile () {
>  	unset LDFLAGS
>  	unset CFLAGS
>  	unset CPPFLAGS
> +
> +	if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
> +	then
> +		echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
> +		echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
> +	fi
> +
>  	oe_runmake ${UBOOT_MACHINE}
>  	oe_runmake ${UBOOT_MAKE_TARGET}
>  }
> --
> 1.7.0.4
Richard Purdie - April 16, 2013, 10:21 p.m.
On Tue, 2013-04-16 at 11:59 +0000, Maupin, Chase wrote:
> > -----Original Message-----
> > From: Maupin, Chase
> > Sent: Thursday, April 11, 2013 8:03 AM
> > To: openembedded-core@lists.openembedded.org
> > Cc: Maupin, Chase
> > Subject: [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control
> > version string
> > 
> > * Add a variable called UBOOT_LOCALVERSION which when set will
> >   place a version string in the .scmversion file of the u-boot
> >   sources.  This string will be picked up by the u-boot Makefile
> >   and will be appended to the u-boot version.  This is done to
> >   make it easier to identify what revision of the u-boot sources
> >   are being run.  For example you can use a setting like the
> >   following to add the short commit id to the u-boot version
> >   string:
> > 
> > UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV',
> > True).partition('+')[2][0:7]}"
> > 
> 
> Ping on this patch

These are really enhancements, not bug fixes and are too late for 1.4
since they came in after the feature freeze.

I'm nervous of them as there have been several iterations and I can't
easily tell what impact these will have on the different package
backends, or linux-yocto verses non linux-yocto for example.

Its simply too late and there are other bigger issues I'm worried about.
I therefore don't want to take this additional risk, sorry.

Cheers,

Richard
Denys Dmytriyenko - April 17, 2013, 4:41 a.m.
On Tue, Apr 16, 2013 at 11:21:35PM +0100, Richard Purdie wrote:
> On Tue, 2013-04-16 at 11:59 +0000, Maupin, Chase wrote:
> > > -----Original Message-----
> > > From: Maupin, Chase
> > > Sent: Thursday, April 11, 2013 8:03 AM
> > > To: openembedded-core@lists.openembedded.org
> > > Cc: Maupin, Chase
> > > Subject: [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control
> > > version string
> > > 
> > > * Add a variable called UBOOT_LOCALVERSION which when set will
> > >   place a version string in the .scmversion file of the u-boot
> > >   sources.  This string will be picked up by the u-boot Makefile
> > >   and will be appended to the u-boot version.  This is done to
> > >   make it easier to identify what revision of the u-boot sources
> > >   are being run.  For example you can use a setting like the
> > >   following to add the short commit id to the u-boot version
> > >   string:
> > > 
> > > UBOOT_LOCALVERSION = "-g${@d.getVar('SRCPV',
> > > True).partition('+')[2][0:7]}"
> > > 
> > 
> > Ping on this patch
> 
> These are really enhancements, not bug fixes and are too late for 1.4
> since they came in after the feature freeze.
> 
> I'm nervous of them as there have been several iterations and I can't
> easily tell what impact these will have on the different package
> backends, or linux-yocto verses non linux-yocto for example.
> 
> Its simply too late and there are other bigger issues I'm worried about.
> I therefore don't want to take this additional risk, sorry.

Richard,

Thanks for the explanation, it's understood.
Do you want to take it after the release? Would you prefer a ping or a new 
submission of this patch?

Patch

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index ae53b90..6bbe457 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -16,6 +16,11 @@  python () {
 		raise bb.parse.SkipPackage("because UBOOT_MACHINE is not set")
 }
 
+# Allow setting an additional version string that will be picked up by the
+# u-boot build system and appended to the u-boot version.  If the .scmversion
+# file already exists it will not be overwritten.
+UBOOT_LOCALVERSION ?= ""
+
 # Some versions of u-boot use .bin and others use .img.  By default use .bin
 # but enable individual recipes to change this value.
 UBOOT_SUFFIX ?= "bin"
@@ -40,6 +45,13 @@  do_compile () {
 	unset LDFLAGS
 	unset CFLAGS
 	unset CPPFLAGS
+
+	if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
+	then
+		echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
+		echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
+	fi
+
 	oe_runmake ${UBOOT_MACHINE}
 	oe_runmake ${UBOOT_MAKE_TARGET}
 }