The branch main has been updated by sjg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2982c70852395fad40959072ed90c8676a4b9a1c

commit 2982c70852395fad40959072ed90c8676a4b9a1c
Author:     Simon J. Gerraty <s...@freebsd.org>
AuthorDate: 2025-05-22 22:47:21 +0000
Commit:     Simon J. Gerraty <s...@freebsd.org>
CommitDate: 2025-05-22 22:47:21 +0000

    stand allow for local.defs.mk
    
    This allows us to change the VERSION_FILE used for loaders
    as well as set NEWVERS_DATE and BUILD_UTC to reflect the publish
    date of loaders for secure-boot.
    
    Sponsored by:   Juniper Networks, Inc.
    
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D50478
---
 stand/common/newvers.sh    | 6 +++++-
 stand/defs.mk              | 2 ++
 stand/efi/loader/Makefile  | 2 +-
 stand/i386/loader/Makefile | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/stand/common/newvers.sh b/stand/common/newvers.sh
index c244e718c041..8541d61ed76c 100755
--- a/stand/common/newvers.sh
+++ b/stand/common/newvers.sh
@@ -50,13 +50,17 @@ if [ -n "$SOURCE_DATE_EPOCH" ]; then
                exit 1
        fi
 else
-       t=`date`
+       t="${NEWVERS_DATE:-`date`}"
 fi
 r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1`
 
 bootprog_info="FreeBSD/${3} ${2}, Revision ${r}\\n"
 if [ -n "${include_metadata}" ]; then
        bootprog_info="$bootprog_info(${t} ${u}@${h})\\n"
+       if [ -n "$BUILD_UTC" ]; then
+               # We can use what(1) to extract BUILD_UTC
+               bootprog_info="$bootprog_info\\0@(#)BUILD_UTC=$BUILD_UTC"
+       fi
 fi
 
 cat > $tempfile <<EOF
diff --git a/stand/defs.mk b/stand/defs.mk
index f39966f2ca8e..8ef84267b198 100644
--- a/stand/defs.mk
+++ b/stand/defs.mk
@@ -258,4 +258,6 @@ ${_ILINKS}: .NOMETA
        ${ECHO} ${.TARGET} "->" $$path ; \
        ln -fns $$path ${.TARGET}
 .endif # !NO_OBJ
+
+.-include "local.defs.mk"
 .endif # __BOOT_DEFS_MK__
diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile
index 2dae035f04a8..ae2ffc475730 100644
--- a/stand/efi/loader/Makefile
+++ b/stand/efi/loader/Makefile
@@ -87,7 +87,7 @@ CFLAGS+= -DEFI_SECUREBOOT
 .endif
 
 NEWVERSWHAT?=  "EFI loader" ${MACHINE}
-VERSION_FILE=  ${.CURDIR}/../loader/version
+VERSION_FILE?= ${.CURDIR}/../loader/version
 HELP_FILENAME= loader.help.efi
 
 # Always add MI sources
diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile
index e1f0298403b3..96ad50a75509 100644
--- a/stand/i386/loader/Makefile
+++ b/stand/i386/loader/Makefile
@@ -16,7 +16,7 @@ LOADER?=      loader_${LOADER_INTERP}
 PROG=          ${LOADER}.sym
 INTERNALPROG=
 NEWVERSWHAT?=  "bootstrap loader" x86
-VERSION_FILE=  ${.CURDIR}/../loader/version
+VERSION_FILE?= ${.CURDIR}/../loader/version
 #
 # There's 640k - 40k maximum space, less however much memory the BIOS uses.  A
 # non-random survey suggests that 20k-25k is a good value for 'most' machines.

Reply via email to