Re: Which version is BOOTX64.efi?

From: Tomoaki AOKI <junchoon_at_dec.sakura.ne.jp>
Date: Wed, 27 Aug 2025 15:20:56 UTC
On Wed, 27 Aug 2025 08:34:26 -0600
Warner Losh <imp@bsdimp.com> wrote:

> On Wed, Aug 27, 2025 at 8:12 AM Russell Adams <Russell.Adams@adamssystems.nl>
> wrote:
> 
> > On Wed, Aug 27, 2025 at 04:03:18PM +0200, Kurt Jaeger wrote:
> > > Hi!
> > >
> > > > > Question: is there any concept to get some proper version information
> > > > > into these binaries, from which then some identity and the commit tag
> > > > > could be retrieved from which they were created?
> > > >
> > > > Maybe:
> > > >
> > > > # strings /boot/loader.efi | fgrep Revision
> > > > DFreeBSD/amd64 EFI loader, Revision 3.0
> > >
> > > I tried this:
> > >
> > > strings loader.efi | fgrep Revision
> > > 11.1:
> > > FreeBSD/amd64 EFI loader, Revision 1.1
> > > 12.2:
> > > FreeBSD/amd64 EFI loader, Revision 1.1
> > > 13.2:
> > > FreeBSD/amd64 EFI loader, Revision 1.1
> > > 14.x/15.x:
> > > FreeBSD/amd64 EFI loader, Revision 3.0
> > >
> > > but the size of the file was different in all 1.1 cases.
> > > So I'm not sure it really defines the exact version.
> > >
> > > --
> > > pi@FreeBSD.org         +49 171 3101372                  Now what ?
> > >
> >
> > This was exactly my experience in the forum post. Multiple versions
> > had the same "Revision" tag, and there is no way to crossreference
> > with a specific Freebsd version.
> 
> 
> We used to encode the date the loader was built. Reproducible builds
> stopped that.
> 
> The Revision tag really is what boot protocol is supported. That protocol
> changes very rarely.
> 
> It's not been a goal to communicate the version, and generally, there's no
> good way to know. You can tell loader.efi vs boot1.efi, that's about it.
> 
> commit a97b71605af6c68c785b02f573ed880d87635d04
> Author: Ed Maste <emaste@FreeBSD.org>
> Date:   Mon Dec 19 14:45:59 2016 +0000
> 
>     Build loaders reproducibly when WITH_REPRODUCIBLE_BUILD
> 
>     When WITH_REPRODUCIBLE_BUILD=yes is set in src.conf(5), eliminate the
>     time, user, and host from the loader's version information.  This allows
>     builds to produce bit-for-bit identical output.
> 
> If you build WITHOUT_REPRODUCIBLE_BUILD, you'd get version info.
> 
> Warner

Can't git hash (full or first 12 digits, possibly plus n**** number,
too) like in kernel help the situation? Yes, it shouldn't be suitable
for legacy bootcodes (wastes of bytes!), though.

Regards.

-- 
Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>