Re: [PATCH, v2] kbuild: Improve version string logic

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Frans Pop
Date: Wednesday, October 14, 2009 - 4:43 pm

On Wednesday 14 October 2009, David Rientjes wrote:

That is fine for custom kernels. I still maintain that it is hopelessly
wrong for distro kernels.

Distro kernels generally have their own naming schemes.
Debian uses: 2.6.30-2-amd64 (<version>-<ABI>-<flavor>)
Fedora uses: 2.6.30.5-43.fc11.i586

And those kernel versions implicitly already contain the information that
they are not vanilla kernels. So a "+" suffix is totally redundant.

My main argument is that if they build kernels from an SCM, which is quite
likely, they should not suddenly get a "+" appended to those versions.
And IMO they should also not have to patch the Makefile to avoid it.
If this change is made, it should be made in such a way that old version
naming schemes are still possible.


I'm personally not convinced that there are actual *technical* packaging
issues, at least not for Debian (see my posts elsewhere in the thread).

However, it is very much possible that the change will break random
scripts that are in use and that expect a certain naming scheme.
Having an out would help those cases as well.


Using LOCALVERSION= for that would be wrong as it is on a different level
from AUTOVERSION. They should be independent. However, that basic approach
of using an environment variable is certainly an option.

And, while I was working on the patch to implement a tristate AUTOVERSION,
I thought of a very common use case that IMO we do want to cover here.

Many users build custom kernels using a distro config as starting point.
The distro does not want the "+", but we very much _do_ want it in the
custom kernel built by the user.
So the conclusion is that suppressing the "+" is simply not something that
can be set in the config, and thus the tristate solution is wrong.
Only alternative I see is that it must be a build option.

So I propose the following patch on top of the patch proposed by David.
It offers a clean out for users who explicitly do not want *any* SCM-based
suffix added to their kernel version, and is IMO both 1) obvious enough
for expert users and 2) obscure enough that regular users are unlikely to
abuse it. Is that acceptable?

The patch also fixes up the comment I mentioned earlier. The old comment
was outdated anyway and partially made redundant by the change David
already made in the later comment. And it has a typo fix.

David: I think it would be best to just merge this into your patch.

diff --git a/Makefile b/Makefile
index 24e54fd..6fcaba7 100644
--- a/Makefile
+++ b/Makefile
@@ -906,10 +906,8 @@ $(vmlinux-dirs): prepare scripts
 #	    +				(only without CONFIG_LOCALVERSION_AUTO
 #					 and repository is at non-tagged commit)
 #
-#  Note how the final $(localver-auto) string is included *only* if the
-# kernel config option CONFIG_LOCALVERSION_AUTO is selected.  Also, at the
-# moment, only git is supported but other SCMs can edit the script
-# scripts/setlocalversion and add the appropriate checks as needed.
+# Note that the final $(localver-extra) string can be suppressed by setting
+# the environment variable KBUILD_NO_LOCALVERSION_EXTRA.
 
 pattern = ".*/localversion[^~]*"
 string  = $(shell cat /dev/null \
@@ -923,9 +921,11 @@ localver = $(subst $(space),, $(string) \
 # tagged (release) commit.  The format of the identifier is determined by the
 # SCM's implementation.
 #
-# .scmversion is used when generating rpm packages so we do not loose
+# .scmversion is used when generating rpm packages so we do not lose
 # the version information from the SCM when we do the build of the kernel
 # from the copied source
+ifndef KBUILD_NO_LOCALVERSION_EXTRA
+
 ifeq ($(wildcard .scmversion),)
         scm-identifier = $(shell $(CONFIG_SHELL) \
                          $(srctree)/scripts/setlocalversion $(srctree))
@@ -941,6 +941,8 @@ else
 	endif
 endif
 
+endif # ifndef KBUILD_NO_LOCALVERSION_EXTRA
+
 localver-full = $(localver)$(LOCALVERSION)$(localver-extra)
 
 # Store (new) KERNELRELASE string in include/config/kernel.release
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.32-rc3, Linus Torvalds, (Sun Oct 4, 5:44 pm)
Re: Linux 2.6.32-rc3, James Cloos, (Mon Oct 5, 11:55 am)
Re: Linux 2.6.32-rc3, Len Brown, (Mon Oct 5, 6:57 pm)
Re: Linux 2.6.32-rc3, Dirk Hohndel, (Mon Oct 5, 7:51 pm)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 7:18 am)
Re: Linux 2.6.32-rc3, Dirk Hohndel, (Tue Oct 6, 7:38 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 7:44 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 8:13 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 8:24 am)
Re: Linux 2.6.32-rc3, Stefan Richter, (Tue Oct 6, 8:29 am)
Re: Linux 2.6.32-rc3, Dirk Hohndel, (Tue Oct 6, 8:34 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 8:36 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 8:42 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 8:43 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 8:51 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 9:29 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 9:31 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 9:35 am)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 9:36 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 9:40 am)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 9:40 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 10:08 am)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 10:09 am)
Re: Linux 2.6.32-rc3, Stefan Richter, (Tue Oct 6, 10:15 am)
Re: Linux 2.6.32-rc3, Stefan Richter, (Tue Oct 6, 10:20 am)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 10:22 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 10:32 am)
Re: Linux 2.6.32-rc3, Stefan Richter, (Tue Oct 6, 10:34 am)
[patch] kbuild: Improve version string logic, Ingo Molnar, (Tue Oct 6, 10:35 am)
Re: Linux 2.6.32-rc3, Len Brown, (Tue Oct 6, 10:40 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 10:41 am)
Re: Linux 2.6.32-rc3, Theodore Tso, (Tue Oct 6, 10:44 am)
Re: Linux 2.6.32-rc3, Dirk Hohndel, (Tue Oct 6, 10:45 am)
Re: Linux 2.6.32-rc3, Herlin R. Matos Lastres, (Tue Oct 6, 11:00 am)
Re: Linux 2.6.32-rc3, Theodore Tso, (Tue Oct 6, 11:12 am)
Re: Linux 2.6.32-rc3, Theodore Tso, (Tue Oct 6, 11:14 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 11:16 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 11:16 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 11:20 am)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 11:23 am)
Re: Linux 2.6.32-rc3, Ingo Molnar, (Tue Oct 6, 11:24 am)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 11:29 am)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 11:35 am)
Re: [patch] kbuild: Improve version string logic, Johannes Berg, (Tue Oct 6, 11:37 am)
Re: [patch] kbuild: Improve version string logic, Ingo Molnar, (Tue Oct 6, 11:49 am)
Re: [patch] kbuild: Improve version string logic, Johannes Berg, (Tue Oct 6, 11:55 am)
Re: Linux 2.6.32-rc3, david, (Tue Oct 6, 11:56 am)
Re: [patch] kbuild: Improve version string logic, Theodore Tso, (Tue Oct 6, 12:03 pm)
Re: Linux 2.6.32-rc3, Joel Becker, (Tue Oct 6, 12:22 pm)
Re: Linux 2.6.32-rc3, Stefan Richter, (Tue Oct 6, 12:23 pm)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 12:37 pm)
Re: [patch] kbuild: Improve version string logic, Frans Pop, (Tue Oct 6, 12:45 pm)
Re: [patch] kbuild: Improve version string logic, Johannes Berg, (Tue Oct 6, 12:48 pm)
Re: [patch] kbuild: Improve version string logic, Frans Pop, (Tue Oct 6, 1:25 pm)
Re: Linux 2.6.32-rc3, Stefan Richter, (Tue Oct 6, 2:19 pm)
Re: Linux 2.6.32-rc3, Benjamin Herrenschmidt, (Tue Oct 6, 2:33 pm)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 3:13 pm)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 3:19 pm)
Re: Linux 2.6.32-rc3, Florian Mickler, (Tue Oct 6, 5:51 pm)
Re: Linux 2.6.32-rc3, Bryan Donlan, (Tue Oct 6, 6:09 pm)
Re: Linux 2.6.32-rc3, Dave Airlie, (Tue Oct 6, 6:22 pm)
Re: Linux 2.6.32-rc3, Theodore Tso, (Tue Oct 6, 7:31 pm)
Re: [patch] kbuild: Improve version string logic, David Rientjes, (Tue Oct 6, 7:43 pm)
Re: Linux 2.6.32-rc3, Benjamin Herrenschmidt, (Tue Oct 6, 7:45 pm)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 8:23 pm)
Re: Linux 2.6.32-rc3, Linus Torvalds, (Tue Oct 6, 8:31 pm)
Re: Linux 2.6.32-rc3, Justin P. Mattock, (Tue Oct 6, 9:02 pm)
Re: Linux 2.6.32-rc3, Frans Pop, (Tue Oct 6, 10:56 pm)
Re: Linux 2.6.32-rc3, Theodore Tso, (Wed Oct 7, 6:52 am)
Re: Linux 2.6.32-rc3, Mike Galbraith, (Wed Oct 7, 7:52 am)
Re: Linux 2.6.32-rc3, david, (Wed Oct 7, 10:44 am)
Re: Linux 2.6.32-rc3, Mike Galbraith, (Wed Oct 7, 11:13 am)
Re: Linux 2.6.32-rc3, Steven Rostedt, (Wed Oct 7, 2:39 pm)
Re: Linux 2.6.32-rc3, Len Brown, (Wed Oct 7, 3:33 pm)
Re: Linux 2.6.32-rc3, Frans Pop, (Thu Oct 8, 8:20 am)
Re: Linux 2.6.32-rc3, Pavel Machek, (Sat Oct 10, 5:09 am)
Re: Linux 2.6.32-rc3, Felipe Contreras, (Sat Oct 10, 5:18 am)
[PATCH, v2] kbuild: Improve version string logic, Ingo Molnar, (Mon Oct 12, 12:57 pm)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Mon Oct 12, 7:00 pm)
Re: [PATCH, v2] kbuild: Improve version string logic, Ingo Molnar, (Tue Oct 13, 12:05 am)
Re: [PATCH, v2] kbuild: Improve version string logic, Ingo Molnar, (Tue Oct 13, 12:07 am)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Tue Oct 13, 12:59 am)
Re: [PATCH, v2] kbuild: Improve version string logic, Frans Pop, (Tue Oct 13, 10:51 am)
Re: [PATCH, v2] kbuild: Improve version string logic, Linus Torvalds, (Tue Oct 13, 11:01 am)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Tue Oct 13, 4:59 pm)
Re: [PATCH, v2] kbuild: Improve version string logic, Ingo Molnar, (Tue Oct 13, 11:59 pm)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Wed Oct 14, 12:24 am)
Re: [PATCH, v2] kbuild: Improve version string logic, Ingo Molnar, (Wed Oct 14, 12:33 am)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Wed Oct 14, 12:42 am)
Re: [PATCH, v2] kbuild: Improve version string logic, Frans Pop, (Wed Oct 14, 4:43 pm)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Thu Oct 15, 12:37 am)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Thu Oct 15, 1:01 am)
Re: [PATCH, v2] kbuild: Improve version string logic, Ingo Molnar, (Thu Oct 15, 1:59 am)
Re: [PATCH, v2] kbuild: Improve version string logic, Ingo Molnar, (Thu Oct 15, 2:03 am)
Re: Linux 2.6.32-rc3, Frans Pop, (Thu Oct 15, 8:51 am)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Thu Oct 15, 1:38 pm)
Re: [PATCH, v2] kbuild: Improve version string logic, David Rientjes, (Thu Oct 15, 1:45 pm)