aboutsummaryrefslogtreecommitdiff
path: root/release/tools/vmimage.subr
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2014-11-21 01:53:40 +0000
committerColin Percival <cperciva@FreeBSD.org>2014-11-21 01:53:40 +0000
commit4e7bc9f0f7b329ce952e0faa4674d143ae2568ac (patch)
tree095848fbc0b45e0fd18c4ed38d78e4dae959d827 /release/tools/vmimage.subr
parent48096f81ed910e33371f0a2fb5212c06c9c707c4 (diff)
downloadsrc-4e7bc9f0f7b329ce952e0faa4674d143ae2568ac.tar.gz
src-4e7bc9f0f7b329ce952e0faa4674d143ae2568ac.zip
Add NOSWAP option which can be set by a vmimage.conf file to specify that
no swap space should be created in the image. This will be used by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral" disks which are physically attached to the Xen host node.
Notes
Notes: svn path=/projects/release-vmimage/; revision=274771
Diffstat (limited to 'release/tools/vmimage.subr')
-rw-r--r--release/tools/vmimage.subr13
1 files changed, 9 insertions, 4 deletions
diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index 3e1ddce66b14..c7805721d2a5 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -10,19 +10,22 @@ export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
trap "cleanup" INT QUIT TRAP ABRT TERM
write_partition_layout() {
+ if [ -z "${NOSWAP}" ]; then
+ SWAPOPT="-p freebsd-swap/swapfs::1G"
+ fi
case "${TARGET}:${TARGET_ARCH}" in
amd64:amd64 | i386:i386)
mkimg -s gpt -b /boot/pmbr \
-p freebsd-boot/bootfs:=/boot/gptboot \
- -p freebsd-swap/swapfs::1G \
+ ${SWAPOPT} \
-p freebsd-ufs/rootfs:=${VMBASE} \
-o ${VMIMAGE}
;;
powerpc:powerpc*)
mkimg -s apm \
-p apple-boot/bootfs:=/boot/boot1.hfs \
- -p freebsd-swap/swapfs::1G \
+ ${SWAPOPT} \
-p freebsd-ufs/rootfs:=${VMBASE} \
-o ${VMIMAGE}
;;
@@ -76,8 +79,10 @@ vm_install_base() {
> ${DESTDIR}/etc/fstab
echo '/dev/gpt/rootfs / ufs rw 1 1' \
>> ${DESTDIR}/etc/fstab
- echo '/dev/gpt/swapfs none swap sw 0 0' \
- >> ${DESTDIR}/etc/fstab
+ if [ -z "${NOSWAP}" ]; then
+ echo '/dev/gpt/swapfs none swap sw 0 0' \
+ >> ${DESTDIR}/etc/fstab
+ fi
mkdir -p ${DESTDIR}/dev
mount -t devfs devfs ${DESTDIR}/dev