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 version.date 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 > version.date

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

https://github.com/openwrt/openwrt/blob/34e22653ac18b6ac7fd368ca47625f665808067f/scripts/get_source_date_epoch.sh

Search results show it gets used also for kernel

https://github.com/openwrt/openwrt/search?p=2&q=SOURCE_DATE_EPOCH&unscoped_q=SOURCE_DATE_EPOCH

https://github.com/openwrt/openwrt/blob/36fa1bbf6f510e57098edab3932015dc747bbd49/include/kernel-build.mk#L72

https://github.com/openwrt/openwrt/blob/eda3094eb974cc0540562ae710ea543e037632ba/include/kernel.mk#L13

1 Like