mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kbuild: Support LOCALVERSION
@ 2004-08-31 19:26 Sam Ravnborg
  2004-09-01  1:08 ` Ian Wienand
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sam Ravnborg @ 2004-08-31 19:26 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton; +Cc: Ian Wienand, Christoph Hellwig

The following patch combines the request from several people.
If you place a file named localversion* in the root of your
soruce tree or the root of your output tree the text included in this
file will be appended to KERNELRELEASE.

LOCALVERSION was originally introduced by Ian Wienand <ianw@gelato.unsw.edu.au>

This allows one to put a short string in localversion identifying this
particular configuration "-smpacpi", or to identify applied patches
to the source "-llat-np".

More specifically:
$(srctree)/localversion-lowlatency contains "-llat"
$(srctree)/localversion-scheduler-nick constins "-np"

$(objtree)/localversion contains "-smpacpi"

Resulting KERNELRELEASE would be:
2.6.8.rc1-smpacpi-llat-np


Note that you no longer need to modify your Makefile to identify
your kernel so no rejects when applying new patches.
If you add a new localversion* file, or change a existing one kbuild
will pick up this and do the proper rebuild next time you run make.

Only issue is that KERNELRELEASE needs to be <= 64 chars - so keep the names short.

kbuild errors out if you are above limit.
$ cat localviersion-long
very-long-version-in-localversion-file-exceeding-64-chars-for-sure
Example:
  CHK     include/linux/version.h
"2.6.9-rc1-very-long-version-in-localversion-file-exceeding-64-chars-for-sure" exceeds 64 characters
make: *** [include/linux/version.h] Error 1
  

Where do we document this?

[This is deliberately not pushed to my bk tree - want some comments first].

	Sam

===== Makefile 1.526 vs edited =====
--- 1.526/Makefile	2004-08-30 21:23:05 +02:00
+++ edited/Makefile	2004-08-31 21:05:38 +02:00
@@ -141,7 +141,14 @@ VPATH		:= $(srctree)
 
 export srctree objtree VPATH TOPDIR
 
-KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+nullstring := 
+space      := $(nullstring) # end of line
+
+LOCALVERSION := $(subst $(space),, \
+                $(shell cat /dev/null $(objtree)/localversion* \
+                $(if $(KBUILD_SRC),$(srctree)/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 +336,8 @@ CFLAGS 		:= -Wall -Wstrict-prototypes -W
 	  	   -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
 
@@ -763,7 +770,8 @@ define filechk_version.h
 	)
 endef
 
-include/linux/version.h: Makefile
+include/linux/version.h: $(srctree)/Makefile \
+                         $(objtree)/localversion* $(srctree)/localversion*
 	$(call filechk,version.h)
 
 # ---------------------------------------------------------------------------

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

end of thread, other threads:[~2004-09-05 19:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-31 19:26 kbuild: Support LOCALVERSION Sam Ravnborg
2004-09-01  1:08 ` Ian Wienand
2004-09-01  1:24   ` Ian Wienand
2004-09-01  5:11     ` Sam Ravnborg
2004-09-01 11:44 ` Geert Uytterhoeven
2004-09-01 13:14   ` Sam Ravnborg
2004-09-01 13:43 ` Jan-Benedict Glaw
2004-09-01 14:56   ` Sam Ravnborg
2004-09-02 10:42     ` [PATCH] " Ian Wienand
2004-09-05 19:43       ` Sam Ravnborg

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

all inboxes | Powered by JetHome®