aboutsummaryrefslogtreecommitdiff
path: root/release/tools/vmimage.subr
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2017-09-20 15:49:12 +0000
committerGlen Barber <gjb@FreeBSD.org>2017-09-20 15:49:12 +0000
commitc52962c68eb7d7f0411483628c372f3cecb1727a (patch)
tree449d883cc58df1d65843bc09c10f359a2529d24d /release/tools/vmimage.subr
parent05a34279640a47931d12fa0af402b593c4016e89 (diff)
downloadsrc-c52962c68eb7d7f0411483628c372f3cecb1727a.tar.gz
src-c52962c68eb7d7f0411483628c372f3cecb1727a.zip
Bootstrap etcupdate(8) and mergemaster(8) databases when creating
virtual machine images and embedded images, similar to what is done when extracting base.txz to the target root filesystem in an new installation. Noticed by: marius Tested with: head@r323729 MFC after: 3 days Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=323812
Diffstat (limited to 'release/tools/vmimage.subr')
-rw-r--r--release/tools/vmimage.subr9
1 files changed, 9 insertions, 0 deletions
diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index fe937defc27a..3039e2efb5f9 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -122,6 +122,15 @@ vm_install_base() {
installworld installkernel distribution || \
err "\n\nCannot install the base system to ${DESTDIR}."
+ # Bootstrap etcupdate(8) and mergemaster(8) databases.
+ mkdir -p ${DESTDIR}/var/db/etcupdate
+ etcupdate extract -B \
+ -M "TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" \
+ -s ${WORLDDIR} -d ${DESTDIR}/var/db/etcupdate
+ sh ${WORLDDIR}/release/scripts/mm-mtree.sh -m ${WORLDDIR} \
+ -F "TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" \
+ -D ${DESTDIR}
+
echo '# Custom /etc/fstab for FreeBSD VM images' \
> ${DESTDIR}/etc/fstab
echo "/dev/${ROOTLABEL}/rootfs / ufs rw 1 1" \