git: 81ca663642ef - main - release: Pass PKG_INSTALL_EPOCH to vmimage.subr
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Apr 2025 15:59:13 UTC
The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=81ca663642ef1ed5111a88d2e9102f6788fab407 commit 81ca663642ef1ed5111a88d2e9102f6788fab407 Author: Colin Percival <cperciva@FreeBSD.org> AuthorDate: 2025-04-10 06:05:55 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2025-04-10 15:58:11 +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 --- 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 b5ec044fa94a..0b5f5e714cc5 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -181,6 +181,7 @@ vm-image: ${QEMUTGT} QEMUSTATIC=${QEMUSTATIC} \ ${WITHOUT_QEMU:DWITHOUT_QEMU=true} \ ${NO_ROOT:DNO_ROOT=true} \ + PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \ ${.CURDIR}/scripts/mk-vmimage.sh \ -C ${.CURDIR}/tools/vmimage.subr \ -d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \