[Wylug-help] Re: Reproduceable kernel build
Tom Ward
jesus at warwickcompsoc.co.uk
Mon, 2 Jun 2003 13:45:08 +0100
> However, the linux kernel uses __DATE__ and __TIME__ macros in various
> source files. And also it uses `date` in the top level Makefile and puts
> this into the compile.h file. This means that some files get different
> checksum values on subsequent builds because the date/time doesn't match
> exactly.
Well, what I'd try, if I were on your payroll ;), would be first adding
#undef __DATE__
#define __DATE__ Eldon1
#undef __TIME__
#define __TIME__ Eldon1
to linux-2.4.x/include/linux/config.h
I don't have time to try it out right now - not sure if they're built in
macros you can't do anything about, but it's worth a try.
Also, you'd just have to patch the Makefile to sort out compile.h. Probably
your best bet is to create an appropriate compile.h file, and remove
the sections in the Makefile that refer to it. You'd probably have to
worry about hostnames and other system differences otherwise.
Specifically - remove the whole paragraph from the line beginning
include/linux/compile.h, but also remove it from the lines following
CLEAN_FILES and Version.
> The files which are different are:
> bsetup.s, bsetup.o, bsetup, bzImage, bvmlinux.out compile.h, version.o and
> vmlinux and piggy.o.
Remember bZimage is simply a bzip'd copy of vmlinux, version.o is built on
compile.h, and bsetup / bsetup.o will be compiled up from the assembler
source in bsetup.s (I'm on linux-ppc right now, and I don't have a bsetup...
:/ ) - so go for the probable roots of the problem first. Not sure about
bvmlinux.out and piggy.o.
> Also there is a lib.a in the kernel which appears to be different after each
> build (not sure what is causing this to be different).
>
:/ Also not sure about this.
Tom