aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@FreeBSD.org>2026-01-17 18:07:31 +0000
committerJose Luis Duran <jlduran@FreeBSD.org>2026-01-17 18:07:31 +0000
commit605fb076eb33ea5c08ec6ed3bbe7b6966baa898d (patch)
treef3f100bd03ec32f66c60c6da693cc90713313392
parent7c4d6fbd1b7970703f7d14f3acfba5dbcd168644 (diff)
nanobsd: Add a NANO_TIMESTAMP variable
Initially not wired, this variable will hold the time stamp for all the files of the final image. By default uses the last commit time stamp, if empty, it will use the start time of the NanoBSD build. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48787
-rwxr-xr-xtools/tools/nanobsd/defaults.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh
index be4126516c3d..fd98482f7115 100755
--- a/tools/tools/nanobsd/defaults.sh
+++ b/tools/tools/nanobsd/defaults.sh
@@ -56,6 +56,9 @@ NANO_PKG_META_BASE=/var/db
# directory located in Files.
#NANO_CUST_FILES_MTREE=""
+# Use the time of the last commit as a timestamp when doing a NO_PRIV build.
+NANO_TIMESTAMP=$(git log -1 --format=%ct || true)
+
# Object tree directory
# default is subdir of /usr/obj
#NANO_OBJ=""
@@ -969,6 +972,7 @@ set_defaults_and_export() {
NANO_METALOG=${NANO_OBJ}/_.metalog || true
NANO_STARTTIME=`date +%s`
+ : ${NANO_TIMESTAMP:=${NANO_STARTTIME}}
pprint 3 "Exporting NanoBSD variables"
export_var MAKEOBJDIRPREFIX
export_var NANO_ARCH
@@ -992,6 +996,7 @@ set_defaults_and_export() {
export_var NANO_PMAKE
export_var NANO_SECTS
export_var NANO_SRC
+ export_var NANO_TIMESTAMP
export_var NANO_TOOLS
export_var NANO_WORLDDIR
export_var NANO_BOOT0CFG