xref: /freebsd/release/tools/basic-cloudinit.conf (revision 96190b4fef3b4a0cc3ca0606b0c4e3e69a5e6717)
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"
21sshd_enable="YES"
22# RSA host keys are obsolete and also very slow to generate
23sshd_rsa_enable="NO"
24EOF
25
26	cat << EOF >> ${DESTDIR}/boot/loader.conf
27autoboot_delay="-1"
28beastie_disable="YES"
29loader_logo="none"
30console="comconsole,vidconsole"
31EOF
32
33	cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config
34PasswordAuthentication yes
35UsePAM no
36EOF
37
38	touch ${DESTDIR}/firstboot
39
40	return 0
41}
42