xref: /src/release/tools/azure.conf (revision 54e006369c9aab4f3a22f026eb6924c0f9cafda8)
1#!/bin/sh
2#
3#
4
5# Convention of Linux type VM on Azure is 30G
6export VMSIZE=30g
7
8# Set to a list of packages to install.
9export VM_EXTRA_PACKAGES="azure-agent python python3 firstboot-freebsd-update firstboot-pkgs"
10
11# Set to a list of third-party software to enable in rc.conf(5).
12export VM_RC_LIST="ntpd sshd waagent firstboot_freebsd_update firstboot_pkgs"
13
14# No swap space; waagent will allocate swap space on the resource disk.
15# See ResourceDisk.EnableSwap and ResourceDisk.SwapSizeMB in waagent.conf
16export NOSWAP=YES
17
18# https://learn.microsoft.com/en-us/partner-center/marketplace/azure-vm-certification-faq#vm-images-must-have-1-mb-of-free-space
19export VM_BOOTPARTSOFFSET=1M
20
21# Hack for FreeBSD 15.0; should go away before 15.1.
22MISSING_METALOGS="
23./usr/local/etc/pam.d/sudo
24./usr/local/etc/ssl/cert.pem
25./usr/local/etc/sudo.conf
26./usr/local/etc/sudo_logsrvd.conf
27./usr/local/etc/sudoers
28./usr/local/etc/waagent.conf
29"
30
31vm_extra_pre_umount() {
32	# Remove the pkg package and repo databases as they will likely
33	# be out of date by the time the image is used.  In unprivileged
34	# builds this is unnecessary as pkg will not be installed to
35	# begin with.
36	if [ -z "${NO_ROOT}" ]; then
37		echo "ERROR: NO_ROOT not set" >&2
38		exit 1
39	fi
40
41	pw -R ${DESTDIR} usermod root -h -
42
43	cat << EOF >> ${DESTDIR}/etc/rc.conf
44ifconfig_hn0="SYNCDHCP"
45ntpd_sync_on_start="YES"
46EOF
47
48	cat << EOF >> ${DESTDIR}/boot/loader.conf
49autoboot_delay="-1"
50beastie_disable="YES"
51loader_logo="none"
52hw.memtest.tests="0"
53console="comconsole,efi,vidconsole"
54comconsole_speed="115200"
55boot_multicons="YES"
56boot_serial="YES"
57mlx4en_load="YES"
58mlx5en_load="YES"
59EOF
60	metalog_add_data ./boot/loader.conf
61
62	return 0
63}
64