2014-10-14 11:48:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2021-10-01 20:59:10 +00:00
|
|
|
# Convention of Linux type VM on Azure is 30G
|
|
|
|
export VMSIZE=30g
|
|
|
|
|
2014-10-14 11:48:28 +00:00
|
|
|
# Set to a list of packages to install.
|
2021-10-01 20:59:10 +00:00
|
|
|
export VM_EXTRA_PACKAGES="azure-agent python python3 firstboot-freebsd-update firstboot-pkgs"
|
2014-10-14 11:48:28 +00:00
|
|
|
|
|
|
|
# Set to a list of third-party software to enable in rc.conf(5).
|
2021-10-01 20:59:10 +00:00
|
|
|
export VM_RC_LIST="ntpd sshd waagent firstboot_freebsd_update firstboot_pkgs"
|
|
|
|
|
|
|
|
# No swap space; waagent will allocate swap space on the resource disk.
|
|
|
|
# See ResourceDisk.EnableSwap and ResourceDisk.SwapSizeMB in waagent.conf
|
|
|
|
export NOSWAP=YES
|
|
|
|
|
|
|
|
# https://docs.microsoft.com/en-us/azure/marketplace/azure-vm-create-certification-faq#vm-images-must-have-1mb-free-space
|
|
|
|
export VM_BOOTPARTSOFFSET=1M
|
2014-11-05 13:22:19 +00:00
|
|
|
|
|
|
|
vm_extra_pre_umount() {
|
2022-11-03 19:17:43 +00:00
|
|
|
mount -t devfs devfs ${DESTDIR}/dev
|
|
|
|
|
2021-10-01 20:59:10 +00:00
|
|
|
# The firstboot_pkgs rc.d script will download the repository
|
|
|
|
# catalogue and install or update pkg when the instance first
|
|
|
|
# launches, so these files would just be replaced anyway; removing
|
|
|
|
# them from the image allows it to boot faster.
|
|
|
|
chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
|
|
|
|
/usr/sbin/pkg delete -f -y pkg
|
|
|
|
rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
|
|
|
|
|
2022-11-03 19:17:43 +00:00
|
|
|
chroot ${DESTDIR} ${EMULATOR} pw usermod root -h -
|
|
|
|
|
|
|
|
umount ${DESTDIR}/dev
|
2021-10-01 20:59:10 +00:00
|
|
|
|
|
|
|
cat << EOF >> ${DESTDIR}/etc/rc.conf
|
|
|
|
ifconfig_hn0="SYNCDHCP"
|
|
|
|
ntpd_sync_on_start="YES"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat << EOF >> ${DESTDIR}/boot/loader.conf
|
|
|
|
autoboot_delay="-1"
|
|
|
|
beastie_disable="YES"
|
|
|
|
loader_logo="none"
|
|
|
|
hw.memtest.tests="0"
|
|
|
|
console="comconsole efi vidconsole"
|
|
|
|
comconsole_speed="115200"
|
|
|
|
boot_multicons="YES"
|
|
|
|
boot_serial="YES"
|
|
|
|
mlx4en_load="YES"
|
|
|
|
mlx5en_load="YES"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
touch ${DESTDIR}/firstboot
|
2014-11-05 13:22:19 +00:00
|
|
|
|
2014-11-21 02:30:37 +00:00
|
|
|
rm -f ${DESTDIR}/etc/resolv.conf
|
|
|
|
|
2014-11-05 13:22:19 +00:00
|
|
|
return 0
|
|
|
|
}
|