I have just committed some changes to allow information from the
build environment to be stored in /etc/release and in kernels.
You can store information about your build in the BUILDINFO
environment variable, to pass it to build.sh via -V
BUILDINFO="Your information here". The value may be a multi-line
string, with embedded C-style escapes, so line breaks may be
denoted by \n or by literal line breaks (or a mixture of both).
The BUILDINFO value will appear near the top of /etc/release if
you build a release, and will be stored in the kernel's buildinfo
variable if you build a kernel. The value bay be extracted from a
running kernel via sysctl kern.buildinfo.
For example, if you pass something like this to build.sh:
BUILDINFO='Built from my private git repository
branch foo, commit deadc0ffee, date 2014-08-03,
based on NetBSD-current as of 2014-08-03 10:00 UTC'
then sysctl kern.buildinfo would print that information,
and information like this would appear near the top of
${DESTDIR}/etc/release:
Build information:
Build date Sun Aug 3 22:47:03 UTC 2014
Built by user@host.domain
Built from my private git repository
branch foo, commit deadc0ffee, date 2014-08-03,
based on NetBSD-current as of 2014-08-03 10:00 UTC
--apb (Alan Barrett)