diff options
author | gjb <gjb@FreeBSD.org> | 2017-09-20 17:09:04 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2017-09-20 17:09:04 +0000 |
commit | 28a6a493f73e42cad7042aff80ae8c75caf22781 (patch) | |
tree | 98b3fbe1a8032964cdf4953fd959fc23dcdf8108 | |
parent | 50ed118b148ff02ae172ae1c1ef93b82aa4a58fd (diff) | |
download | FreeBSD-src-28a6a493f73e42cad7042aff80ae8c75caf22781.zip FreeBSD-src-28a6a493f73e42cad7042aff80ae8c75caf22781.tar.gz |
MFC r323812:
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
a new installation.
Approved by: re (marius, insta-MFC)
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | release/tools/arm.subr | 10 | ||||
-rw-r--r-- | release/tools/vmimage.subr | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/release/tools/arm.subr b/release/tools/arm.subr index 97326c4..6724386 100644 --- a/release/tools/arm.subr +++ b/release/tools/arm.subr @@ -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 diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index fe937de..3039e2e 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" \ |