aboutsummaryrefslogtreecommitdiff
path: root/release/Makefile.vm
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2014-11-05 13:22:19 +0000
committerGlen Barber <gjb@FreeBSD.org>2014-11-05 13:22:19 +0000
commit1e7c1f17428a0b342afd622fad341a389bed7a3f (patch)
tree6f87eab2bc67b1c4241bb8f9b509e3531dbbfb4f /release/Makefile.vm
parent21f93ded5aca3c7c2f41018ce2d700557f113779 (diff)
downloadsrc-1e7c1f17428a0b342afd622fad341a389bed7a3f.tar.gz
src-1e7c1f17428a0b342afd622fad341a389bed7a3f.zip
Initial rewrite to consolidate VM image build scripts into one.
There may be some very sharp edges here while refactoring. - Move amd64/mk-vmimage.sh -> scripts/mk-vmimage.sh. - Remove vm-base target from Makefile.vm. - In vm-image target, use getopts flags for argument passing. - Create tools/vmimage.subr, containing default and prototype for the following functions that are used to drive the build, run in this order: vm_install_base() vm_extra_install_base() vm_extra_install_packages() vm_extra_install_ports() vm_extra_enable_services() vm_extra_pre_umount() vm_create_disk() vm_extra_create_disk() - In tools/azure.conf, override: vm_extra_install_base() vm_extra_pre_umount() vm_extra_create_disk() - In tools/openstack.conf, override: vm_extra_install_base() vm_extra_pre_umount() Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/projects/release-vmimage/; revision=274134
Diffstat (limited to 'release/Makefile.vm')
-rw-r--r--release/Makefile.vm41
1 files changed, 18 insertions, 23 deletions
diff --git a/release/Makefile.vm b/release/Makefile.vm
index 73042f72bf23..c37a4ad759d6 100644
--- a/release/Makefile.vm
+++ b/release/Makefile.vm
@@ -5,7 +5,7 @@
# Makefile for building virtual machine and cloud provider disk images.
#
-VMTARGETS= vm-base vm-image
+VMTARGETS= vm-image
VMFORMATS?= vhd vmdk qcow2 raw
VMSIZE?= 20G
VMBASE?= vm
@@ -37,23 +37,17 @@ CLEANFILES+= ${VMBASE}.${FORMAT}
. endfor
.endif
-vm-base:
-.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
-. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
- env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
- ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
- ${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE}
-. endif
-.endif
- touch ${.TARGET}
+vm-base: vm-image
-vm-image: vm-base
+vm-image:
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
. for FORMAT in ${VMFORMATS}
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
- ${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
- ${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT}
+ ${.CURDIR}/${TARGET}/mk-vmimage.sh \
+ -C ${.CURDIR}/tools/vmimage.subr -d ${.TARGET} \
+ -i ${VMBASE}.img -s ${VMSIZE} -f ${FORMAT} \
+ -S ${WORLDDIR} -o ${VMBASE}.${FORMAT}
. endfor
. endif
.endif
@@ -62,20 +56,21 @@ vm-image: vm-base
vm-cloudware: ${CLOUDTARGETS}
vm-azure:
-.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
- env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \
- AZURE_FORMAT=${AZURE_FORMAT} \
- ${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \
- ${WORLDDIR} ${.TARGET} ${VMSIZE} ${AZUREIMAGE}
+.if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
+ env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+ ${.CURDIR}/${TARGET}/mk-vmimage.sh \
+ -C ${.CURDIR}/tools/vmimage.subr -d ${.TARGET} \
+ -i azure.img -s ${VMSIZE} -f ${AZURE_FORMAT} \
+ -S ${WORLDDIR} -o ${AZUREIMAGE} -c ${AZURECONF}
.endif
touch ${.TARGET}
vm-openstack:
-.if exists(${.CURDIR}/${TARGET}/mk-openstack.sh)
+.if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
- OPENSTACKCONF=${OPENSTACKCONF} \
- OPENSTACK_FORMAT=${OPENSTACK_FORMAT} \
- ${.CURDIR}/${TARGET}/mk-openstack.sh ${.TARGET} openstack.img \
- ${WORLDDIR} ${.TARGET} ${VMSIZE} ${OPENSTACKIMAGE}
+ ${.CURDIR}/${TARGET}/mk-vmimage.sh \
+ -C ${.CURDIR}/tools/vmimage.subr -d ${.TARGET} \
+ -i openstack.img -s ${VMSIZE} -f ${OPENSTACK_FORMAT} \
+ -S ${WORLDDIR} -o ${OPENSTACKIMAGE} -c ${OPENSTACKCONF}
.endif
touch ${.TARGET}