From: Daniel Farrell Date: Tue, 9 Jun 2015 03:02:02 +0000 (-0400) Subject: Install VBox Additions, fixes Vagrant sync'd dirs X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=7fe515a8a802d4e23ef7a3cf4bbe0cb0c31e59fc;p=integration.git Install VBox Additions, fixes Vagrant sync'd dirs Have Packer's shell provisioner call a script that installs the packages required by VirtualBox Guest Additions, install VBox GA, clean up to save space. Packer now builds a totally functional Vagrant base box based on the latest CentOS (7.1, or 1503). Need to use the Ansible role to install OpenDaylight. Change-Id: Idbbf105522e2f6c34d3bcb30aba2b46258ffa917 Signed-off-by: Daniel Farrell --- diff --git a/packaging/packer/centos.json b/packaging/packer/centos.json index 56cac9a4..b98c26a0 100644 --- a/packaging/packer/centos.json +++ b/packaging/packer/centos.json @@ -40,7 +40,11 @@ "provisioners": [ { "type": "shell", - "script": "config_vagrant.sh" + "scripts": + [ + "config_vagrant.sh", + "config_virtualbox.sh" + ] } ], "post-processors": [ diff --git a/packaging/packer/config_virtualbox.sh b/packaging/packer/config_virtualbox.sh new file mode 100644 index 00000000..23a666f7 --- /dev/null +++ b/packaging/packer/config_virtualbox.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Called by packer to install VirtualBox Guess Additions, which +# required by Vagrant for things like mounting shared dirs. + +# Echo commands as they are run +set -x + +# Install utilities required by VB Guest Additions install +sudo yum install -y bzip2 gcc kernel-devel + +# Install VirtualBox Guest Additions (downloaded by Packer) +sudo mount -o loop /home/vagrant/VBoxGuestAdditions.iso /mnt +sudo /mnt/VBoxLinuxAdditions.run + +# Clean up VirtualBox Guest Additions install media to save space +sudo umount /mnt +rm -rf /home/vagrant/VBoxGuestAdditions.iso