Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCHv2] kernel: Add KERNEL_LOCALVERSION to control version string
@ 2013-04-11 13:03 Chase Maupin
  2013-04-11 13:03 ` [PATCHv2] u-boot: Add UBOOT_LOCALVERSION " Chase Maupin
  2013-04-16 11:58 ` [PATCHv2] kernel: Add KERNEL_LOCALVERSION " Maupin, Chase
  0 siblings, 2 replies; 6+ messages in thread
From: Chase Maupin @ 2013-04-11 13:03 UTC (permalink / raw)
  To: openembedded-core; +Cc: Chase Maupin

* Add a variable called KERNEL_LOCALVERSION which when set will
  place a version string in the .scmversion file of the kernel
  sources.  This string will be picked up by the kernel Makefile
  and will be appended to the kernel version.  This is done to
  make it easier to identify what revision of the kernel sources
  are being run.  For example you can use a setting like the
  following to add the short commit id to the kernel version
  string:

KERNEL_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/classes/kernel.bbclass |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index af58887..3d82641 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -48,6 +48,9 @@ export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}"
 
 KERNEL_VERSION = "${@get_kernelversion('${B}')}"
 
+# Setting KERNEL_LOCALVERSION will place a string in the .scmversion file
+# of the kernel tree.  This string will be picked up by the build system
+# of the kernel and appended to the kernel version.
 KERNEL_LOCALVERSION ?= ""
 
 # kernels are generally machine specific
@@ -210,7 +213,12 @@ kernel_do_configure() {
 	# $ scripts/setlocalversion . => +
 	# $ make kernelversion => 2.6.37
 	# $ make kernelrelease => 2.6.37+
-	touch ${B}/.scmversion ${S}/.scmversion
+
+	if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
+	then
+		echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
+		echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
+	fi
 
 	# Copy defconfig to .config if .config does not exist. This allows
 	# recipes to manage the .config themselves in do_configure_prepend().
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control version string
  2013-04-11 13:03 [PATCHv2] kernel: Add KERNEL_LOCALVERSION to control version string Chase Maupin
@ 2013-04-11 13:03 ` Chase Maupin
  2013-04-16 11:59   ` Maupin, Chase
  2013-04-16 11:58 ` [PATCHv2] kernel: Add KERNEL_LOCALVERSION " Maupin, Chase
  1 sibling, 1 reply; 6+ messages in thread
From: Chase Maupin @ 2013-04-11 13:03 UTC (permalink / raw)
  To: openembedded-core; +Cc: Chase Maupin

* 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(-)

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




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCHv2] kernel: Add KERNEL_LOCALVERSION to control version string
  2013-04-11 13:03 [PATCHv2] kernel: Add KERNEL_LOCALVERSION to control version string Chase Maupin
  2013-04-11 13:03 ` [PATCHv2] u-boot: Add UBOOT_LOCALVERSION " Chase Maupin
@ 2013-04-16 11:58 ` Maupin, Chase
  1 sibling, 0 replies; 6+ messages in thread
From: Maupin, Chase @ 2013-04-16 11:58 UTC (permalink / raw)
  To: Maupin, Chase, openembedded-core@lists.openembedded.org

> -----Original Message-----
> From: Maupin, Chase
> Sent: Thursday, April 11, 2013 8:03 AM
> To: openembedded-core@lists.openembedded.org
> Cc: Maupin, Chase
> Subject: [PATCHv2] kernel: Add KERNEL_LOCALVERSION to control
> version string
> 
> * Add a variable called KERNEL_LOCALVERSION which when set will
>   place a version string in the .scmversion file of the kernel
>   sources.  This string will be picked up by the kernel Makefile
>   and will be appended to the kernel version.  This is done to
>   make it easier to identify what revision of the kernel sources
>   are being run.  For example you can use a setting like the
>   following to add the short commit id to the kernel version
>   string:
> 
> KERNEL_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/classes/kernel.bbclass |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/kernel.bbclass
> b/meta/classes/kernel.bbclass
> index af58887..3d82641 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -48,6 +48,9 @@ export CMDLINE_CONSOLE =
> "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}"
> 
>  KERNEL_VERSION = "${@get_kernelversion('${B}')}"
> 
> +# Setting KERNEL_LOCALVERSION will place a string in the
> .scmversion file
> +# of the kernel tree.  This string will be picked up by the
> build system
> +# of the kernel and appended to the kernel version.
>  KERNEL_LOCALVERSION ?= ""
> 
>  # kernels are generally machine specific
> @@ -210,7 +213,12 @@ kernel_do_configure() {
>  	# $ scripts/setlocalversion . => +
>  	# $ make kernelversion => 2.6.37
>  	# $ make kernelrelease => 2.6.37+
> -	touch ${B}/.scmversion ${S}/.scmversion
> +
> +	if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
> +	then
> +		echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
> +		echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
> +	fi
> 
>  	# Copy defconfig to .config if .config does not exist. This
> allows
>  	# recipes to manage the .config themselves in
> do_configure_prepend().
> --
> 1.7.0.4




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control version string
  2013-04-11 13:03 ` [PATCHv2] u-boot: Add UBOOT_LOCALVERSION " Chase Maupin
@ 2013-04-16 11:59   ` Maupin, Chase
  2013-04-16 22:21     ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: Maupin, Chase @ 2013-04-16 11:59 UTC (permalink / raw)
  To: Maupin, Chase, openembedded-core@lists.openembedded.org

> -----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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control version string
  2013-04-16 11:59   ` Maupin, Chase
@ 2013-04-16 22:21     ` Richard Purdie
  2013-04-17  4:41       ` Denys Dmytriyenko
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2013-04-16 22:21 UTC (permalink / raw)
  To: Maupin, Chase; +Cc: openembedded-core@lists.openembedded.org

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




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv2] u-boot: Add UBOOT_LOCALVERSION to control version string
  2013-04-16 22:21     ` Richard Purdie
@ 2013-04-17  4:41       ` Denys Dmytriyenko
  0 siblings, 0 replies; 6+ messages in thread
From: Denys Dmytriyenko @ 2013-04-17  4:41 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-core@lists.openembedded.org

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?

-- 
Denys



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-17  4:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 13:03 [PATCHv2] kernel: Add KERNEL_LOCALVERSION to control version string Chase Maupin
2013-04-11 13:03 ` [PATCHv2] u-boot: Add UBOOT_LOCALVERSION " Chase Maupin
2013-04-16 11:59   ` Maupin, Chase
2013-04-16 22:21     ` Richard Purdie
2013-04-17  4:41       ` Denys Dmytriyenko
2013-04-16 11:58 ` [PATCHv2] kernel: Add KERNEL_LOCALVERSION " Maupin, Chase

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox