Changeset View
Changeset View
Standalone View
Standalone View
release/tools/gce.conf
| Show All 15 Lines | export VM_RC_LIST="ntpd sshd growfs \ | ||||
| firstboot_pkgs firstboot_freebsd_update google_startup \ | firstboot_pkgs firstboot_freebsd_update google_startup \ | ||||
| google_accounts_daemon google_clock_skew_daemon \ | google_accounts_daemon google_clock_skew_daemon \ | ||||
| google_instance_setup google_network_daemon" | google_instance_setup google_network_daemon" | ||||
| vm_extra_install_base() { | vm_extra_install_base() { | ||||
| echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf | echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf | ||||
| echo 'nameserver 169.254.169.254' >> ${DESTDIR}/etc/resolv.conf | echo 'nameserver 169.254.169.254' >> ${DESTDIR}/etc/resolv.conf | ||||
| echo 'nameserver 8.8.8.8' >> ${DESTDIR}/etc/resolv.conf | echo 'nameserver 8.8.8.8' >> ${DESTDIR}/etc/resolv.conf | ||||
| metalog_add ./etc/resolv.conf | |||||
| } | } | ||||
| vm_extra_pre_umount() { | vm_extra_pre_umount() { | ||||
| local DEVFSISOURS | local DEVFSISOURS | ||||
| # Enable growfs on every boot, not only the first, as as instance's disk can | # Enable growfs on every boot, not only the first, as as instance's disk can | ||||
| # be enlarged post-creation | # be enlarged post-creation | ||||
| sed -i -e '/KEYWORD: firstboot/d' /etc/rc.d/growfs | sed -i -e '/KEYWORD: firstboot/d' /etc/rc.d/growfs | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
| debug.trace_on_panic=1 | debug.trace_on_panic=1 | ||||
| debug.debugger_on_panic=0 | debug.debugger_on_panic=0 | ||||
| EOF | EOF | ||||
| # To meet GCE marketplace requirements, extract the src.txz and | # To meet GCE marketplace requirements, extract the src.txz and | ||||
| # ports.txz distributions to the target virtual machine disk image | # ports.txz distributions to the target virtual machine disk image | ||||
| # and fetch the sources for the third-party software installed on | # and fetch the sources for the third-party software installed on | ||||
| # the image. | # the image. | ||||
| if [ ! -c "${DESTDIR}/dev/null" ]; then | |||||
| DEVFSISOURS=1 | |||||
| mkdir -p ${DESTDIR}/dev | |||||
| mount -t devfs devfs ${DESTDIR}/dev | |||||
| fi | |||||
| if [ -e "${DESTDIR}/../ftp/src.txz" ]; then | if [ -e "${DESTDIR}/../ftp/src.txz" ]; then | ||||
cperciva: Actually thinking about this a bit more -- the src.txz and ports.txz tarballs will go away at… | |||||
emasteUnsubmitted Done Inline ActionsI think it's reasonable to do that, but separately from this change. But, is the change here just fxJ to -xfJ? emaste: I think it's reasonable to do that, but separately from this change. But, is the change here… | |||||
cpercivaUnsubmitted Not Done Inline ActionsYeah I have no problem with that change happening later. Just thought about it while looking at these bits. cperciva: Yeah I have no problem with that change happening later. Just thought about it while looking… | |||||
| tar fxJ ${DESTDIR}/../ftp/src.txz -C ${DESTDIR} | tar -xfJ ${DESTDIR}/../ftp/ports.txz -C ${DESTDIR} | ||||
cpercivaUnsubmitted Done Inline Actionss/ports/src/ cperciva: s/ports/src/ | |||||
| fi | fi | ||||
| if [ -e "${DESTDIR}/../ftp/ports.txz" ]; then | if [ -e "${DESTDIR}/../ftp/ports.txz" ]; then | ||||
| tar fxJ ${DESTDIR}/../ftp/ports.txz -C ${DESTDIR} | tar fxJ ${DESTDIR}/../ftp/ports.txz -C ${DESTDIR} | ||||
| _INSTALLED_PACKAGES=$(chroot ${DESTDIR} pkg info -o -q -a) | _INSTALLED_PACKAGES=$(pkg -r ${DESTDIR} info -o -q -a) | ||||
| for PACKAGE in ${_INSTALLED_PACKAGES}; do | for PACKAGE in ${_INSTALLED_PACKAGES}; do | ||||
| chroot ${DESTDIR} \ | make -C ${DESTDIR}/usr/ports/${PACKAGE} fetch | ||||
cpercivaUnsubmitted Done Inline ActionsProbably want to set DISTDIR=${DESTDIR}/usr/ports/distfiles here just in case there's environmental pollution which would send the distfiles into the wrong place. cperciva: Probably want to set DISTDIR=${DESTDIR}/usr/ports/distfiles here just in case there's… | |||||
| make -C /usr/ports/${PACKAGE} fetch | |||||
| done | done | ||||
| fi | fi | ||||
| if [ "$DEVFSISOURS" = "1" ]; then | |||||
| umount_loop ${DESTDIR}/dev | |||||
| fi | |||||
| ## XXX: Verify this is needed. I do not see this requirement | ## XXX: Verify this is needed. I do not see this requirement | ||||
| ## in the docs, and it impairs the ability to boot-test a copy | ## in the docs, and it impairs the ability to boot-test a copy | ||||
| ## of the image prior to packaging for upload to GCE. | ## of the image prior to packaging for upload to GCE. | ||||
| #sed -E -i '' 's/^([^#].*[[:space:]])on/\1off/' ${DESTDIR}/etc/ttys | #sed -E -i '' 's/^([^#].*[[:space:]])on/\1off/' ${DESTDIR}/etc/ttys | ||||
| return 0 | return 0 | ||||
| } | } | ||||
| # Do everything except deleting resolv.conf since we construct our own | # Do everything except deleting resolv.conf since we construct our own | ||||
| # Googlized resolv.conf file in vm_extra_install_base. | # Googlized resolv.conf file in vm_extra_install_base. | ||||
| vm_emulation_cleanup() { | vm_emulation_cleanup() { | ||||
| if [ -n "${QEMUSTATIC}" ]; then | if [ -n "${QEMUSTATIC}" ]; then | ||||
| rm -f ${DESTDIR}/${EMULATOR} | rm -f ${DESTDIR}/${EMULATOR} | ||||
| fi | fi | ||||
| umount_loop ${DESTDIR}/dev | |||||
| return 0 | return 0 | ||||
| } | } | ||||
Actually thinking about this a bit more -- the src.txz and ports.txz tarballs will go away at some point with pkgbase. Can we copy the trees directly rather than going through those? (Obviously we have a src tree at this point; I'm not immediately sure if we're guaranteed to have a ports tree mounted when this code runs but that's probably easily achievable.)