put UTS_RELEASE in separate utsversion.h file
Subsystems (4)
RFC PATCH 1/1 put UTS_RELEASE in separate utsversion.h file
During the last few days I have been toying with a allmodconfig tree and got irritated by all the extra modules being build over and over again.
The root cause was the definition of UTS_RELEASE in version.h. I had enabled automatic appending of git version and it changed each time I committed something resulting in a lot of recompiling. With the following patch the recompile is kept minimal, the most annoying part being all the .mod.c files - but they actually use UTS_RELEASE so this is avoidable.
I have not updated checkversion.pl - Randy can you do that?
I have not applied the patch yet - wanted some feedback from lkml first. Only functional changes is in top-level makefile.
For all users of UTS_RELEASE I simple included utsversion.h.
Note: I do not know if any external stuff(*) uses UTS_RELEASE and expect it to be in version.h!
(*) I here think of glibc, gcc, udev etc. External modules will have to cope with this change like any in-kernel module
Sam
Makefile +15 -9
@@ -842,20 +842,26 @@ include/config/MARKER: scripts/basic/spl uts_len := 64 -define filechk_version.h +define filechk_utsversion.h if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \ - echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ - exit 1; \ - fi; \ - (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \ - echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \ - echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \ - ) + echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \ + exit 1; \ + fi; \ + (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";) endef -include/linux/version.h: $(srctree)/Makefile .config FORCE +define filechk_version.h + (echo \#define LINUX_VERSION_CODE $(shell \ + expr $(VERSION) \* 65536 + $(PATCHLEVEL) \* 256 + $(SUBLEVEL)); \ + echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) +endef + +include/linux/version.h: .config include/linux/utsversion.h FORCE $(call filechk,version.h) +include/linux/utsversion.h: .config FORCE + $(call filechk,utsversion.h) + # --------------------------------------------------------------------------- .PHONY: depend dep
arch/alpha/boot/bootp.c +1 -0
@@ -10,6 +10,7 @@#include <linux/kernel.h> #include <linux/string.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/mm.h> #include <asm/system.h>
arch/alpha/boot/bootpz.c +1 -0
@@ -12,6 +12,7 @@#include <linux/kernel.h> #include <linux/string.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/mm.h> #include <asm/system.h>
arch/alpha/boot/main.c +1 -0
@@ -8,6 +8,7 @@#include <linux/kernel.h> #include <linux/string.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/mm.h> #include <asm/system.h>
arch/frv/kernel/setup.c +1 -0
@@ -12,6 +12,7 @@#include <linux/config.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/delay.h>
arch/i386/boot/setup.S +1 -0
@@ -49,6 +49,7 @@ #include <linux/config.h> #include <asm/segment.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/compile.h> #include <asm/boot.h> #include <asm/e820.h>
arch/powerpc/platforms/chrp/setup.c +1 -0
@@ -28,6 +28,7 @@#include <linux/init.h> #include <linux/pci.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/adb.h> #include <linux/module.h> #include <linux/delay.h>
arch/powerpc/platforms/powermac/bootx_init.c +1 -0
@@ -14,6 +14,7 @@#include <linux/string.h> #include <linux/init.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <asm/sections.h> #include <asm/prom.h> #include <asm/page.h>
arch/ppc/platforms/chrp_setup.c +1 -0
@@ -28,6 +28,7 @@#include <linux/init.h> #include <linux/pci.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/adb.h> #include <linux/module.h> #include <linux/delay.h>
arch/ppc/syslib/btext.c +1 -0
@@ -8,6 +8,7 @@#include <linux/string.h> #include <linux/init.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <asm/sections.h> #include <asm/bootx.h>
arch/x86_64/boot/setup.S +1 -0
@@ -48,6 +48,7 @@ #include <linux/config.h> #include <asm/segment.h> #include <linux/version.h> +#include <linux/utsversion.h> #include <linux/compile.h> #include <asm/boot.h> #include <asm/e820.h>
include/linux/vermagic.h +1 -0
@@ -1,4 +1,5 @@#include <linux/version.h> +#include <linux/utsversion.h> #include <linux/module.h> /* Simply sanity version stamp for modules. */
init/version.c +1 -0
@@ -10,6 +10,7 @@#include <linux/module.h> #include <linux/uts.h> #include <linux/utsname.h> +#include <linux/utsversion.h> #include <linux/version.h> #define version (a) Version_ ## a
Quoted 12 lines · Sam Ravnborg
During the last few days I have been toying with a allmodconfig tree and got irritated by all the extra modules being build over and over again.
The root cause was the definition ofUTS_RELEASEinversion.h. I had enabled automatic appending of git version and it changed each time I committed something resulting in a lot of recompiling. With the following patch the recompile is kept minimal, the most annoying part being all the.mod.cfiles - but they actually useUTS_RELEASEso this is avoidable.I have not updated checkversion.pl - Randy can you do that?
Quoted 8 lines
I have not applied the patch yet - wanted some feedback from lkml first. Only functional changes is in top-level makefile.
For all users ofUTS_RELEASEI simple includedutsversion.h.Note: I do not know if any external
stuff(*)usesUTS_RELEASEand expect it to be inversion.h!(*) I here think of glibc, gcc, udev etc.
udev does not build against any kernel file, nor care about what kernel is installed when built. It also really doesn't check kernel info when it is running either...
I like this patch, as someone who builds with a lot of modules enabled :)
thanks,
greg k-h
Quoted 4 lines
During the last few days I have been toying with a allmodconfig tree and got irritated by all the extra modules being build over and over again.
Yes I have noticed that too. It was fine with 2.6.15 - I could compile a kernel, move the binary result and the source tree a little around, wrap it up in an rpm package, install it elsewhere, and upon changing options in .config, it only recompiled the important bits. With 2.6.16-rc1 it seems to always rebuild everything. (I doubt CONFIG_NETFILTER_XT_TARGET_CONNMARK influences kernel/exit.o!)
Jan Engelhardt