diff options
author | gjb <gjb@FreeBSD.org> | 2015-07-23 15:32:58 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2015-07-23 15:32:58 +0000 |
commit | e8cb2fb1daf72e4c9785d859a385547a5fa5359b (patch) | |
tree | 9d78e4b5f2b86d9241b213f2dd6ba123209eb6be /release/tools | |
parent | d5e30036e48dbc8150ac72ad35615acfffc6429e (diff) | |
download | FreeBSD-src-e8cb2fb1daf72e4c9785d859a385547a5fa5359b.zip FreeBSD-src-e8cb2fb1daf72e4c9785d859a385547a5fa5359b.tar.gz |
MFC r285722, r285733:
r285722 (brd):
Add support for building VirtualBox Vagrant images.
Abstract the build, package and upload to handle building
either type.
r285733
Fix an out-of-order execution issue regarding pkg(8):
- pkg(8) cannot be removed before subsequent reinvocations
- The PKG_CACHEDIR cannot be cleaned after the repo*.sqlite
has been removed
- pkg(8) cannot be removed as a precursor to any of the other
steps involved here
Approved by: re (kib)
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'release/tools')
-rw-r--r-- | release/tools/vagrant-virtualbox.conf | 18 | ||||
-rw-r--r-- | release/tools/vagrant-vmware.conf | 22 | ||||
-rw-r--r-- | release/tools/vagrant.conf | 10 |
3 files changed, 42 insertions, 8 deletions
diff --git a/release/tools/vagrant-virtualbox.conf b/release/tools/vagrant-virtualbox.conf new file mode 100644 index 0000000..ff14674 --- /dev/null +++ b/release/tools/vagrant-virtualbox.conf @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +. ${WORLDDIR}/release/tools/vagrant.conf + +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} virtualbox-ose-additions" + +vm_extra_pre_umount () { + # VirtualBox first boot pkgs + echo 'firstboot_pkgs_list="sudo rsync virtualbox-ose-additions"' >> ${DESTDIR}/etc/rc.conf + echo 'vboxguest_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vboxservice_enable="YES"' >> ${DESTDIR}/etc/rc.conf + + # Setup the Vagrant common items + vagrant_common +} diff --git a/release/tools/vagrant-vmware.conf b/release/tools/vagrant-vmware.conf new file mode 100644 index 0000000..330892b --- /dev/null +++ b/release/tools/vagrant-vmware.conf @@ -0,0 +1,22 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +. ${WORLDDIR}/release/tools/vagrant.conf + +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} open-vm-tools-nox11" + +vm_extra_pre_umount () { + # VMWare first boot pkgs + echo 'firstboot_pkgs_list="sudo rsync open-vm-tools-nox11"' >> ${DESTDIR}/etc/rc.conf + + echo 'vmware_guest_vmblock_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guest_vmhgfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guest_vmmemctl_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guest_vmxnet_enable="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'vmware_guestd_enable="YES"' >> ${DESTDIR}/etc/rc.conf + + # Setup the Vagrant common items + vagrant_common +} diff --git a/release/tools/vagrant.conf b/release/tools/vagrant.conf index 7e629ca..5617b96 100644 --- a/release/tools/vagrant.conf +++ b/release/tools/vagrant.conf @@ -10,18 +10,15 @@ export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs" # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs" -vm_extra_pre_umount() { +vagrant_common () { # The firstboot_pkgs rc.d script will download the repository # catalogue and install or update pkg when the instance first # launches, so these files would just be replaced anyway; removing # them from the image allows it to boot faster. + env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} clean -y -a env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg rm ${DESTDIR}/var/db/pkg/repo-*.sqlite - # The size of the EC2 root disk can be configured at instance launch - # time; expand our filesystem to fill the disk. - echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf - # Vagrant instances use DHCP to get their network configuration. echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf @@ -36,9 +33,6 @@ vm_extra_pre_umount() { echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf - # sudo is required - echo 'firstboot_pkgs_list="sudo rsync"' >> ${DESTDIR}/etc/rc.conf - # Create the vagrant user with a password of vagrant /usr/sbin/pw -R ${DESTDIR} \ groupadd vagrant -g 1001 |