xref: /freebsd/release/tools/ec2-base.conf (revision 675382f12b67e8b7b2f35bd1f8dfd96b8d8e4aae)
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-pkg-upgrade, 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-pkg-upgrade 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_pkg_upgrade 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	# Limit firstboot_pkg_upgrade to the base system.
28	echo 'firstboot_pkg_upgrade_repos="FreeBSD-base"' >> ${DESTDIR}/etc/rc.conf
29
30	# Any EC2 ephemeral disks seen when the system first boots will
31	# be "new" disks; there is no "previous boot" when they might have
32	# been seen and used already.
33	touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen
34	metalog_add_data ./var/db/ec2_ephemeral_diskseen
35
36	# Configuration common to all EC2 AMIs
37	ec2_common
38
39	# Standard FreeBSD network configuration
40	ec2_base_networking
41
42	# Add files from packages which weren't recorded in metalog
43	metalog_add_data ./usr/local/etc/dhclient.conf
44	metalog_add_data ./usr/local/etc/ssl/cert.pem
45
46	return 0
47}
48