From: Mathis Ahrens <Mathis.Ahrens@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH] Makefile: localversion fix (was: [2.6.16-rc6] CONFIG_LOCALVERSION_AUTO)
Date: Thu, 16 Mar 2006 21:20:26 +0100 [thread overview]
Message-ID: <4419C88A.1060000@gmx.de> (raw)
In-Reply-To: <44179C77.1010902@gmx.de>
Mathis Ahrens wrote:
> 1.
> Semantics of LOCALVERSION are confusing and probably buggy.
> The Makefile states:
>
> # Take the contents of any files called localversion* and the config
> # variable CONFIG_LOCALVERSION and append them to KERNELRELEASE.
> # LOCALVERSION from the command line override all of this
>
> whereas my simplified view of current code is:
>
> version = major + minor + patch + extra
> release = version + localver-full
> localver-full = localver + localver-auto
> localver = <concat all localversions*> + $CONFIG_LOCALVERSION
> localver-auto = $LOCALVERSION + <some -gxxxxxx>
>
> LOCALVERSION does not seem to /override/ anything if specified on the
> command line, but rather (with CONFIG_LOCALVERSION_AUTO=y) gets
> /inserted/.
>
> Also, with CONFIG_LOCALVERSION_AUTO=n, specifying LOCALVERSION
> on the command line currently does nothing at all. This is a regression
> from 2.6.15, I suppose.
>
Hmm, no comments on this?
I am not sure if different behaviour is desired, but here goes my proposal:
From: Mathis Ahrens <Mathis.Ahrens@gmx.de>
Fix Makefile to honor LOCALVERSION if specified on the command line.
Make it then replace any other localversions from files, CONFIG_LOCALVERSION
or CONFIG_LOCALVERSION_AUTO.
Signed-off-by: Mathis Ahrens <Mathis.Ahrens@gmx.de>
--- linux/Makefile.orig 2006-03-15 01:49:26.000000000 +0100
+++ linux/Makefile 2006-03-16 18:10:38.000000000 +0100
@@ -760,22 +760,27 @@ $(vmlinux-dirs): prepare scripts
# The KERNELRELEASE is stored in a file named .kernelrelease
# to be used when executing for example make install or make
modules_install
#
-# Take the contents of any files called localversion* and the config
-# variable CONFIG_LOCALVERSION and append them to KERNELRELEASE.
-# LOCALVERSION from the command line override all of this
+# If LOCALVERSION from the command line is not empty, that is
+# appended to the KERNELRELEASE.
+#
+# Else we append in that order
+# - the contents of any files called localversion*
+# - the config variable CONFIG_LOCALVERSION
+# - if CONFIG_LOCALVERSION_AUTO is set, another scm-specific string
nullstring :=
space := $(nullstring) # end of line
-___localver = $(objtree)/localversion* $(srctree)/localversion*
-__localver = $(sort $(wildcard $(___localver)))
+__localver-filelist = $(objtree)/localversion* $(srctree)/localversion*
+_localver-filelist = $(sort $(wildcard $(__localver-filelist)))
# skip backup files (containing '~')
-_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
+localver-filelist = $(foreach f, $(_localver-filelist), \
+ $(if $(findstring ~, $(f)),,$(f)))
+
+localver-files = $(subst $(space),, $(shell cat /dev/null
$(localver-filelist)))
+localver-conf = $(subst $(space),, $(patsubst
"%",%,$(CONFIG_LOCALVERSION)))
+
-localver = $(subst $(space),, \
- $(shell cat /dev/null $(_localver)) \
- $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
-
# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
# and if the SCM is know a tag from the SCM is appended.
# The appended tag is determinded by the SCM used.
@@ -784,12 +789,15 @@ localver = $(subst $(space),, \
# Other SCMs can edit scripts/setlocalversion and add the appropriate
# checks as needed.
ifdef CONFIG_LOCALVERSION_AUTO
- _localver-auto = $(shell $(CONFIG_SHELL) \
+ localver-auto = $(shell $(CONFIG_SHELL) \
$(srctree)/scripts/setlocalversion $(srctree))
- localver-auto = $(LOCALVERSION)$(_localver-auto)
endif
-localver-full = $(localver)$(localver-auto)
+ifeq ($(LOCALVERSION),)
+ localver-full = $(localver-files)$(localver-conf)$(localver-auto)
+else
+ localver-full = $(subst $(space),, $(LOCALVERSION))
+endif
# Store (new) KERNELRELASE string in .kernelrelease
kernelrelease = $(KERNELVERSION)$(localver-full)
next prev parent reply other threads:[~2006-03-16 20:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-15 4:47 [2.6.16-rc6] CONFIG_LOCALVERSION_AUTO Mathis Ahrens
2006-03-16 20:20 ` Mathis Ahrens [this message]
2006-03-16 20:34 ` Sam Ravnborg
2006-03-16 23:49 ` Mathis Ahrens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4419C88A.1060000@gmx.de \
--to=mathis.ahrens@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.