xref: /freebsd/release/tools/basic-cloudinit.conf (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1#!/bin/sh
2
3# Should be enough for base image, image can be resized in needed
4export VMSIZE=5g
5
6# 1M config drive should be enough in most cases
7export CONFIG_DRIVE=YES
8export CONFIG_DRIVE_SIZE=1M
9
10# Packages to install into the image we're creating.
11# * firstboot-freebsd-update, to install security updates at first boot.
12export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} firstboot-freebsd-update"
13
14# Set to a list of third-party software to enable in rc.conf(5).
15export VM_RC_LIST="${VM_RC_LIST} firstboot_freebsd_update growfs sshd nuageinit"
16
17vm_extra_pre_umount() {
18	cat << EOF >> ${DESTDIR}/etc/rc.conf
19dumpdev="AUTO"
20ifconfig_DEFAULT="SYNCDHCP accept_rtadv"
21# RSA host keys are obsolete and also very slow to generate
22sshd_rsa_enable="NO"
23EOF
24
25	cat << EOF >> ${DESTDIR}/boot/loader.conf
26autoboot_delay="-1"
27beastie_disable="YES"
28loader_logo="none"
29console="comconsole,vidconsole"
30EOF
31
32	cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config
33PasswordAuthentication yes
34UsePAM no
35EOF
36
37	touch ${DESTDIR}/firstboot
38
39	return 0
40}
41