<div dir="ltr"><div>Hello ipxe-devel,<br></div><div><br></div><div>While I work on a reproducible build-id, there's no reason this patch for a reproducible timestamp needs to wait for it. Hence, the attached (and below inlined) patch diff allows a reproducible `BUILD_TIMESTAMP` when the following criteria are satisfied:</div><div><br></div><div>* `git` command is available</div><div>* the ipxe source tree is a git checkout</div><div>* the git checkout is "clean" (no diff between working tree and index)</div><div><br></div><div>If the aforementioned are satisfied, then the `BUILD_TIMESTAMP` is assigned the Unix timestamp of the HEAD commit. Otherwise, the `BUILD_TIMESTAMP` is assigned the Unix timestamp of "now"; i.e., heretofore legacy behavior.<br></div><div><br></div><div>Inline diff follows...</div><div><br></div><div>diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping<br>index 1dd14794..126a082a 100644<br>--- a/src/Makefile.housekeeping<br>+++ b/src/Makefile.housekeeping<br>@@ -1168,9 +1168,14 @@ blib : $(BLIB)<br> #<br> BUILD_ID_CMD      := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'<br> <br>+# assumes first element in MAKEFILE_LIST is src/Makefile:<br>+IPXE_DIR := $(abspath $(dir $(abspath $(firstword $(MAKEFILE_LIST))))/..)<br>+<br> # Build timestamp<br> #<br>-BUILD_TIMESTAMP := $(shell date +%s)<br>+BUILD_TIMESTAMP := $(shell git -C $(IPXE_DIR) diff-files --quiet \<br>+  && git -C $(IPXE_DIR) show -s --format=%ct HEAD \<br>+  || date +%s)<br> <br> # Build version<br> #<br></div></div>