Kernel Build Times and Sequence Numbers

It seems as if it is a "feature" that both the build time of the kernel isn't really the build time (perhaps the last git commit time?) nor does the sequence number increase (always #0).

root@OpenWrt:/# uname -v
#0 SMP Sun Feb 24 05:08:24 2019

I know that build wasn't started until 05:28 and that it was the second build after making some changes.

Since I'd like to have the confidence that the kernel built isn't something stale, especially with all kinds of "dirt" hanging around in a devel environment, how can I get sane behavior back again?

(at least from an old-school perspective, since I'm guessing this is an unfortunate side effect of reproducibility testing)

You look up the commits for reproducibility and revert their effect...

Not quite sure about the kernel, but in general you can simply write the start time into file before make to give the buildi time stamp to get used.. I am doing that for my builds. From my build script.

# Override git/svn timestamp after r48583-48594, set initial clock to now

date +%s >

Can't remember right now if that gets used for kernel.

Looks like it is also used for kernel
SOURCE_DATE_EPOCH is the key shell variable

Search results show it gets used also for kernel

1 Like