Add 'cloudware-install' target to handle copying cloud

disk images to a directory within DESTDIR.

Add CLOUDINSTALL variable to automatically generate the
actual list of install targets.  While here, rename the
cloud-specific names from 'vm-' to 'cw-' to avoid naming
collisions.

Add AZURE_DISK, GCE_DISK, and OPENSTACK_DISK output file
variables.

Add 'cloudware-install' to the 'install' target.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
gjb 2015-02-24 21:06:25 +00:00
parent eca02d5385
commit 3bcf3bd6f0
2 changed files with 23 additions and 4 deletions

View File

@ -286,7 +286,7 @@ real-release:
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
install: release-install vm-install
install: release-install vm-install cloudware-install
release-install:
.if defined(DESTDIR) && !empty(DESTDIR)

View File

@ -20,24 +20,28 @@ CLOUDWARE?= AZURE \
OPENSTACK
AZURE_FORMAT= vhdf
AZURE_DESC= Microsoft Azure platform image
AZURE_DISK= ${OSRELEASE}.${AZURE_FORMAT}
GCE_FORMAT= raw
GCE_DESC= Google Compute Engine image
GCE_DISK= disk.${GCE_FORMAT}
OPENSTACK_FORMAT=qcow2
OPENSTACK_DESC= OpenStack platform image
OPENSTACK_DISK= ${OSRELEASE}.${OPENSTACK_FORMAT}
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
. for _CW in ${CLOUDWARE}
CLOUDTARGETS+= vm-${_CW:tl}
CLEANDIRS+= vm-${_CW:tl}
CLOUDTARGETS+= cw-${_CW:tl}
CLEANDIRS+= cw-${_CW:tl}
CLEANFILES+= ${_CW:tl}.img \
${_CW:tl}.${${_CW:tu}_FORMAT} \
${_CW:tl}.${${_CW:tu}_FORMAT}.raw
CLOUDINSTALL+= cw${_CW:tl}-install
${_CW:tu}IMAGE= ${_CW:tl}.${${_CW:tu}_FORMAT}
. if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF)
${_CW:tu}CONF?= ${.CURDIR}/tools/${_CW:tl}.conf
. endif
vm-${_CW:tl}:
cw-${_CW:tl}:
mkdir -p ${.OBJDIR}/${.TARGET}
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
${.CURDIR}/scripts/mk-vmimage.sh \
@ -45,6 +49,16 @@ vm-${_CW:tl}:
-i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \
-S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF}
touch ${.TARGET}
cw${_CW:tl}-install:
mkdir -p ${DESTDIR}/${_CW:tl}
cp -p ${${_CW}IMAGE} \
${DESTDIR}/${_CW:tl}/${${_CW}_DISK}
cd ${DESTDIR}/${_CW:tl} && sha256 ${${_CW}_DISK}* > \
${DESTDIR}/${_CW:tl}/CHECKSUM.SHA256
cd ${DESTDIR}/${_CW:tl} && md5 ${${_CW}_DISK}* > \
${DESTDIR}/${_CW:tl}/CHECKSUM.MD5
. endfor
.endif
@ -119,3 +133,8 @@ cloudware-release:
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS}
.endif
cloudware-install:
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL}
.endif