#!/bin/sh12. ${WORLDDIR}/release/tools/ec2.conf34# Build with a 4.9 GB partition; the growfs rc.d script will expand5# the partition to fill the root disk after the EC2 instance is launched.6# Note that if this is set to <N>G, we will end up with an <N+1> GB disk7# image since VMSIZE is the size of the filesystem partition, not the disk8# which it resides within. (This overrides the default in ec2.conf.)9export VMSIZE=5000m1011# Flags to installworld/kernel: We don't want debug symbols (kernel or12# userland), 32-bit libraries, or tests.13export INSTALLOPTS="WITHOUT_DEBUG_FILES=YES WITHOUT_KERNEL_SYMBOLS=YES \14WITHOUT_LIB32=YES WITHOUT_TESTS=YES"1516# Equivalent to INSTALLOPTS for pkgbase17vm_extra_filter_base_packages() {18grep -v \19-e '.*-dbg$' \20-e '.*-lib32$' \21-e '^FreeBSD-set-tests'22}2324# Packages to install into the image we're creating. In addition to packages25# present on all EC2 AMIs, we install:26# * ec2-scripts, which provides a range of EC2ification startup scripts,27# * firstboot-freebsd-update, to install security updates at first boot,28# * firstboot-pkgs, to install packages at first boot, and29# * isc-dhcp44-client, used for IPv6 network setup.30export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ec2-scripts \31firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client"3233# Services to enable in rc.conf(5).34export VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \35ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs \36growfs sshd"3738vm_extra_pre_umount() {39# Any EC2 ephemeral disks seen when the system first boots will40# be "new" disks; there is no "previous boot" when they might have41# been seen and used already.42touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen43metalog_add_data ./var/db/ec2_ephemeral_diskseen4445# Configuration common to all EC2 AMIs46ec2_common4748# Standard FreeBSD network configuration49ec2_base_networking5051# Add files from packages which weren't recorded in metalog52metalog_add_data ./usr/local/etc/dhclient.conf5354return 055}565758