svn commit: r346959 - in head/release: . tools

Glen Barber gjb at FreeBSD.org
Tue Apr 30 14:29:10 UTC 2019


Author: gjb
Date: Tue Apr 30 14:29:09 2019
New Revision: 346959
URL: https://svnweb.freebsd.org/changeset/base/346959

Log:
  Reduce the default image size for virtual machine disk images from
  30GB to 3GB.  The raw images can be resized using truncate(1), and
  other formats can be resized with tools included with other tools
  included with other hypervisors.
  
  Enable the growfs(8) rc(8) at firstboot if the disk was resized
  prior to booting the virtual machine for the first time.
  
  Discussed with:	several
  PR:		232313 (requested in other context)
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/Makefile.vm
  head/release/tools/gce.conf
  head/release/tools/vmimage.subr

Modified: head/release/Makefile.vm
==============================================================================
--- head/release/Makefile.vm	Tue Apr 30 10:41:20 2019	(r346958)
+++ head/release/Makefile.vm	Tue Apr 30 14:29:09 2019	(r346959)
@@ -7,7 +7,7 @@
 
 VMTARGETS=	vm-image
 VMFORMATS?=	vhd vmdk qcow2 raw
-VMSIZE?=	30G
+VMSIZE?=	3072M
 SWAPSIZE?=	1G
 VMBASE?=	vm
 

Modified: head/release/tools/gce.conf
==============================================================================
--- head/release/tools/gce.conf	Tue Apr 30 10:41:20 2019	(r346958)
+++ head/release/tools/gce.conf	Tue Apr 30 14:29:09 2019	(r346959)
@@ -3,9 +3,6 @@
 # $FreeBSD$
 #
 
-# Reduce VMSIZE to be below the free quota limit.
-export VMSIZE=27G
-
 # Set to a list of packages to install.
 export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \
 	google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \

Modified: head/release/tools/vmimage.subr
==============================================================================
--- head/release/tools/vmimage.subr	Tue Apr 30 10:41:20 2019	(r346958)
+++ head/release/tools/vmimage.subr	Tue Apr 30 14:29:09 2019	(r346959)
@@ -182,6 +182,9 @@ vm_extra_enable_services() {
 	if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then
 		echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \
 			${DESTDIR}/etc/rc.conf
+		# Expand the filesystem to fill the disk.
+		echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+		touch ${DESTDIR}/firstboot
 	fi
 
 	return 0


More information about the svn-src-head mailing list