]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Use SOURCE_DATE_EPOCH if it exists
authorManuel Mendez <mmendez534@gmail.com>
Sat, 16 Jan 2021 02:29:27 +0000 (21:29 -0500)
committerMichael Brown <mcb30@ipxe.org>
Sat, 30 Jan 2021 17:55:34 +0000 (17:55 +0000)
See https://reproducible-builds.org/docs/source-date-epoch/ for
rationale.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.housekeeping

index d760f5524ab7d5d315898e468e59d348596cfd5c..fc0850b1d467382ae386021970d60b280feaee2a 100644 (file)
@@ -1167,7 +1167,19 @@ BUILD_ID_CMD     := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'
 
 # Build timestamp
 #
+# Used as a means to automatically select the newest version of iPXE
+# if multiple iPXE drivers are loaded concurrently in a UEFI system.
+#
+# It gets rounded down to the nearest minute when used for this
+# purpose.
+#
+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
 
 # Build version
 #