Skip to content

Commit

Permalink
[build] Use SOURCE_DATE_EPOCH if it exists
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mmlb authored and mcb30 committed Jan 30, 2021
1 parent 6c91eeb commit 9d000c9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Makefile.housekeeping
Expand Up @@ -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
#
Expand Down

0 comments on commit 9d000c9

Please sign in to comment.