6 # Convention of Linux type VM on Azure is 30G
9 # Set to a list of packages to install.
10 export VM_EXTRA_PACKAGES="azure-agent python python3 firstboot-freebsd-update firstboot-pkgs"
12 # Set to a list of third-party software to enable in rc.conf(5).
13 export VM_RC_LIST="ntpd sshd waagent firstboot_freebsd_update firstboot_pkgs"
15 # No swap space; waagent will allocate swap space on the resource disk.
16 # See ResourceDisk.EnableSwap and ResourceDisk.SwapSizeMB in waagent.conf
19 # https://docs.microsoft.com/en-us/azure/marketplace/azure-vm-create-certification-faq#vm-images-must-have-1mb-free-space
20 export VM_BOOTPARTSOFFSET=1M
22 vm_extra_pre_umount() {
23 # The firstboot_pkgs rc.d script will download the repository
24 # catalogue and install or update pkg when the instance first
25 # launches, so these files would just be replaced anyway; removing
26 # them from the image allows it to boot faster.
27 mount -t devfs devfs ${DESTDIR}/dev
28 chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
29 /usr/sbin/pkg delete -f -y pkg
31 rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
33 yes | chroot ${DESTDIR} ${EMULATOR} /usr/local/sbin/waagent -deprovision
35 cat << EOF >> ${DESTDIR}/etc/rc.conf
36 ifconfig_hn0="SYNCDHCP"
37 ntpd_sync_on_start="YES"
40 cat << EOF >> ${DESTDIR}/boot/loader.conf
45 console="comconsole efi vidconsole"
46 comconsole_speed="115200"
53 touch ${DESTDIR}/firstboot
55 rm -f ${DESTDIR}/etc/resolv.conf