From eb46c98711f2f3f32ae564cc35bbdc3d2c28aeec Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Mon, 10 Oct 2016 22:36:44 +0000 Subject: [PATCH] Add the ability to override the size of the swap partition when building VM images. The default continues to be 1G. Reviewed by: gjb@ Sponsored by: Chelsio Communications --- release/Makefile.vm | 1 + release/tools/vmimage.subr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 9de384650cbf..1c6a1936058b 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -8,6 +8,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw VMSIZE?= 20G +SWAPSIZE?= 1G VMBASE?= vm VHD_DESC= Azure, VirtualPC, Hyper-V, Xen disk image diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index b5a8bf7c6a53..14ef7f106e30 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -11,7 +11,7 @@ trap "cleanup" INT QUIT TRAP ABRT TERM write_partition_layout() { if [ -z "${NOSWAP}" ]; then - SWAPOPT="-p freebsd-swap/swapfs::1G" + SWAPOPT="-p freebsd-swap/swapfs::${SWAPSIZE}" fi _OBJDIR="$(make -C ${WORLDDIR} -V .OBJDIR)"