[ipxe-devel] how to provide a stable _build_id?

Olaf Hering olaf at aepfle.de
Fri Nov 4 15:25:02 UTC 2016


On Thu, Nov 03, Olaf Hering wrote:

> On Thu, Feb 12, Michael Brown wrote:
> 
> > On 12/02/15 13:44, Olaf Hering wrote:
> > > In the spirit of 335a7ddcd4e2d0faaee6d5b1edf0307dfba3d0e5 ("[build] Sort
> > > objects in blib.a") to get reproducible binaries from the very same
> > > source on different build hosts, the last missing piece to reach that
> > > goal is this code in src/Makefile.housekeeping:


This variant works for me.

--- a/roms/ipxe/src/Makefile.housekeeping
+++ b/roms/ipxe/src/Makefile.housekeeping
@@ -1074,7 +1074,9 @@ blib : $(BLIB)
 # Command to generate build ID.  Must be unique for each $(BIN)/%.tmp,
 # even within the same build run.
 #
-BUILD_ID_CMD   := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'
+BUILD_ID_DIR    := .build_ids
+VERYCLEANUP     += $(BUILD_ID_DIR)
+BUILD_ID_CMD    := bash -c 'declare -i i=1 ; mkdir -p $(BUILD_ID_DIR) ; cd $(BUILD_ID_DIR) ; until mkdir "$${i}" 2>/dev/null ; do : $$(( i++ )) ; done ; printf "0x%08x" "$${i}" '
 
 # Build timestamp
 #

It might now work with 'make -j', but that can be solved by
'find  \( -name "*.rom" -o -name "*.tmp" \) -delete ; make'


Let me know how you want to sort this out.

Olaf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20161104/2edf86fb/attachment.sig>


More information about the ipxe-devel mailing list