git: 605fb076eb33 - main - nanobsd: Add a NANO_TIMESTAMP variable
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 17 Jan 2026 18:13:04 UTC
The branch main has been updated by jlduran:
URL: https://cgit.FreeBSD.org/src/commit/?id=605fb076eb33ea5c08ec6ed3bbe7b6966baa898d
commit 605fb076eb33ea5c08ec6ed3bbe7b6966baa898d
Author: Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2026-01-17 18:07:31 +0000
Commit: Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2026-01-17 18:07:31 +0000
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
---
tools/tools/nanobsd/defaults.sh | 5 +++++
1 file changed, 5 insertions(+)
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