From bcc2f353aeb761b9d904e9c98701fa493cdc5988 Mon Sep 17 00:00:00 2001 From: gjb Date: Tue, 30 Apr 2019 14:29:09 +0000 Subject: [PATCH] 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 --- release/Makefile.vm | 2 +- release/tools/gce.conf | 3 --- release/tools/vmimage.subr | 3 +++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index c7a1d1f0d1f..e42f9af7c9a 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 30G +VMSIZE?= 3072M SWAPSIZE?= 1G VMBASE?= vm diff --git a/release/tools/gce.conf b/release/tools/gce.conf index 3c33579dd77..c2aac884f78 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -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 \ diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index ff3d69f5ba4..6e29139402b 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -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 -- 2.45.0