2014-10-29 14:57:30 +00:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Makefile for building virtual machine and cloud provider disk images.
|
|
|
|
#
|
|
|
|
|
2014-11-05 13:22:19 +00:00
|
|
|
VMTARGETS= vm-image
|
2014-10-29 14:57:30 +00:00
|
|
|
VMFORMATS?= vhd vmdk qcow2 raw
|
2018-02-26 19:26:59 +00:00
|
|
|
VMSIZE?= 30G
|
2016-10-10 22:36:44 +00:00
|
|
|
SWAPSIZE?= 1G
|
2014-10-29 14:57:30 +00:00
|
|
|
VMBASE?= vm
|
2014-10-29 15:52:17 +00:00
|
|
|
|
2015-01-16 17:40:30 +00:00
|
|
|
VHD_DESC= Azure, VirtualPC, Hyper-V, Xen disk image
|
|
|
|
VMDK_DESC= VMWare, VirtualBox disk image
|
|
|
|
QCOW2_DESC= Qemu, KVM disk image
|
|
|
|
RAW_DESC= Unformatted raw disk image
|
|
|
|
|
2016-05-26 18:24:00 +00:00
|
|
|
CLOUDWARE?= EC2 \
|
2015-01-16 19:27:19 +00:00
|
|
|
GCE \
|
2015-07-20 16:27:44 +00:00
|
|
|
VAGRANT-VIRTUALBOX \
|
|
|
|
VAGRANT-VMWARE
|
2014-10-29 16:18:29 +00:00
|
|
|
AZURE_FORMAT= vhdf
|
2015-01-16 17:05:35 +00:00
|
|
|
AZURE_DESC= Microsoft Azure platform image
|
2015-02-24 21:06:25 +00:00
|
|
|
AZURE_DISK= ${OSRELEASE}.${AZURE_FORMAT}
|
2015-03-31 01:28:33 +00:00
|
|
|
EC2_FORMAT= raw
|
|
|
|
EC2_DESC= Amazon EC2 image
|
|
|
|
EC2_DISK= ${OSRELEASE}.${EC2_FORMAT}
|
2015-01-16 19:27:19 +00:00
|
|
|
GCE_FORMAT= raw
|
|
|
|
GCE_DESC= Google Compute Engine image
|
2015-02-24 21:06:25 +00:00
|
|
|
GCE_DISK= disk.${GCE_FORMAT}
|
2014-10-29 17:04:09 +00:00
|
|
|
OPENSTACK_FORMAT=qcow2
|
2015-01-16 17:05:35 +00:00
|
|
|
OPENSTACK_DESC= OpenStack platform image
|
2015-02-24 21:06:25 +00:00
|
|
|
OPENSTACK_DISK= ${OSRELEASE}.${OPENSTACK_FORMAT}
|
2015-07-20 16:27:44 +00:00
|
|
|
VAGRANT-VIRTUALBOX_FORMAT= vmdk
|
|
|
|
VAGRANT-VIRTUALBOX_DESC= Vagrant Image for VirtualBox
|
|
|
|
VAGRANT-VIRTUALBOX_DISK= ${OSRELEASE}.vbox.${VAGRANT_FORMAT}
|
|
|
|
VAGRANT-VMWARE_FORMAT= vmdk
|
|
|
|
VAGRANT-VMWARE_DESC= Vagrant Image for VMWare
|
|
|
|
VAGRANT-VMWARE_DISK= ${OSRELEASE}.vmware.${VAGRANT_FORMAT}
|
2014-10-29 15:52:17 +00:00
|
|
|
|
|
|
|
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
|
|
|
|
. for _CW in ${CLOUDWARE}
|
2015-02-24 21:06:25 +00:00
|
|
|
CLOUDTARGETS+= cw-${_CW:tl}
|
|
|
|
CLEANDIRS+= cw-${_CW:tl}
|
2014-10-29 15:52:17 +00:00
|
|
|
CLEANFILES+= ${_CW:tl}.img \
|
|
|
|
${_CW:tl}.${${_CW:tu}_FORMAT} \
|
2015-02-24 22:27:02 +00:00
|
|
|
${_CW:tl}.${${_CW:tu}_FORMAT}.raw \
|
|
|
|
cw${_CW:tl}-package
|
|
|
|
CLOUDPACKAGE+= cw${_CW:tl}-package
|
2014-10-29 16:18:29 +00:00
|
|
|
${_CW:tu}IMAGE= ${_CW:tl}.${${_CW:tu}_FORMAT}
|
2014-10-29 15:52:17 +00:00
|
|
|
. if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF)
|
|
|
|
${_CW:tu}CONF?= ${.CURDIR}/tools/${_CW:tl}.conf
|
|
|
|
. endif
|
2014-11-20 03:46:35 +00:00
|
|
|
|
2015-02-24 21:06:25 +00:00
|
|
|
cw-${_CW:tl}:
|
2014-11-20 03:46:35 +00:00
|
|
|
mkdir -p ${.OBJDIR}/${.TARGET}
|
2016-11-16 18:08:50 +00:00
|
|
|
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \
|
2014-11-20 03:46:35 +00:00
|
|
|
${.CURDIR}/scripts/mk-vmimage.sh \
|
|
|
|
-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
|
2017-01-31 19:09:06 +00:00
|
|
|
-i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW:tu}_FORMAT} \
|
2017-06-06 14:08:54 +00:00
|
|
|
-S ${WORLDDIR} -o ${.OBJDIR}/${${_CW:tu}IMAGE} -c ${${_CW:tu}CONF}
|
2014-11-20 03:46:35 +00:00
|
|
|
touch ${.TARGET}
|
2015-02-24 21:06:25 +00:00
|
|
|
|
2015-02-24 22:27:02 +00:00
|
|
|
cw${_CW:tl}-package:
|
|
|
|
@# Special target to handle packaging cloud images in the formats
|
|
|
|
@# specific to each hosting provider.
|
|
|
|
.if exists(${.CURDIR}/tools/${_CW:tl}-package.sh)
|
|
|
|
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
|
|
|
${.CURDIR}/tools/${_CW:tl}-package.sh \
|
|
|
|
-D ${DESTDIR} -I ${${_CW}_DISK} -S ${WORLDDIR}
|
|
|
|
.endif
|
|
|
|
touch ${.TARGET}
|
|
|
|
|
2014-10-29 15:52:17 +00:00
|
|
|
. endfor
|
|
|
|
.endif
|
2014-10-29 14:57:30 +00:00
|
|
|
|
|
|
|
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
|
|
|
|
CLEANDIRS+= ${VMTARGETS}
|
|
|
|
. for FORMAT in ${VMFORMATS}
|
2015-01-23 21:04:59 +00:00
|
|
|
CLEANFILES+= ${FORMAT}.img
|
2014-10-29 14:57:30 +00:00
|
|
|
CLEANFILES+= ${VMBASE}.${FORMAT}
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2014-11-05 13:22:19 +00:00
|
|
|
vm-base: vm-image
|
2014-10-29 14:57:30 +00:00
|
|
|
|
2014-11-05 13:22:19 +00:00
|
|
|
vm-image:
|
2014-10-29 14:57:30 +00:00
|
|
|
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
|
2014-11-08 16:44:45 +00:00
|
|
|
. for FORMAT in ${VMFORMATS}
|
2014-11-08 12:45:35 +00:00
|
|
|
mkdir -p ${.OBJDIR}/${.TARGET}
|
2016-11-17 20:34:08 +00:00
|
|
|
env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} SWAPSIZE=${SWAPSIZE} \
|
2014-11-08 16:44:45 +00:00
|
|
|
${.CURDIR}/scripts/mk-vmimage.sh \
|
2014-11-08 12:45:35 +00:00
|
|
|
-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
|
2015-01-23 21:04:59 +00:00
|
|
|
-i ${.OBJDIR}/${FORMAT}.img -s ${VMSIZE} -f ${FORMAT} \
|
2014-11-08 16:44:45 +00:00
|
|
|
-S ${WORLDDIR} -o ${.OBJDIR}/${VMBASE}.${FORMAT}
|
|
|
|
. endfor
|
2014-10-29 14:57:30 +00:00
|
|
|
.endif
|
|
|
|
touch ${.TARGET}
|
|
|
|
|
2014-11-03 23:59:53 +00:00
|
|
|
vm-cloudware: ${CLOUDTARGETS}
|
|
|
|
|
2015-01-16 17:40:30 +00:00
|
|
|
list-vmtargets: list-cloudware
|
|
|
|
@${ECHO}
|
|
|
|
@${ECHO} "Supported virtual machine disk image formats:"
|
|
|
|
.for FORMAT in ${VMFORMATS:tu}
|
|
|
|
@${ECHO} " ${FORMAT:tl}: ${${FORMAT}_DESC}"
|
|
|
|
.endfor
|
|
|
|
|
2015-01-16 17:05:35 +00:00
|
|
|
list-cloudware:
|
|
|
|
.if !empty(CLOUDWARE)
|
2015-01-16 17:40:30 +00:00
|
|
|
@${ECHO}
|
|
|
|
@${ECHO} "Supported cloud hosting provider images:"
|
2015-01-16 17:05:35 +00:00
|
|
|
. for _CW in ${CLOUDWARE}
|
2015-01-16 17:40:30 +00:00
|
|
|
@${ECHO} " ${_CW:tu}: ${${_CW:tu}_DESC}"
|
2015-01-16 17:05:35 +00:00
|
|
|
. endfor
|
2014-10-29 14:57:30 +00:00
|
|
|
.endif
|
2014-10-29 17:04:09 +00:00
|
|
|
|
Merge the following revisions from ^/projects/release-vmimage:
r273823-r273826, r273833, r273836, r273944, r274069-r274071,
r274134, r274211, r274280-r274285, r274287-r274288, r274292,
r274296-r274297, r274356, r274533, r274725, r274726, r274729,
r274734, r274771, r274945-r274946, r277180, r277183-r277184,
r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384,
r277393-r277395, r277438-r277439, r277447, r277455:
r273823:
Move virtual machine / cloud provider targets and
options from release/Makefile to their own Makefile.
r273824:
Add glue to allow enabling building cloud provider VM images
by default.
When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the
release/Makefile 'release' target.
r273825:
Avoid hard-coding the Azure image file format. While here,
avoid using OSRELEASE for the output file name.
r273826:
Remove a few vestiges of passing an exit code to panic().
r273833:
Initial commit providing a mechanism to create openstack images
as part of the release build.
r273836:
Fix output file name for openstack images. No further conversion
is necessary for this VM file target, so there is no need to append
the '.raw' suffix here.
r273944:
Uncomment the cloudinit rc.conf(5) line.
r274069:
Add line continuation so OPENSTACKCONF is actually included in the env(1).
r274070:
Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS.
r274071:
Add examples for WITH_CLOUDWARE to release.conf.sample.
Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.
r274134:
Initial rewrite to consolidate VM image build scripts into one.
r274211:
Add write_partition_layout() used to populate the final image.
Fix duplicated mkimg(1) call in vm_create_disk().
Add primitive (untested) PowerPC/PowerPC64 VM image support.
Note: As it is currently written, the /boot/pmbr and
/boot/{gptboot,boot1.hfs} use the build host and not the target
build. Fixing this is likely going to be a hack in itself.
r274280:
Return if vm_create_disk() is unsuccessful.
r274281:
Add CLEANFILES entry for VM targets
r274282:
Add vm_extra_pre_umount() prototype to vmimage.subr.
r274283:
Fix DESTDIR for installworld, and make sure it is created before use.
r274284:
Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr
has not been sourced.
r274285:
Spell 'OPTARG' correctly. Actually call vm_create_base().
r274287:
Fix line continuation in write_partition_layout().
Remove variable test that is no longer needed.
r274288:
Fix scheme flag to mkimg(1).
r274292:
mount(8) and umount(8) devfs(5) as needed.
r274296:
Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
it is consolidated into one file.
Fix paths for the base image and output disk image files.
r274297:
Call cleanup() after everything is done.
r274356:
Remove a stray directory from CLEANFILES.
r274533:
Set the boot partition type to 'apple-boot' for powerpc.
r274725:
In vm_install_base(), copy the host resolv.conf into
the build chroot before attempting to do anything that
requires working DNS (i.e., pkg bootstrap).
In vm_extra_pre_umount(), remove the resolv.conf before
the disk image is unmounted from the backing md(4).
r274726 (cperciva):
Silence errors when umounting the chroot's /dev, since it
probably doesn't exist when we're running this.
Unmount filesystems before attempting to destroy the md which
holds them.
r274729 (cperciva):
Unmount filesystem and destroy md before we read the vnode from
disk and package it into a disk image. Otherwise we end up
packaging an unclean filesystem.
r274734 (cperciva):
Merge duplicative vm-CLOUDTYPE targets before additional duplication
gets added by the impending arrival of ec2 and gcloud.
r274771 (cperciva):
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.
r274945:
In vm_extra_install_packages(), only bootstrap pkg(8) if
VM_EXTRA_PACKAGES is empty.
In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
bootstrapped earlier.
r274946:
Fix indentation nit.
r277180:
In vm_extra_install_base(), do not install waagent in the openstack
image, because it is not used. This appears to be a copy mistake.
Remove vm_extra_install_base() from the openstack.conf entirely,
since it does not need to be overridden.
r277183:
Enable the textmode console by default for VM images, since there is
no way to tell if the environment will be able to use the
graphics-mode console.
r277184:
Enable password-less sudo for openstack images.
r277186:
Update the VM_EXTRA_PACKAGES list for the openstack images.
The documentation suggests doing a "just fetch this and run it"-style
bootstrap, from which the list of dependencies was obtained (in
github, at: pellaeon/bsd-cloudinit-installer)
There is one Python dependency unmet, oslo.config, which is not in
the Ports Collection.
r277187:
Add a comment to note that setting hw.vga.textmode=1 is temporary.
r277250:
Remove vm_extra_install_base() for the Azure image, now that the
waagent exists in the ports tree.
Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.
In vm_extra_pre_umount(), remove the explicit pkg(8) install
list, as dependencies are resolved by sysutils/azure-agent.
r277251:
Add a 'list-cloudware' target to print the list of supported CLOUDWARE
values and a description.
Add the AZURE_DESC and OPENSTACK_DESC descriptions.
r277252:
Update release(7)
r277253:
Add 'list-vmtargets' target, which produces a list of all supported
VM and cloud provider images.
Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.
Format the output to make a bit more readable.
Update release(7) to document the list-vmtargets target.
r277263:
Add initial support for the GCE (Google Compute Engine) cloud hosting
provider image.
r277264:
Style and line length cleanup.
r277383:
Remove the console setting from rc.conf(5), which is not used there.
While here, set console to include vidconsole in the loader.conf(5).
r277384:
Fix an indentation nit.
No functional changes.
r277393:
Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
function is often overridden.
Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
code.
r277394:
Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
belongs.
The GCE image needs resolv.conf(5) to exist (created as part of the
image setup), so it cannot be removed.
r277395:
Comment the line that configures ttys(5) to 'off', which makes it
impossible to test that the image boots.
Add a note explaining why the line is commented, and not (yet) removed
entirely.
r277438:
Move the 'install' bits that are specific to virtual machine images
from the Makefile to Makefile.vm.
Rename the 'install' target to 'release-install', and add a new
'vm-install' target.
Add a new 'install' target that invokes the new targets.
r277439:
Add WITH_CLOUDWARE to the list of make(1) variables for the release
build.
r277447:
Remove hw.vga.textmode=1 from the VM image loader.conf, which was
included during test builds and not intended to be included when
merging this project branch back to head.
r277455:
Remove mk-azure.sh, which is no longer needed.
MFC after: 1 month
X-MFC-To: stable/10 (requires mkimg(1))
Help from: cperciva, swills
Relnotes: yes
Sponsored by: The FreeBSD Foundation
2015-01-20 23:56:04 +00:00
|
|
|
vm-install:
|
2014-10-29 14:57:30 +00:00
|
|
|
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
|
Merge the following revisions from ^/projects/release-vmimage:
r273823-r273826, r273833, r273836, r273944, r274069-r274071,
r274134, r274211, r274280-r274285, r274287-r274288, r274292,
r274296-r274297, r274356, r274533, r274725, r274726, r274729,
r274734, r274771, r274945-r274946, r277180, r277183-r277184,
r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384,
r277393-r277395, r277438-r277439, r277447, r277455:
r273823:
Move virtual machine / cloud provider targets and
options from release/Makefile to their own Makefile.
r273824:
Add glue to allow enabling building cloud provider VM images
by default.
When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the
release/Makefile 'release' target.
r273825:
Avoid hard-coding the Azure image file format. While here,
avoid using OSRELEASE for the output file name.
r273826:
Remove a few vestiges of passing an exit code to panic().
r273833:
Initial commit providing a mechanism to create openstack images
as part of the release build.
r273836:
Fix output file name for openstack images. No further conversion
is necessary for this VM file target, so there is no need to append
the '.raw' suffix here.
r273944:
Uncomment the cloudinit rc.conf(5) line.
r274069:
Add line continuation so OPENSTACKCONF is actually included in the env(1).
r274070:
Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS.
r274071:
Add examples for WITH_CLOUDWARE to release.conf.sample.
Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.
r274134:
Initial rewrite to consolidate VM image build scripts into one.
r274211:
Add write_partition_layout() used to populate the final image.
Fix duplicated mkimg(1) call in vm_create_disk().
Add primitive (untested) PowerPC/PowerPC64 VM image support.
Note: As it is currently written, the /boot/pmbr and
/boot/{gptboot,boot1.hfs} use the build host and not the target
build. Fixing this is likely going to be a hack in itself.
r274280:
Return if vm_create_disk() is unsuccessful.
r274281:
Add CLEANFILES entry for VM targets
r274282:
Add vm_extra_pre_umount() prototype to vmimage.subr.
r274283:
Fix DESTDIR for installworld, and make sure it is created before use.
r274284:
Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr
has not been sourced.
r274285:
Spell 'OPTARG' correctly. Actually call vm_create_base().
r274287:
Fix line continuation in write_partition_layout().
Remove variable test that is no longer needed.
r274288:
Fix scheme flag to mkimg(1).
r274292:
mount(8) and umount(8) devfs(5) as needed.
r274296:
Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
it is consolidated into one file.
Fix paths for the base image and output disk image files.
r274297:
Call cleanup() after everything is done.
r274356:
Remove a stray directory from CLEANFILES.
r274533:
Set the boot partition type to 'apple-boot' for powerpc.
r274725:
In vm_install_base(), copy the host resolv.conf into
the build chroot before attempting to do anything that
requires working DNS (i.e., pkg bootstrap).
In vm_extra_pre_umount(), remove the resolv.conf before
the disk image is unmounted from the backing md(4).
r274726 (cperciva):
Silence errors when umounting the chroot's /dev, since it
probably doesn't exist when we're running this.
Unmount filesystems before attempting to destroy the md which
holds them.
r274729 (cperciva):
Unmount filesystem and destroy md before we read the vnode from
disk and package it into a disk image. Otherwise we end up
packaging an unclean filesystem.
r274734 (cperciva):
Merge duplicative vm-CLOUDTYPE targets before additional duplication
gets added by the impending arrival of ec2 and gcloud.
r274771 (cperciva):
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.
r274945:
In vm_extra_install_packages(), only bootstrap pkg(8) if
VM_EXTRA_PACKAGES is empty.
In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
bootstrapped earlier.
r274946:
Fix indentation nit.
r277180:
In vm_extra_install_base(), do not install waagent in the openstack
image, because it is not used. This appears to be a copy mistake.
Remove vm_extra_install_base() from the openstack.conf entirely,
since it does not need to be overridden.
r277183:
Enable the textmode console by default for VM images, since there is
no way to tell if the environment will be able to use the
graphics-mode console.
r277184:
Enable password-less sudo for openstack images.
r277186:
Update the VM_EXTRA_PACKAGES list for the openstack images.
The documentation suggests doing a "just fetch this and run it"-style
bootstrap, from which the list of dependencies was obtained (in
github, at: pellaeon/bsd-cloudinit-installer)
There is one Python dependency unmet, oslo.config, which is not in
the Ports Collection.
r277187:
Add a comment to note that setting hw.vga.textmode=1 is temporary.
r277250:
Remove vm_extra_install_base() for the Azure image, now that the
waagent exists in the ports tree.
Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.
In vm_extra_pre_umount(), remove the explicit pkg(8) install
list, as dependencies are resolved by sysutils/azure-agent.
r277251:
Add a 'list-cloudware' target to print the list of supported CLOUDWARE
values and a description.
Add the AZURE_DESC and OPENSTACK_DESC descriptions.
r277252:
Update release(7)
r277253:
Add 'list-vmtargets' target, which produces a list of all supported
VM and cloud provider images.
Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.
Format the output to make a bit more readable.
Update release(7) to document the list-vmtargets target.
r277263:
Add initial support for the GCE (Google Compute Engine) cloud hosting
provider image.
r277264:
Style and line length cleanup.
r277383:
Remove the console setting from rc.conf(5), which is not used there.
While here, set console to include vidconsole in the loader.conf(5).
r277384:
Fix an indentation nit.
No functional changes.
r277393:
Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
function is often overridden.
Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
code.
r277394:
Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
belongs.
The GCE image needs resolv.conf(5) to exist (created as part of the
image setup), so it cannot be removed.
r277395:
Comment the line that configures ttys(5) to 'off', which makes it
impossible to test that the image boots.
Add a note explaining why the line is commented, and not (yet) removed
entirely.
r277438:
Move the 'install' bits that are specific to virtual machine images
from the Makefile to Makefile.vm.
Rename the 'install' target to 'release-install', and add a new
'vm-install' target.
Add a new 'install' target that invokes the new targets.
r277439:
Add WITH_CLOUDWARE to the list of make(1) variables for the release
build.
r277447:
Remove hw.vga.textmode=1 from the VM image loader.conf, which was
included during test builds and not intended to be included when
merging this project branch back to head.
r277455:
Remove mk-azure.sh, which is no longer needed.
MFC after: 1 month
X-MFC-To: stable/10 (requires mkimg(1))
Help from: cperciva, swills
Relnotes: yes
Sponsored by: The FreeBSD Foundation
2015-01-20 23:56:04 +00:00
|
|
|
mkdir -p ${DESTDIR}/vmimages
|
|
|
|
. for FORMAT in ${VMFORMATS}
|
|
|
|
cp -p ${VMBASE}.${FORMAT} \
|
|
|
|
${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
|
|
|
|
. endfor
|
|
|
|
. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES)
|
2014-10-29 14:57:30 +00:00
|
|
|
. for FORMAT in ${VMFORMATS}
|
Merge the following revisions from ^/projects/release-vmimage:
r273823-r273826, r273833, r273836, r273944, r274069-r274071,
r274134, r274211, r274280-r274285, r274287-r274288, r274292,
r274296-r274297, r274356, r274533, r274725, r274726, r274729,
r274734, r274771, r274945-r274946, r277180, r277183-r277184,
r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384,
r277393-r277395, r277438-r277439, r277447, r277455:
r273823:
Move virtual machine / cloud provider targets and
options from release/Makefile to their own Makefile.
r273824:
Add glue to allow enabling building cloud provider VM images
by default.
When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the
release/Makefile 'release' target.
r273825:
Avoid hard-coding the Azure image file format. While here,
avoid using OSRELEASE for the output file name.
r273826:
Remove a few vestiges of passing an exit code to panic().
r273833:
Initial commit providing a mechanism to create openstack images
as part of the release build.
r273836:
Fix output file name for openstack images. No further conversion
is necessary for this VM file target, so there is no need to append
the '.raw' suffix here.
r273944:
Uncomment the cloudinit rc.conf(5) line.
r274069:
Add line continuation so OPENSTACKCONF is actually included in the env(1).
r274070:
Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS.
r274071:
Add examples for WITH_CLOUDWARE to release.conf.sample.
Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.
r274134:
Initial rewrite to consolidate VM image build scripts into one.
r274211:
Add write_partition_layout() used to populate the final image.
Fix duplicated mkimg(1) call in vm_create_disk().
Add primitive (untested) PowerPC/PowerPC64 VM image support.
Note: As it is currently written, the /boot/pmbr and
/boot/{gptboot,boot1.hfs} use the build host and not the target
build. Fixing this is likely going to be a hack in itself.
r274280:
Return if vm_create_disk() is unsuccessful.
r274281:
Add CLEANFILES entry for VM targets
r274282:
Add vm_extra_pre_umount() prototype to vmimage.subr.
r274283:
Fix DESTDIR for installworld, and make sure it is created before use.
r274284:
Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr
has not been sourced.
r274285:
Spell 'OPTARG' correctly. Actually call vm_create_base().
r274287:
Fix line continuation in write_partition_layout().
Remove variable test that is no longer needed.
r274288:
Fix scheme flag to mkimg(1).
r274292:
mount(8) and umount(8) devfs(5) as needed.
r274296:
Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
it is consolidated into one file.
Fix paths for the base image and output disk image files.
r274297:
Call cleanup() after everything is done.
r274356:
Remove a stray directory from CLEANFILES.
r274533:
Set the boot partition type to 'apple-boot' for powerpc.
r274725:
In vm_install_base(), copy the host resolv.conf into
the build chroot before attempting to do anything that
requires working DNS (i.e., pkg bootstrap).
In vm_extra_pre_umount(), remove the resolv.conf before
the disk image is unmounted from the backing md(4).
r274726 (cperciva):
Silence errors when umounting the chroot's /dev, since it
probably doesn't exist when we're running this.
Unmount filesystems before attempting to destroy the md which
holds them.
r274729 (cperciva):
Unmount filesystem and destroy md before we read the vnode from
disk and package it into a disk image. Otherwise we end up
packaging an unclean filesystem.
r274734 (cperciva):
Merge duplicative vm-CLOUDTYPE targets before additional duplication
gets added by the impending arrival of ec2 and gcloud.
r274771 (cperciva):
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.
r274945:
In vm_extra_install_packages(), only bootstrap pkg(8) if
VM_EXTRA_PACKAGES is empty.
In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
bootstrapped earlier.
r274946:
Fix indentation nit.
r277180:
In vm_extra_install_base(), do not install waagent in the openstack
image, because it is not used. This appears to be a copy mistake.
Remove vm_extra_install_base() from the openstack.conf entirely,
since it does not need to be overridden.
r277183:
Enable the textmode console by default for VM images, since there is
no way to tell if the environment will be able to use the
graphics-mode console.
r277184:
Enable password-less sudo for openstack images.
r277186:
Update the VM_EXTRA_PACKAGES list for the openstack images.
The documentation suggests doing a "just fetch this and run it"-style
bootstrap, from which the list of dependencies was obtained (in
github, at: pellaeon/bsd-cloudinit-installer)
There is one Python dependency unmet, oslo.config, which is not in
the Ports Collection.
r277187:
Add a comment to note that setting hw.vga.textmode=1 is temporary.
r277250:
Remove vm_extra_install_base() for the Azure image, now that the
waagent exists in the ports tree.
Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.
In vm_extra_pre_umount(), remove the explicit pkg(8) install
list, as dependencies are resolved by sysutils/azure-agent.
r277251:
Add a 'list-cloudware' target to print the list of supported CLOUDWARE
values and a description.
Add the AZURE_DESC and OPENSTACK_DESC descriptions.
r277252:
Update release(7)
r277253:
Add 'list-vmtargets' target, which produces a list of all supported
VM and cloud provider images.
Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.
Format the output to make a bit more readable.
Update release(7) to document the list-vmtargets target.
r277263:
Add initial support for the GCE (Google Compute Engine) cloud hosting
provider image.
r277264:
Style and line length cleanup.
r277383:
Remove the console setting from rc.conf(5), which is not used there.
While here, set console to include vidconsole in the loader.conf(5).
r277384:
Fix an indentation nit.
No functional changes.
r277393:
Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
function is often overridden.
Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
code.
r277394:
Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
belongs.
The GCE image needs resolv.conf(5) to exist (created as part of the
image setup), so it cannot be removed.
r277395:
Comment the line that configures ttys(5) to 'off', which makes it
impossible to test that the image boots.
Add a note explaining why the line is commented, and not (yet) removed
entirely.
r277438:
Move the 'install' bits that are specific to virtual machine images
from the Makefile to Makefile.vm.
Rename the 'install' target to 'release-install', and add a new
'vm-install' target.
Add a new 'install' target that invokes the new targets.
r277439:
Add WITH_CLOUDWARE to the list of make(1) variables for the release
build.
r277447:
Remove hw.vga.textmode=1 from the VM image loader.conf, which was
included during test builds and not intended to be included when
merging this project branch back to head.
r277455:
Remove mk-azure.sh, which is no longer needed.
MFC after: 1 month
X-MFC-To: stable/10 (requires mkimg(1))
Help from: cperciva, swills
Relnotes: yes
Sponsored by: The FreeBSD Foundation
2015-01-20 23:56:04 +00:00
|
|
|
# Don't keep the originals. There is a copy in ${.OBJDIR} if needed.
|
2015-02-17 23:13:45 +00:00
|
|
|
${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
|
2014-10-29 14:57:30 +00:00
|
|
|
. endfor
|
|
|
|
. endif
|
2015-10-14 22:33:11 +00:00
|
|
|
cd ${DESTDIR}/vmimages && sha512 ${OSRELEASE}* > \
|
|
|
|
${DESTDIR}/vmimages/CHECKSUM.SHA512
|
Merge the following revisions from ^/projects/release-vmimage:
r273823-r273826, r273833, r273836, r273944, r274069-r274071,
r274134, r274211, r274280-r274285, r274287-r274288, r274292,
r274296-r274297, r274356, r274533, r274725, r274726, r274729,
r274734, r274771, r274945-r274946, r277180, r277183-r277184,
r277186-r277187, r277250-r277253, r277263-r277264, r277383-r277384,
r277393-r277395, r277438-r277439, r277447, r277455:
r273823:
Move virtual machine / cloud provider targets and
options from release/Makefile to their own Makefile.
r273824:
Add glue to allow enabling building cloud provider VM images
by default.
When WITH_CLOUDWARE is not empty, add CLOUDTARGETS to the
release/Makefile 'release' target.
r273825:
Avoid hard-coding the Azure image file format. While here,
avoid using OSRELEASE for the output file name.
r273826:
Remove a few vestiges of passing an exit code to panic().
r273833:
Initial commit providing a mechanism to create openstack images
as part of the release build.
r273836:
Fix output file name for openstack images. No further conversion
is necessary for this VM file target, so there is no need to append
the '.raw' suffix here.
r273944:
Uncomment the cloudinit rc.conf(5) line.
r274069:
Add line continuation so OPENSTACKCONF is actually included in the env(1).
r274070:
Add a 'vm-cloudware' target, used to drive all targets in CLOUDTARGETS.
r274071:
Add examples for WITH_CLOUDWARE to release.conf.sample.
Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.
r274134:
Initial rewrite to consolidate VM image build scripts into one.
r274211:
Add write_partition_layout() used to populate the final image.
Fix duplicated mkimg(1) call in vm_create_disk().
Add primitive (untested) PowerPC/PowerPC64 VM image support.
Note: As it is currently written, the /boot/pmbr and
/boot/{gptboot,boot1.hfs} use the build host and not the target
build. Fixing this is likely going to be a hack in itself.
r274280:
Return if vm_create_disk() is unsuccessful.
r274281:
Add CLEANFILES entry for VM targets
r274282:
Add vm_extra_pre_umount() prototype to vmimage.subr.
r274283:
Fix DESTDIR for installworld, and make sure it is created before use.
r274284:
Move usage() from vmimage.subr to mk-vmimage.sh, in case vmimage.subr
has not been sourced.
r274285:
Spell 'OPTARG' correctly. Actually call vm_create_base().
r274287:
Fix line continuation in write_partition_layout().
Remove variable test that is no longer needed.
r274288:
Fix scheme flag to mkimg(1).
r274292:
mount(8) and umount(8) devfs(5) as needed.
r274296:
Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
it is consolidated into one file.
Fix paths for the base image and output disk image files.
r274297:
Call cleanup() after everything is done.
r274356:
Remove a stray directory from CLEANFILES.
r274533:
Set the boot partition type to 'apple-boot' for powerpc.
r274725:
In vm_install_base(), copy the host resolv.conf into
the build chroot before attempting to do anything that
requires working DNS (i.e., pkg bootstrap).
In vm_extra_pre_umount(), remove the resolv.conf before
the disk image is unmounted from the backing md(4).
r274726 (cperciva):
Silence errors when umounting the chroot's /dev, since it
probably doesn't exist when we're running this.
Unmount filesystems before attempting to destroy the md which
holds them.
r274729 (cperciva):
Unmount filesystem and destroy md before we read the vnode from
disk and package it into a disk image. Otherwise we end up
packaging an unclean filesystem.
r274734 (cperciva):
Merge duplicative vm-CLOUDTYPE targets before additional duplication
gets added by the impending arrival of ec2 and gcloud.
r274771 (cperciva):
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.
r274945:
In vm_extra_install_packages(), only bootstrap pkg(8) if
VM_EXTRA_PACKAGES is empty.
In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
bootstrapped earlier.
r274946:
Fix indentation nit.
r277180:
In vm_extra_install_base(), do not install waagent in the openstack
image, because it is not used. This appears to be a copy mistake.
Remove vm_extra_install_base() from the openstack.conf entirely,
since it does not need to be overridden.
r277183:
Enable the textmode console by default for VM images, since there is
no way to tell if the environment will be able to use the
graphics-mode console.
r277184:
Enable password-less sudo for openstack images.
r277186:
Update the VM_EXTRA_PACKAGES list for the openstack images.
The documentation suggests doing a "just fetch this and run it"-style
bootstrap, from which the list of dependencies was obtained (in
github, at: pellaeon/bsd-cloudinit-installer)
There is one Python dependency unmet, oslo.config, which is not in
the Ports Collection.
r277187:
Add a comment to note that setting hw.vga.textmode=1 is temporary.
r277250:
Remove vm_extra_install_base() for the Azure image, now that the
waagent exists in the ports tree.
Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.
In vm_extra_pre_umount(), remove the explicit pkg(8) install
list, as dependencies are resolved by sysutils/azure-agent.
r277251:
Add a 'list-cloudware' target to print the list of supported CLOUDWARE
values and a description.
Add the AZURE_DESC and OPENSTACK_DESC descriptions.
r277252:
Update release(7)
r277253:
Add 'list-vmtargets' target, which produces a list of all supported
VM and cloud provider images.
Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.
Format the output to make a bit more readable.
Update release(7) to document the list-vmtargets target.
r277263:
Add initial support for the GCE (Google Compute Engine) cloud hosting
provider image.
r277264:
Style and line length cleanup.
r277383:
Remove the console setting from rc.conf(5), which is not used there.
While here, set console to include vidconsole in the loader.conf(5).
r277384:
Fix an indentation nit.
No functional changes.
r277393:
Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
function is often overridden.
Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
code.
r277394:
Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
belongs.
The GCE image needs resolv.conf(5) to exist (created as part of the
image setup), so it cannot be removed.
r277395:
Comment the line that configures ttys(5) to 'off', which makes it
impossible to test that the image boots.
Add a note explaining why the line is commented, and not (yet) removed
entirely.
r277438:
Move the 'install' bits that are specific to virtual machine images
from the Makefile to Makefile.vm.
Rename the 'install' target to 'release-install', and add a new
'vm-install' target.
Add a new 'install' target that invokes the new targets.
r277439:
Add WITH_CLOUDWARE to the list of make(1) variables for the release
build.
r277447:
Remove hw.vga.textmode=1 from the VM image loader.conf, which was
included during test builds and not intended to be included when
merging this project branch back to head.
r277455:
Remove mk-azure.sh, which is no longer needed.
MFC after: 1 month
X-MFC-To: stable/10 (requires mkimg(1))
Help from: cperciva, swills
Relnotes: yes
Sponsored by: The FreeBSD Foundation
2015-01-20 23:56:04 +00:00
|
|
|
cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
|
|
|
|
${DESTDIR}/vmimages/CHECKSUM.SHA256
|
2014-10-29 14:57:30 +00:00
|
|
|
.endif
|
2015-01-22 19:43:05 +00:00
|
|
|
|
|
|
|
vm-release:
|
|
|
|
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
|
|
|
|
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
cloudware-release:
|
|
|
|
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
|
|
|
|
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS}
|
|
|
|
.endif
|
2015-02-24 21:06:25 +00:00
|
|
|
|
2015-04-01 00:00:17 +00:00
|
|
|
.include "${.CURDIR}/Makefile.ec2"
|
2015-06-18 19:20:00 +00:00
|
|
|
.include "${.CURDIR}/Makefile.azure"
|
Add initial support for automatically uploading GCE virtual
machine images to the Google Compute Engine platform.
By default, gcutil/gsutil requires an Oauth2 login generated
from a URL that must be opened in a browser, a verification
code copied back to the terminal from which it was invoked,
etc., etc., making it near impossible for automation.
I've hacked together an evil solution to work around this,
so unless GCE_LOGIN_SKIP is set to a non-empty value, this
Makefile will not do anything useful.
As a result of this commit, remove the gce-package.sh script
that was never, nor will ever be, used.
MFC after: 3 days
X-MFC-Note: (hopefully)
Sponsored by: The FreeBSD Foundation
2015-06-27 01:29:59 +00:00
|
|
|
.include "${.CURDIR}/Makefile.gce"
|
2015-06-27 20:39:13 +00:00
|
|
|
.include "${.CURDIR}/Makefile.vagrant"
|