Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/release/tools/azure.conf
104518 views
1
#!/bin/sh
2
#
3
#
4
5
# Convention of Linux type VM on Azure is 30G
6
export VMSIZE=30g
7
8
# Set to a list of packages to install.
9
export 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).
12
export 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
16
export 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
19
export VM_BOOTPARTSOFFSET=1M
20
21
# Hack for FreeBSD 15.0; should go away before 15.1.
22
MISSING_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
31
vm_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
44
ifconfig_hn0="SYNCDHCP"
45
ntpd_sync_on_start="YES"
46
EOF
47
48
cat << EOF >> ${DESTDIR}/boot/loader.conf
49
autoboot_delay="-1"
50
beastie_disable="YES"
51
loader_logo="none"
52
hw.memtest.tests="0"
53
console="comconsole,efi,vidconsole"
54
comconsole_speed="115200"
55
boot_multicons="YES"
56
boot_serial="YES"
57
mlx4en_load="YES"
58
mlx5en_load="YES"
59
EOF
60
metalog_add_data ./boot/loader.conf
61
62
return 0
63
}
64
65