aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Mendez <mmendez534@gmail.com>2021-01-15 21:29:27 -0500
committerMichael Brown <mcb30@ipxe.org>2021-01-30 17:55:34 +0000
commit9d000c9fd7e65a24467098e766e76282c4f4ec6d (patch)
tree3c145fdb2b8c2ba078fd3a33323870855d5c868c
parent6c91eebd0a7d655227936eb2ae5c0f450bdb8699 (diff)
downloadipxe-9d000c9fd7e65a24467098e766e76282c4f4ec6d.zip
ipxe-9d000c9fd7e65a24467098e766e76282c4f4ec6d.tar.gz
ipxe-9d000c9fd7e65a24467098e766e76282c4f4ec6d.tar.bz2
[build] Use SOURCE_DATE_EPOCH if it exists
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>
-rw-r--r--src/Makefile.housekeeping12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index d760f55..fc0850b 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -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
#