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

Michael Brown mcb30 at ipxe.org
Thu Feb 12 14:10:30 UTC 2015


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:
>
> ...
> # 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 ) );'
> ...
> --defsym _build_id=`$(BUILD_ID_CMD)`
> ...
>
> The comment makes it clear: appearently some code out there wants this ever
> changing build_id. What code is it, what will break if _build_id gets a fixed
> value, and what can be done to give each object an stable but unique id?

romprefix.S uses it to identify multiple instances of itself (e.g. when 
a multi-port NIC exposes the same ROM via multiple PCI functions), in 
order to share PMM-allocated blocks.  mromprefix.S also uses it to 
locate its own ROM image within the borrowed PCI BAR.

For this to work, it is important that different binaries (even if built 
from the same bin/blib.a) will never have the same build ID.

Michael



More information about the ipxe-devel mailing list