summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2017-05-24 20:33:49 +0000
committernp <np@FreeBSD.org>2017-05-24 20:33:49 +0000
commitbebe42972e90165c4bcac6740d0a3ba5db81abe3 (patch)
treebcf0b3f86b683b69b5e26fe33e9fc08f4b463b1a
parent1c878f6dccad75e42cfea6ee8f5bd0a8514267e9 (diff)
downloadFreeBSD-src-bebe42972e90165c4bcac6740d0a3ba5db81abe3.zip
FreeBSD-src-bebe42972e90165c4bcac6740d0a3ba5db81abe3.tar.gz
MFC r307008:
Add the ability to override the size of the swap partition when building VM images. The default continues to be 1G. Sponsored by: Chelsio Communications
-rw-r--r--release/Makefile.vm1
-rw-r--r--release/tools/vmimage.subr2
2 files changed, 2 insertions, 1 deletions
diff --git a/release/Makefile.vm b/release/Makefile.vm
index 180ce5b..2308217 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 10619af..6c3916e 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)"
OpenPOWER on IntegriCloud