Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/release/tools/ec2-small.conf
103381 views
1
#!/bin/sh
2
3
. ${WORLDDIR}/release/tools/ec2.conf
4
5
# Build with a 4.9 GB partition; the growfs rc.d script will expand
6
# the partition to fill the root disk after the EC2 instance is launched.
7
# Note that if this is set to <N>G, we will end up with an <N+1> GB disk
8
# image since VMSIZE is the size of the filesystem partition, not the disk
9
# which it resides within. (This overrides the default in ec2.conf.)
10
export VMSIZE=5000m
11
12
# Flags to installworld/kernel: We don't want debug symbols (kernel or
13
# userland), 32-bit libraries, or tests.
14
export INSTALLOPTS="WITHOUT_DEBUG_FILES=YES WITHOUT_KERNEL_SYMBOLS=YES \
15
WITHOUT_LIB32=YES WITHOUT_TESTS=YES"
16
17
# Equivalent to INSTALLOPTS for pkgbase
18
vm_extra_filter_base_packages() {
19
grep -v \
20
-e '.*-dbg$' \
21
-e '.*-lib32$' \
22
-e '^FreeBSD-set-tests'
23
}
24
25
# Packages to install into the image we're creating. In addition to packages
26
# present on all EC2 AMIs, we install:
27
# * ec2-scripts, which provides a range of EC2ification startup scripts,
28
# * firstboot-freebsd-update, to install security updates at first boot,
29
# * firstboot-pkgs, to install packages at first boot, and
30
# * isc-dhcp44-client, used for IPv6 network setup.
31
export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ec2-scripts \
32
firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client"
33
34
# Services to enable in rc.conf(5).
35
export VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \
36
ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs \
37
growfs sshd"
38
39
vm_extra_pre_umount() {
40
# Any EC2 ephemeral disks seen when the system first boots will
41
# be "new" disks; there is no "previous boot" when they might have
42
# been seen and used already.
43
touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen
44
metalog_add_data ./var/db/ec2_ephemeral_diskseen
45
46
# Configuration common to all EC2 AMIs
47
ec2_common
48
49
# Standard FreeBSD network configuration
50
ec2_base_networking
51
52
# Add files from packages which weren't recorded in metalog
53
metalog_add_data ./usr/local/etc/dhclient.conf
54
55
return 0
56
}
57
58