xref: /freebsd/release/tools/basic-cloudinit.conf (revision cd3cc6e910c0f739925c57e42fae6781d693db02)
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-pkg-upgrade, to install security updates at first boot.
12export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} firstboot-pkg-upgrade"
13
14# Set to a list of third-party software to enable in rc.conf(5).
15export VM_RC_LIST="${VM_RC_LIST} firstboot_pkg_upgrade growfs sshd nuageinit"
16
17vm_extra_pre_umount() {
18	cat << EOF >> ${DESTDIR}/etc/rc.conf
19dumpdev="AUTO"
20ifconfig_DEFAULT="SYNCDHCP accept_rtadv"
21firstboot_pkg_upgrade_repos="FreeBSD-base"
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	metalog_add_data ./boot/loader.conf
33
34	cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config
35PasswordAuthentication yes
36UsePAM no
37EOF
38
39	return 0
40}
41