azure.conf (83952a5baa337cc257858feb4886d947ba1a60e3) azure.conf (fbece7609573bd51080e949df03fa3d803a637ae)
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
1#!/bin/sh
2#
3# $FreeBSD$
4#
5
6# Convention of Linux type VM on Azure is 30G
7export VMSIZE=30g
8
6# Set to a list of packages to install.
9# Set to a list of packages to install.
7# Example:
8#export VM_EXTRA_PACKAGES="www/apache24"
9export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} sysutils/azure-agent"
10export 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).
11
12# Set to a list of third-party software to enable in rc.conf(5).
12# Example:
13#export VM_RC_LIST="apache24"
14export VM_RC_LIST=
13export VM_RC_LIST="ntpd sshd waagent firstboot_freebsd_update firstboot_pkgs"
15
14
15# No swap space; waagent will allocate swap space on the resource disk.
16# See ResourceDisk.EnableSwap and ResourceDisk.SwapSizeMB in waagent.conf
17export NOSWAP=YES
18
19# https://docs.microsoft.com/en-us/azure/marketplace/azure-vm-create-certification-faq#vm-images-must-have-1mb-free-space
20export VM_BOOTPARTSOFFSET=1M
21
16vm_extra_pre_umount() {
22vm_extra_pre_umount() {
17 chroot ${DESTDIR} ln -s /usr/local/sbin/waagent /usr/sbin/waagent
18 chroot ${DESTDIR} /usr/local/sbin/waagent -verbose -install
19 yes | chroot ${DESTDIR} /usr/local/sbin/waagent -deprovision
20 echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
21 echo 'ifconfig_hn0="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
22 echo 'waagent_enable="YES"' >> ${DESTDIR}/etc/rc.conf
23 echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf
24 echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf
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
30 umount ${DESTDIR}/dev
31 rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
25
32
33 yes | chroot ${DESTDIR} ${EMULATOR} /usr/local/sbin/waagent -deprovision
34
35 cat << EOF >> ${DESTDIR}/etc/rc.conf
36ifconfig_hn0="SYNCDHCP"
37ntpd_sync_on_start="YES"
38EOF
39
40 cat << EOF >> ${DESTDIR}/boot/loader.conf
41autoboot_delay="-1"
42beastie_disable="YES"
43loader_logo="none"
44hw.memtest.tests="0"
45console="comconsole efi vidconsole"
46comconsole_speed="115200"
47boot_multicons="YES"
48boot_serial="YES"
49mlx4en_load="YES"
50mlx5en_load="YES"
51EOF
52
53 touch ${DESTDIR}/firstboot
54
26 rm -f ${DESTDIR}/etc/resolv.conf
27
28 return 0
29}
55 rm -f ${DESTDIR}/etc/resolv.conf
56
57 return 0
58}