diff mbox

[ovs-dev] vagrant: Add FreeBSD 10.2 box support.

Message ID 1467221700-57882-1-git-send-email-u9012063@gmail.com
State Accepted
Headers show

Commit Message

William Tu June 29, 2016, 5:35 p.m. UTC
Add FreeBSD 10.2 vagrant file "Vagrantfile-FreeBSD".  Users can run
'VAGRANT_VAGRANTFILE=Vagrantfile-FreeBSD vagrant up' to test basic
OVS configure, build, and check.

Signed-off-by: William Tu <u9012063@gmail.com>
---
 Vagrantfile-FreeBSD | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Vagrantfile-FreeBSD

Comments

Ben Pfaff July 3, 2016, 5:28 p.m. UTC | #1
On Wed, Jun 29, 2016 at 10:35:00AM -0700, William Tu wrote:
> Add FreeBSD 10.2 vagrant file "Vagrantfile-FreeBSD".  Users can run
> 'VAGRANT_VAGRANTFILE=Vagrantfile-FreeBSD vagrant up' to test basic
> OVS configure, build, and check.
> 
> Signed-off-by: William Tu <u9012063@gmail.com>

This failed the build with the error:

    The following files are in git but not the distribution:
    Vagrantfile-FreeBSD

I fixed that by adding the new file to EXTRA_DIST in Makefile.am, and
applied this to master.  Thank you!
William Tu July 5, 2016, 5:33 a.m. UTC | #2
oh, I forgot to add the new file to EXTRA_DIST. Thanks for fixing it!

On Sun, Jul 3, 2016 at 10:28 AM, Ben Pfaff <blp@ovn.org> wrote:
> On Wed, Jun 29, 2016 at 10:35:00AM -0700, William Tu wrote:
>> Add FreeBSD 10.2 vagrant file "Vagrantfile-FreeBSD".  Users can run
>> 'VAGRANT_VAGRANTFILE=Vagrantfile-FreeBSD vagrant up' to test basic
>> OVS configure, build, and check.
>>
>> Signed-off-by: William Tu <u9012063@gmail.com>
>
> This failed the build with the error:
>
>     The following files are in git but not the distribution:
>     Vagrantfile-FreeBSD
>
> I fixed that by adding the new file to EXTRA_DIST in Makefile.am, and
> applied this to master.  Thank you!
diff mbox

Patch

diff --git a/Vagrantfile-FreeBSD b/Vagrantfile-FreeBSD
new file mode 100644
index 0000000..8f00abe
--- /dev/null
+++ b/Vagrantfile-FreeBSD
@@ -0,0 +1,49 @@ 
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# All Vagrant configuration is done below. The "2" in Vagrant.configure
+# configures the configuration version (we support older styles for
+# backwards compatibility). Please don't change it unless you know what
+# you're doing.
+
+VAGRANTFILE_API_VERSION = "2"
+Vagrant.require_version ">=1.7.0"
+
+$bootstrap_freebsd = <<SCRIPT
+sed  -e 's/\#DEFAULT_ALWAYS_YES = false/DEFAULT_ALWAYS_YES = true/g' -e 's/\#ASSUME_ALWAYS_YES = false/ASSUME_ALWAYS_YES = true/g' /usr/local/etc/pkg.conf > /tmp/pkg.conf
+mv -f /tmp/pkg.conf /usr/local/etc/pkg.conf
+pkg install automake libtool wget python py27-six gmake
+SCRIPT
+
+$configure_ovs = <<SCRIPT
+cd /vagrant
+./boot.sh
+mkdir -p ~/build
+cd ~/build
+sudo /vagrant/configure --disable-libcapng --enable-silent-rules
+SCRIPT
+
+$build_ovs = <<SCRIPT
+cd ~/build
+gmake
+SCRIPT
+
+$test_userspace = <<SCRIPT
+cd ~/build
+gmake check
+SCRIPT
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  # Use NFS due to capability 'mount_virtualbox_shared_folder'
+  # does not work on FreeBSD.
+  config.vm.network :private_network, ip: "10.0.0.2"
+  config.vm.synced_folder ".", "/vagrant", :nfs => true
+
+  config.vm.define "freebsd-10.2" do |freebsd|
+    freebsd.vm.box = "bento/freebsd-10.2" 
+    freebsd.vm.provision "bootstrap", type: "shell", inline: $bootstrap_freebsd
+    freebsd.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
+    freebsd.vm.provision "build_ovs", type: "shell", inline: $build_ovs
+    freebsd.vm.provision "test_userspace", type: "shell", inline: $test_userspace
+  end
+end