diff options
author | Andy Zhou <azhou@nicira.com> | 2015-01-07 19:42:41 -0800 |
---|---|---|
committer | Andy Zhou <azhou@nicira.com> | 2015-01-08 15:36:39 -0800 |
commit | b56b2566417dd436e768394c12b030019d2dc101 (patch) | |
tree | cc5cb437be148dc71f8f4255bfa8944572888959 /Vagrantfile | |
parent | d5460484c3708d048270f8601d64e8f1a573b357 (diff) | |
download | openvswitch-b56b2566417dd436e768394c12b030019d2dc101.tar.gz |
vagrant: switch to use out of tree build
Vagrant shared folder, at least on the default virtual box, does not
support the creation of the socket files. If one were to build OVS
under /vagrant, 'make check' would not work.
Out of tree builds can be used to work around this issue.
See Install.md for instructions.
Since out of tree builds requires a clean source tree, Vagrantfile can
not be a generated file. This commit removes Vagrantfile.in, commit
Vagrantfile instead.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Diffstat (limited to 'Vagrantfile')
-rw-r--r-- | Vagrantfile | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..982eb0113 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,49 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +$bootstrap_fedora = <<SCRIPT +yum -y update +yum -y install autoconf automake openssl-devel libtool \ + python-twisted-core python-zope-interface PyQt4 \ + desktop-file-utils groff graphviz rpmdevtools +echo "search extra update built-in" >/etc/depmod.d/search_path.conf +SCRIPT + +$configure_ovs = <<SCRIPT +mkdir -p ~/build +cd ~/build +/vagrant/configure --with-linux=/lib/modules/`uname -r`/build +SCRIPT + +$build_ovs = <<SCRIPT +cd ~/build +make +SCRIPT + +$install_rpm = <<SCRIPT +cd ~/build +PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac` +make && make dist +rpmdev-setuptree +cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES +rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec +sudo rpm -e openvswitch +sudo rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.fc20.x86_64.rpm +sudo systemctl enable openvswitch +sudo systemctl start openvswitch +sudo systemctl status openvswitch +SCRIPT + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.define "fedora-20" do |fedora| + fedora.vm.box = "chef/fedora-20" + fedora.vm.provision :shell, inline: $bootstrap_fedora + end + + config.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs, privileged: false + config.vm.provision "build_ovs", type: "shell", inline: $build_ovs, privileged: false + config.vm.provision "install_rpm", type: "shell", inline: $install_rpm, privileged: false +end |