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
This commit is contained in:
@@ -1,6 +1,3 @@
|
|||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# Figure out where the git binary is.
|
# Figure out where the git binary is.
|
||||||
.for _P in /usr/bin /usr/local/bin
|
.for _P in /usr/bin /usr/local/bin
|
||||||
. if !defined(GIT_CMD) || empty(GIT_CMD)
|
. 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
|
GITCOUNT!= ${GIT_CMD} -C ${.CURDIR} rev-list --first-parent --count HEAD 2>/dev/null || true
|
||||||
. export GITCOUNT
|
. export GITCOUNT
|
||||||
. endif
|
. endif
|
||||||
|
. if !defined(GITEPOCH) || empty(GITEPOCH)
|
||||||
|
GITEPOCH!= ${GIT_CMD} -C ${.CURDIR} show -s --format=%ct HEAD 2>/dev/null || true
|
||||||
|
. export GITEPOCH
|
||||||
|
. endif
|
||||||
.else
|
.else
|
||||||
GITBRANCH= nullbranch
|
GITBRANCH= nullbranch
|
||||||
GITREV= nullhash
|
GITREV= nullhash
|
||||||
GITCOUNT= nullcount
|
GITCOUNT= nullcount
|
||||||
|
GITEPOCH= 0
|
||||||
. export GITBRANCH
|
. export GITBRANCH
|
||||||
. export GITREV
|
. export GITREV
|
||||||
. export GITCOUNT
|
. export GITCOUNT
|
||||||
|
. export GITEPOCH
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
# Set the build date, primarily for snapshot builds.
|
# Set the build date, primarily for snapshot builds.
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ vm-image: ${QEMUTGT}
|
|||||||
QEMUSTATIC=${QEMUSTATIC} \
|
QEMUSTATIC=${QEMUSTATIC} \
|
||||||
${WITHOUT_QEMU:DWITHOUT_QEMU=true} \
|
${WITHOUT_QEMU:DWITHOUT_QEMU=true} \
|
||||||
${NO_ROOT:DNO_ROOT=true} \
|
${NO_ROOT:DNO_ROOT=true} \
|
||||||
|
PKG_INSTALL_EPOCH=${PKG_INSTALL_EPOCH:U${GITEPOCH}} \
|
||||||
${.CURDIR}/scripts/mk-vmimage.sh \
|
${.CURDIR}/scripts/mk-vmimage.sh \
|
||||||
-C ${.CURDIR}/tools/vmimage.subr \
|
-C ${.CURDIR}/tools/vmimage.subr \
|
||||||
-d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \
|
-d ${.OBJDIR}/${.TARGET}-${FORMAT}-${FS} -F ${FS} \
|
||||||
|
|||||||
Reference in New Issue
Block a user