From: Nuno L. <nt...@nl...> - 2004-09-03 17:45:56
|
They have improved it, in the meantime. I think this could be one of the last versions. Regards, ~Nuno Lucas -------- Original Message -------- Path: main.gmane.org!not-for-mail From: Ian Wienand <ia...@ge...> Newsgroups: gmane.linux.kernel Subject: [PATCH] kbuild: Support LOCALVERSION Date: Thu, 2 Sep 2004 20:42:09 +1000 Lines: 132 Sender: lin...@vg... Approved: ne...@gm... Message-ID: <200...@cs...> References: <200...@ma...> <200...@lu...> <200...@ma...> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" X-Trace: sea.gmane.org 1094122044 11593 80.91.224.253 (2 Sep 2004 10:47:24 GMT) X-Complaints-To: us...@se... NNTP-Posting-Date: Thu, 2 Sep 2004 10:47:24 +0000 (UTC) Original-X-From: linux-kernel-owner+glk-linux-kernel=40m...@vg... Thu Sep 02 12:47:15 2004 Return-path: <linux-kernel-owner+glk-linux-kernel=40m...@vg...> Original-Received: from vger.kernel.org ([12.107.209.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C2p7b-00058U-00 for <glk...@gm...>; Thu, 02 Sep 2004 12:47:15 +0200 Original-Received: (maj...@vg...) by vger.kernel.org via listexpand id S268182AbUIBKnk (ORCPT <rfc822;glk-linux-kernel@m.gmane.org>); Thu, 2 Sep 2004 06:43:40 -0400 Original-Received: (maj...@vg...) by vger.kernel.org id S268128AbUIBKnk (ORCPT <rfc822;linux-kernel-outgoing>); Thu, 2 Sep 2004 06:43:40 -0400 Original-Received: from note.orchestra.cse.unsw.EDU.AU ([129.94.242.24]:48831 "EHLO note.orchestra.cse.unsw.EDU.AU") by vger.kernel.org with ESMTP id S268190AbUIBKmR (ORCPT <rfc822;lin...@vg...>); Thu, 2 Sep 2004 06:42:17 -0400 Original-Received: From wagner With LocalMail ; Thu, 2 Sep 2004 20:42:09 +1000 Original-To: lin...@vg..., Andrew Morton <ak...@os...>, Christoph Hellwig <hc...@ls...> Content-Disposition: inline In-Reply-To: <200...@ma...> User-Agent: Mutt/1.5.6+20040523i Precedence: bulk X-Mailing-List: lin...@vg... Xref: main.gmane.org gmane.linux.kernel:232175 X-Report-Spam: http://spam.gmane.org/gmane.linux.kernel:232175 On Wed, Sep 01, 2004 at 04:56:47PM +0200, Sam Ravnborg wrote: > Ian addedconfig CONFIG_LOCALVERSION to a Kconfig file. I will > try to add it and see how it turns out. If Ian does not beat me.. Ok, here is my attempt. I think it does everything everyone wants * localversion* files are read first * config variable is appended last * LOCALVERSION from the command line overrides all of this * check is forced on build, since we can't really know when the config or environment options change. Thanks, -i Add LOCALVERSION so we can append strings that show up in uname without having to fiddle with the Makefile and EXTRAVERSION, etc. Signed-off-by: Ian Wienand <ia...@ge...> ===== Makefile 1.523 vs edited ===== --- 1.523/Makefile 2004-08-25 06:34:30 +10:00 +++ edited/Makefile 2004-09-02 20:32:57 +10:00 @@ -141,7 +141,26 @@ export srctree objtree VPATH TOPDIR -KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) +nullstring := +space := $(nullstring) # end of line + +# Take the contents of any files called localversion and the config +# variable CONFIG_LOCALVERSION and append them to KERNELRELEASE. Be +# careful not to include files twice if building in the source +# directory. LOCALVERSION from the command line should override all +# of this + +ifeq ($(objtree),$(srctree)) +localversion-files := $(wildcard $(srctree)/localversion*) +else +localversion-files := $(wildcard $(objtree)/localversion* $(srctree)/localversion*) +endif + +LOCALVERSION = $(subst $(space),, \ + $(shell cat /dev/null $(localversion-files)) \ + $(subst ",,$(CONFIG_LOCALVERSION))) + +KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION) # SUBARCH tells the usermode build what the underlying arch is. That is set # first, and if a usermode build is happening, the "ARCH=um" on the command @@ -329,8 +348,8 @@ -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ -export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ - CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ +export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION LOCALVERSION KERNELRELEASE \ + ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK CHECKFLAGS @@ -747,8 +766,8 @@ # Generate some files # --------------------------------------------------------------------------- -# version.h changes when $(KERNELRELEASE) etc change, as defined in -# this Makefile +# KERNELRELEASE can change from a few different places, meaning version.h +# needs to be updated, so this check is forced on all builds uts_len := 64 @@ -763,7 +782,7 @@ ) endef -include/linux/version.h: Makefile +include/linux/version.h: $(srctree)/Makefile $(localversion-files) FORCE $(call filechk,version.h) # --------------------------------------------------------------------------- ===== init/Kconfig 1.48 vs edited ===== --- 1.48/init/Kconfig 2004-08-31 18:00:08 +10:00 +++ edited/init/Kconfig 2004-09-02 20:13:01 +10:00 @@ -293,6 +293,16 @@ option replaces shmem and tmpfs with the much simpler ramfs code, which may be appropriate on small systems without swap. +config LOCALVERSION + string "Local Version" + help + Append an extra string to the end of your kernel version. + This will show up when you type uname, for example. + The string you set here will be appended after the contents of + any files with a filename matching localversion* in your + object and source tree, in that order. Your total string can + be a maximum of 64 characters. + endmenu # General setup config TINY_SHMEM |