Author: gjb
Date: Wed Dec 14 03:01:15 2016
New Revision: 310047
URL: https://svnweb.freebsd.org/changeset/base/310047

Log:
  - Resize FreeBSD to the size of the OpenStack flavor (growfs).
  - Speeds up the boot process by disabling sendmail.
  - Allows an user to ssh as root with a public key.
  - Make ssh(1) respond faster by disabling DNS lookups.
  - Enable DHCP on the vtnet(4) interface.
  
  Note: The CLOUDWARE list has not yet been changed to include the
  OpenStack target by default yet.
  
  Submitted by: Diego Casati
  PR:           215258
  MFC after:    1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/tools/openstack.conf

Modified: head/release/tools/openstack.conf
==============================================================================
--- head/release/tools/openstack.conf   Wed Dec 14 00:21:06 2016        
(r310046)
+++ head/release/tools/openstack.conf   Wed Dec 14 03:01:15 2016        
(r310047)
@@ -11,8 +11,25 @@ export VM_EXTRA_PACKAGES="net/cloud-init
 # Set to a list of third-party software to enable in rc.conf(5).
 export VM_RC_LIST="cloudinit"
 
+export NOSWAP=YES
+
 vm_extra_pre_umount() {
+       #Enable sshd by default
        echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+
+       # Disable DNS lookups by default to make SSH connect quickly
+       echo 'UseDNS no' >> ${DESTDIR}/etc/ssh/sshd_config
+
+       # Allow root to ssh using keys
+       echo 'PermitRootLogin without-password' >> 
${DESTDIR}/etc/ssh/sshd_config
+
+       # Disable sendmail
+       echo 'sendmail_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+       echo 'sendmail_submit_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+       echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+       echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf
+
+       # Enable DHCP for the OpenStack instance
        echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
 
        # Openstack wants sudo(8) usable by default without a password.
@@ -21,5 +38,15 @@ vm_extra_pre_umount() {
 
        rm -f ${DESTDIR}/etc/resolv.conf
 
+       # The console is not interactive, so we might as well boot quickly.
+       echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf
+       echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf
+
+       # Reboot quickly, Don't wait at the panic screen
+       echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf
+       echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf
+       echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf
+
+       touch ${DESTDIR}/firstboot
        return 0
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to