]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - release/tools/azure.conf
Import OpenCSD v.1.4.0.
[FreeBSD/FreeBSD.git] / release / tools / azure.conf
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # Convention of Linux type VM on Azure is 30G
7 export VMSIZE=30g
8
9 # Set to a list of packages to install.
10 export VM_EXTRA_PACKAGES="azure-agent python python3 firstboot-freebsd-update firstboot-pkgs"
11
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"
14
15 # No swap space; waagent will allocate swap space on the resource disk.
16 # See ResourceDisk.EnableSwap and ResourceDisk.SwapSizeMB in waagent.conf
17 export NOSWAP=YES
18
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
21
22 vm_extra_pre_umount() {
23         mount -t devfs devfs ${DESTDIR}/dev
24
25         # The firstboot_pkgs rc.d script will download the repository
26         # catalogue and install or update pkg when the instance first
27         # launches, so these files would just be replaced anyway; removing
28         # them from the image allows it to boot faster.
29         chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
30                 /usr/sbin/pkg delete -f -y pkg
31         rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
32
33         chroot ${DESTDIR} ${EMULATOR} pw usermod root -h -
34
35         umount ${DESTDIR}/dev
36
37         cat << EOF >> ${DESTDIR}/etc/rc.conf
38 ifconfig_hn0="SYNCDHCP"
39 ntpd_sync_on_start="YES"
40 EOF
41
42         cat << EOF >> ${DESTDIR}/boot/loader.conf
43 autoboot_delay="-1"
44 beastie_disable="YES"
45 loader_logo="none"
46 hw.memtest.tests="0"
47 console="comconsole efi vidconsole"
48 comconsole_speed="115200"
49 boot_multicons="YES"
50 boot_serial="YES"
51 mlx4en_load="YES"
52 mlx5en_load="YES"
53 EOF
54
55         touch ${DESTDIR}/firstboot
56
57         rm -f ${DESTDIR}/etc/resolv.conf
58
59         return 0
60 }