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
This commit is contained in:
gjb 2017-09-20 15:49:12 +00:00
parent ba24d70fd7
commit a2a59746a9
2 changed files with 19 additions and 0 deletions

View File

@ -99,6 +99,16 @@ arm_install_base() {
TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \
DESTDIR=${DESTDIR} KERNCONF=${KERNEL} \
installworld installkernel distribution
# Bootstrap etcupdate(8) and mergemaster(8) databases.
mkdir -p ${DESTDIR}/var/db/etcupdate
etcupdate extract -B \
-M "TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" \
-s ${WORLDDIR} -d ${DESTDIR}/var/db/etcupdate
sh ${WORLDDIR}/release/scripts/mm-mtree.sh -m ${WORLDDIR} \
-F "TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" \
-D ${DESTDIR}
chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/boot/msdos
arm_create_user

View File

@ -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" \