[build] Do not use "git log" to construct build timestamp

Using "git log" to automatically construct the build timestamp is of
minimal value.  Reproducible builds should be using SOURCE_DATE_EPOCH
anyway, and for ad hoc builds it is arguable that the time at which
the build was performed is more relevant than the commit timestamp.
(For example, the user may be trying to deliberately use an older
version of iPXE in order to track down a regression via bisection.)

Remove the use of "git log", and thereby remove any requirement for
the git tools to be available at the point of building iPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-01-21 23:19:36 +00:00
parent faa42c8503
commit 0abef79a29

View File

@@ -1230,8 +1230,6 @@ BUILD_ID_CMD = cat $^ | cksum | awk '{print $$1}'
#
ifdef SOURCE_DATE_EPOCH
BUILD_TIMESTAMP := $(SOURCE_DATE_EPOCH)
else ifdef GITVERSION
BUILD_TIMESTAMP := $(shell git log -1 --pretty=%ct)
else
BUILD_TIMESTAMP := $(shell date +%s)
endif