Skip to content

Commit 5ad48ab

Browse files
committed
tests/ci: use pkgbase to populate the VM image
This change is necessary after commit 4227d51 (release: create pkgbase VM and cloud images) After that commit, pkgbase is expected to be the primary method of installation going forward. Instead of working around this in vmimage.subr with NOPKGBASE, going the pkgbase route helps catch even more test failures. Signed-off-by: Siva Mahadevan <[email protected]> Sponsored by: The FreeBSD Foundation
1 parent 05538e2 commit 5ad48ab

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/ci/Makefile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ KLDFILEMONISLOADED!=kldload -q -n filemon 2>/dev/null && echo "1" || echo "0"
139139
METAMODE?=-DWITH_META_MODE
140140
.endif
141141

142+
PKGBASE_REPO?= ${.OBJDIR}/pkgbase-repo
143+
PKGBASE_REPO_DIR?= ${.OBJDIR}/pkgbase-repo-dir
144+
WSTAGEDIR!= ${IMAKE} -f Makefile.inc1 -C ${WORLDDIR} -V WSTAGEDIR
145+
PKG_ABI_FILE?= ${WSTAGEDIR}/usr/bin/uname
146+
PKG_ABI?= $$(${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI)
147+
142148
CLEANFILES+= ${CIDISK} ${.OBJDIR}/ci.img ${META_TAR}
143149
IMAGEDIR= ${.OBJDIR}/ci-buildimage
144150
CLEANDIRS+= ${IMAGEDIR}
@@ -184,11 +190,24 @@ ci-buildkernel: ci-buildworld-${TARGET_ARCH:tl} .PHONY
184190
${EXTRA_MAKE_FLAGS} KERNCONF=${KERNCONF} \
185191
buildkernel ${LOG_TARGET}
186192

187-
ci-buildimage: ${QEMUTGT} ci-buildkernel-${TARGET_ARCH:tl} .PHONY
193+
ci-buildpkgbase: ci-buildkernel-${TARGET_ARCH:tl} .PHONY
194+
@echo "Building pkgbase for ${TARGET_ARCH}"
195+
${IMAKE} -j${PARALLEL_JOBS} -C ${WORLDDIR} ${METAMODE} \
196+
${CROSS_TOOLCHAIN_PARAM} __MAKE_CONF=${MAKECONF} SRCCONF=${SRCCONF} \
197+
${EXTRA_MAKE_FLAGS} KERNCONF=${KERNCONF} REPODIR=${PKGBASE_REPO} \
198+
update-packages ${LOG_TARGET}
199+
mkdir -p ${PKGBASE_REPO_DIR}
200+
@printf "FreeBSD-base: { url: "file://%s", enabled: yes }" \
201+
${PKGBASE_REPO}/${PKG_ABI}/latest \
202+
> ${PKGBASE_REPO_DIR}/FreeBSD-base.conf
203+
204+
ci-buildimage: ${QEMUTGT} ci-buildpkgbase .PHONY
188205
@echo "Building ci image for ${TARGET_ARCH}"
189206
mkdir -p ${.OBJDIR}/${.TARGET}
190207
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \
191208
QEMUSTATIC=${QEMUSTATIC} CITYPE=${CITYPE} \
209+
PKG_ABI=${PKG_ABI} \
210+
PKGBASE_REPO_DIR=${PKGBASE_REPO_DIR} \
192211
${RELEASEDIR}/scripts/mk-vmimage.sh \
193212
-C ${RELEASEDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} -F ${VMFS} \
194213
-i ${.OBJDIR}/ci.img -s ${VMSIZE} -f ${FORMAT} \

0 commit comments

Comments
 (0)