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 | c305082eee881564ba97d4eb1724d4017e667678 (patch) | |
tree | b81bcbd6aa5416924290f1e623faf86d7e09310b | |
parent | 3aa17757d4140009c17ffaa177413953b09c05b8 (diff) | |
download | FreeBSD-src-c305082eee881564ba97d4eb1724d4017e667678.zip FreeBSD-src-c305082eee881564ba97d4eb1724d4017e667678.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 edce8ba..3459985 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 99a2fdc..f58dfcc 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -116,6 +116,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/gpt/rootfs / ufs rw 1 1' \ |