git: d434f9f58d88 - stable/13 - release: Pass PKG_INSTALL_EPOCH to vmimage.subr
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 26 Apr 2025 19:50:07 UTC
The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=d434f9f58d88ff5157387610b23ae6d7d58ef630 commit d434f9f58d88ff5157387610b23ae6d7d58ef630 Author: Colin Percival <cperciva@FreeBSD.org> AuthorDate: 2025-04-10 06:05:55 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2025-04-26 19:49:09 +0000 release: Pass PKG_INSTALL_EPOCH to vmimage.subr This value, if not already set, comes from the timestamp of the most recent git commit (which is now also available in src/release code as GITEPOCH) or 0 if git is not installed. This should allow /var/db/pkg/local.sqlite to be reproducible in VM images which have packages installed (e.g. cloudware). Reviewed by: emaste, bapt MFC after: 5 days Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D49760 (cherry picked from commit 81ca663642ef1ed5111a88d2e9102f6788fab407) --- release/Makefile.inc1 | 9 ++++++--- release/Makefile.vm | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/release/Makefile.inc1 b/release/Makefile.inc1 index 552b6cb60f3c..569b72df5106 100644 --- a/release/Makefile.inc1 +++ b/release/Makefile.inc1 @@ -1,6 +1,3 @@ -# -# - # Figure out where the git binary is. .for _P in /usr/bin /usr/local/bin . if !defined(GIT_CMD) || empty(GIT_CMD) @@ -24,13 +21,19 @@ GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD 2>/dev/null || GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --first-parent --count HEAD 2>/dev/null || true . export GITCOUNT . endif +. if !defined(GITEPOCH) || empty(GITEPOCH) +GITEPOCH!= ${GIT_CMD} -C ${.CURDIR} show -s --format=%ct HEAD 2>/dev/null || true +. export GITEPOCH +. endif .else GITBRANCH= nullbranch GITREV= nullhash GITCOUNT= nullcount +GITEPOCH= 0 . export GITBRANCH . export GITREV . export GITCOUNT +. export GITEPOCH .endif # Set the build date, primarily for snapshot builds. diff --git a/release/Makefile.vm b/release/Makefile.vm index 4fc8f8f75acf..7fd02abf7dc0 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -132,6 +132,7 @@ vm-image: . for FORMAT in ${VMFORMATS} mkdir -p ${.OBJDIR}/${.TARGET}-${FORMAT} env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \ + PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr \ -d ${.OBJDIR}/${.TARGET}-${FORMAT} \