xref: /freebsd/release/tools/ec2-base.conf (revision 7ab1a32cd43cbae61ad4dd435d6a482bbf61cb52)
1#!/bin/sh
2
3. ${WORLDDIR}/release/tools/ec2.conf
4
5# Packages to install into the image we're creating.  In addition to packages
6# present on all EC2 AMIs, we install:
7# * amazon-ssm-agent (not enabled by default, but some users need to use
8# it on systems not connected to the internet),
9# * ec2-scripts, which provides a range of EC2ification startup scripts,
10# * firstboot-freebsd-update, to install security updates at first boot,
11# * firstboot-pkgs, to install packages at first boot, and
12# * isc-dhcp44-client, used for IPv6 network setup.
13export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} amazon-ssm-agent ec2-scripts \
14    firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client"
15
16# Services to enable in rc.conf(5).
17export VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \
18    ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs \
19    growfs sshd"
20
21vm_extra_pre_umount() {
22	# The AWS CLI tools are generally useful, and small enough that they
23	# will download quickly; but users will often override this setting
24	# via EC2 user-data.
25	echo 'firstboot_pkgs_list="devel/py-awscli"' >> ${DESTDIR}/etc/rc.conf
26
27	# Any EC2 ephemeral disks seen when the system first boots will
28	# be "new" disks; there is no "previous boot" when they might have
29	# been seen and used already.
30	touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen
31
32	# Configuration common to all EC2 AMIs
33	ec2_common
34
35	# Standard FreeBSD network configuration
36	ec2_base_networking
37
38	return 0
39}
40