lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 6 Oct 2009 19:35:08 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Dirk Hohndel <hohndel@...radead.org>, Len Brown <lenb@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [patch] kbuild: Improve version string logic


* Linus Torvalds <torvalds@...ux-foundation.org> wrote:

> On Tue, 6 Oct 2009, Linus Torvalds wrote:
> > 
> > Unless:
> > 
> > > _That_ i think is a lot harder to confuse with the real .31 than a 
> > > v2.6.31-1234-g16123c4 version string.
> > 
> > .. are you saying that it would be just some automatically generated 
> > thing, just a crippled form of CONFIG_LOCALVERSION_AUTO? Kind of a 
> > CONFIG_LOCALVERSION_AUTO_SHORTFORM?
> 
> So how about this?

this patch is great IMHO. I've modified it to propagate the '+' into the 
long version string as well. I've tested it with auto-version not set 
and it now gives:

 Linux europe 2.6.32-rc3+ #2 SMP Tue Oct 6 19:26:58 CEST 2009 i686 i686 i386 GNU/Linux

the -rc3+ is a clearly visible distinction. This will improve things 
when bugs are reported with LOCALVERSION_AUTO not set - we'll always 
know when a tree is not vanilla.

With autoversion set 'uname -a' gives:

 Linux europe 2.6.32-rc3+00052-g0eca52a-dirty #3 SMP Tue Oct 6 19:29:54 CEST 2009 i686 i686 i386 GNU/Linux

IMO that's intuitive too. We get whatever is described in the 
localversion in addition to the tag. The '+' clearly signals that 'set 
union' operation we've done.

So this patch solves all the problems i had with our versioning. I've 
attached it below with a changelog.

Thanks,

	Ingo

--------------->
Subject: kbuild: Improve version string logic
From: Linus Torvalds <torvalds@...ux-foundation.org>
Date: Tue, 6 Oct 2009 09:31:03 -0700 (PDT)

It changes how CONFIG_LOCALVERSION_AUTO works, in the following trivial
way:

 - if it is set, things work the way they always have, and you get a
   extended kernel release like:

	2.6.32-rc3+00052-g0eca52a-dirty

   ( with the difference that the extra version string is separated via
     '+' not via '-'. This improves visibility when we have additional
     changes over a vanilla tag. )

 - but if it is _not_ set, we'll still try to get a version from the
   underlying SCM (we actually support git, hg and SVN right now, even if
   some comments may say "git only"), and if the underlying SCM says it
   has a local version, we append just "+", so you get a version number
   like:

	2.6.32-rc3+

IOW, you'd never get 2.6.32-rc0, but you'd get either the complex git
version number (or SVN/hg/whatever), or at least "2.6.31+" with the "+"
showing that it is more than plain 2.6.31.

The "+" could be anything else, of course. The diff is pretty obvious, you
can argue about exactly _what_ you'd like to see as a suffix for "and then
some".

Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 Makefile |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: linux/Makefile
===================================================================
--- linux.orig/Makefile
+++ linux/Makefile
@@ -963,16 +963,21 @@ localver = $(subst $(space),, $(string) 
 # .scmversion is used when generating rpm packages so we do not loose
 # the version information from the SCM when we do the build of the kernel
 # from the copied source
-ifdef CONFIG_LOCALVERSION_AUTO
-
 ifeq ($(wildcard .scmversion),)
         _localver-auto = $(shell $(CONFIG_SHELL) \
-                         $(srctree)/scripts/setlocalversion $(srctree))
+                         $(srctree)/scripts/setlocalversion $(srctree) | sed 's/^-/+/')
 else
         _localver-auto = $(shell cat .scmversion 2> /dev/null)
 endif
 
+ifdef CONFIG_LOCALVERSION_AUTO
 	localver-auto  = $(LOCALVERSION)$(_localver-auto)
+else
+	ifeq ($_localver-auto,)
+		localver-auto = $(LOCALVERSION)
+	else
+		localver-auto = $(LOCALVERSION)+
+	endif
 endif
 
 localver-full = $(localver)$(localver-auto)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ