xref: /freebsd/release/tools/ec2-base.conf (revision 40ff0753abb9c00b5f1e5df9ea00c9fdded55ac4)
17494fb6bSColin Percival#!/bin/sh
27494fb6bSColin Percival
3fada6e23SColin Percival. ${WORLDDIR}/release/tools/ec2.conf
4fada6e23SColin Percival
5fada6e23SColin Percival# Packages to install into the image we're creating.  In addition to packages
6fada6e23SColin Percival# present on all EC2 AMIs, we install:
7*40ff0753SColin Percival# * amazon-ssm-agent (not enabled by default, but some users need to use
8*40ff0753SColin Percival# it on systems not connected to the internet),
9fada6e23SColin Percival# * ec2-scripts, which provides a range of EC2ification startup scripts,
10fada6e23SColin Percival# * firstboot-freebsd-update, to install security updates at first boot,
11fada6e23SColin Percival# * firstboot-pkgs, to install packages at first boot, and
12fada6e23SColin Percival# * isc-dhcp44-client, used for IPv6 network setup.
13*40ff0753SColin Percivalexport VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} amazon-ssm-agent ec2-scripts \
14fada6e23SColin Percival    firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client"
157494fb6bSColin Percival
16fada6e23SColin Percival# Services to enable in rc.conf(5).
17fada6e23SColin Percivalexport VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \
18fada6e23SColin Percival    ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs \
19fada6e23SColin Percival    growfs sshd"
207494fb6bSColin Percival
217494fb6bSColin Percivalvm_extra_pre_umount() {
227494fb6bSColin Percival	# The AWS CLI tools are generally useful, and small enough that they
237494fb6bSColin Percival	# will download quickly; but users will often override this setting
247494fb6bSColin Percival	# via EC2 user-data.
257494fb6bSColin Percival	echo 'firstboot_pkgs_list="devel/py-awscli"' >> ${DESTDIR}/etc/rc.conf
267494fb6bSColin Percival
277494fb6bSColin Percival	# Any EC2 ephemeral disks seen when the system first boots will
287494fb6bSColin Percival	# be "new" disks; there is no "previous boot" when they might have
297494fb6bSColin Percival	# been seen and used already.
307494fb6bSColin Percival	touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen
317494fb6bSColin Percival
32fada6e23SColin Percival	# Configuration common to all EC2 AMIs
33fada6e23SColin Percival	ec2_common
347494fb6bSColin Percival
35f961ddb2SColin Percival	# Standard FreeBSD network configuration
36f961ddb2SColin Percival	ec2_base_networking
37f961ddb2SColin Percival
387494fb6bSColin Percival	return 0
397494fb6bSColin Percival}
40