]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - release/tools/gce.conf
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / release / tools / gce.conf
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
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"
10
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"
14
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
19 }
20
21 vm_extra_pre_umount() {
22         cat << EOF >> ${DESTDIR}/etc/rc.conf
23 dumpdev="AUTO"
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"
29 EOF
30
31         cat << EOF >> ${DESTDIR}/boot/loader.conf
32 autoboot_delay="-1"
33 beastie_disable="YES"
34 loader_logo="none"
35 hw.memtest.tests="0"
36 console="comconsole,vidconsole"
37 hw.vtnet.mq_disable=1
38 kern.timecounter.hardware=ACPI-safe
39 aesni_load="YES"
40 nvme_load="YES"
41 EOF
42
43         echo '169.254.169.254 metadata.google.internal metadata' > \
44                 ${DESTDIR}/etc/hosts
45
46         # overwrite ntp.conf
47         cat << EOF > ${DESTDIR}/etc/ntp.conf
48 server metadata.google.internal iburst
49
50 restrict default kod nomodify notrap nopeer noquery
51 restrict -6 default kod nomodify notrap nopeer noquery
52
53 restrict 127.0.0.1
54 restrict -6 ::1
55 restrict 127.127.1.0
56 EOF
57
58         cat << EOF >> ${DESTDIR}/etc/syslog.conf
59 *.err;kern.warning;auth.notice;mail.crit                /dev/console
60 EOF
61
62         cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config
63 ChallengeResponseAuthentication no
64 X11Forwarding no
65 AcceptEnv LANG
66 Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
67 AllowAgentForwarding no
68 ClientAliveInterval 420
69 EOF
70
71         cat << EOF >> ${DESTDIR}/etc/crontab
72 0       3       *       *       *       root    /usr/sbin/freebsd-update cron
73 EOF
74
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
83 EOF
84
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
89
90         touch ${DESTDIR}/firstboot
91
92         return 0
93 }