6 # Set to a list of packages to install.
7 export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \
8 google-cloud-sdk google-daemon panicmail sudo firstboot-growfs \
9 google-startup-scripts"
11 # Set to a list of third-party software to enable in rc.conf(5).
12 export VM_RC_LIST="google_accounts_manager ntpd sshd firstboot_growfs \
13 firstboot_pkgs firstboot_freebsd_update google_startup"
15 vm_extra_install_base() {
16 echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf
17 echo 'nameserver 169.254.169.254' >> ${DESTDIR}/etc/resolv.conf
18 echo 'nameserver 8.8.8.8' >> ${DESTDIR}/etc/resolv.conf
21 vm_extra_pre_umount() {
22 cat << EOF >> ${DESTDIR}/etc/rc.conf
24 ifconfig_DEFAULT="SYNCDHCP mtu 1460"
25 ntpd_sync_on_start="YES"
26 # need to fill in something here
27 #firstboot_pkgs_list=""
28 panicmail_autosubmit="YES"
31 cat << EOF >> ${DESTDIR}/boot/loader.conf
36 console="comconsole,vidconsole"
38 kern.timecounter.hardware=ACPI-safe
43 echo '169.254.169.254 metadata.google.internal metadata' > \
47 cat << EOF > ${DESTDIR}/etc/ntp.conf
48 server metadata.google.internal iburst
50 restrict default kod nomodify notrap nopeer noquery
51 restrict -6 default kod nomodify notrap nopeer noquery
58 cat << EOF >> ${DESTDIR}/etc/syslog.conf
59 *.err;kern.warning;auth.notice;mail.crit /dev/console
62 cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config
63 ChallengeResponseAuthentication no
66 Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
67 AllowAgentForwarding no
68 ClientAliveInterval 420
71 cat << EOF >> ${DESTDIR}/etc/crontab
72 0 3 * * * root /usr/sbin/freebsd-update cron
75 cat << EOF >> ${DESTDIR}/etc/sysctl.conf
76 net.inet.icmp.drop_redirect=1
77 net.inet.ip.redirect=0
78 net.inet.tcp.blackhole=2
79 net.inet.udp.blackhole=1
80 kern.ipc.somaxconn=1024
81 debug.trace_on_panic=1
82 debug.debugger_on_panic=0
85 ## XXX: Verify this is needed. I do not see this requirement
86 ## in the docs, and it impairs the ability to boot-test a copy
87 ## of the image prior to packaging for upload to GCE.
88 #sed -E -i '' 's/^([^#].*[[:space:]])on/\1off/' ${DESTDIR}/etc/ttys
90 touch ${DESTDIR}/firstboot