Update default Vagrant box to Ubuntu 16.04, VPP-616 97/4897/8
authorDave Wallace <dwallacelf@gmail.com>
Fri, 27 Jan 2017 02:42:00 +0000 (21:42 -0500)
committerDamjan Marion <dmarion.lists@gmail.com>
Thu, 2 Feb 2017 13:42:56 +0000 (13:42 +0000)
- Make puppetlabs/ubuntu-16.04-64-nocm the default box
- Enable x11 forwarding
- Install x11-utils required for emacs to work over X11
- Refactor run.sh
- Add VPP_VAGRANT_POST_BUILD environment variable to
  allow selection of installing VPP or run "make test".
- Fix dependencies in src/vppapigen.am

Change-Id: I0ec054fdc83feb71ca8396df53ed02bf82ecd7e7
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
build-root/vagrant/Vagrantfile
build-root/vagrant/run.sh
build-root/vagrant/update.sh
src/vppapigen.am

index 9e03a84..b463d64 100644 (file)
@@ -3,21 +3,29 @@
 
 Vagrant.configure(2) do |config|
 
-  # Pick the right distro and bootstrap, default is ubuntu1404
-  distro = ( ENV['VPP_VAGRANT_DISTRO'] || "ubuntu1404")
+  # Pick the right distro and bootstrap, default is ubuntu1604
+  distro = ( ENV['VPP_VAGRANT_DISTRO'] || "ubuntu1604")
   if distro == 'centos7'
     config.vm.box = "puppetlabs/centos-7.2-64-nocm"
     config.ssh.insert_key = false
-  else
+  elsif distro == 'ubuntu1404'
     config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
+  else
+    config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm"
   end
   config.vm.box_check_update = false
 
   config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"update.sh")
   config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"build.sh"), :args => "/vpp vagrant"
-  config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"install.sh"), :args => "/vpp"
-  config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clearinterfaces.sh")
-  config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"run.sh")
+
+  post_build = ( ENV['VPP_VAGRANT_POST_BUILD'] )
+  if post_build == "test"
+    config.vm.provision "shell", inline: "echo Testing VPP; cd /vpp; make test"
+  elsif post_build == "install"
+    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"install.sh"), :args => "/vpp"
+    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"clearinterfaces.sh")
+    config.vm.provision :shell, :path => File.join(File.dirname(__FILE__),"run.sh")
+  end
 
   # Add .gnupg dir in so folks can sign patches
   # Note, as gnupg puts socket files in that dir, we have
@@ -61,6 +69,7 @@ Vagrant.configure(2) do |config|
   vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096)
 
   config.ssh.forward_agent = true
+  config.ssh.forward_x11 = true
 
   config.vm.provider "virtualbox" do |vb|
       vb.customize ["modifyvm", :id, "--ioapic", "on"]
index 7342f38..1cd3382 100755 (executable)
@@ -11,12 +11,13 @@ elif [ -f /etc/redhat-release ];then
     DISTRIB_DESCRIPTION=`lsb_release -sd`
 fi
 
-if [ $DISTRIB_ID == "Ubuntu" ]; then
-    start vpp
-elif [ $DISTRIB_ID == "CentOS" ]; then
+if [ $DISTRIB_ID == "CentOS" ]; then
     # Install uio-pci-generic
     modprobe uio_pci_generic
-
-    # Start vpp
+fi
+echo "Starting VPP..."
+if [ $DISTRIB_ID == "Ubuntu" ] && [ $DISTRIB_CODENAME = "trusty" ] ; then
+    start vpp
+else
     service vpp start
 fi
index 2a37739..f4139d7 100755 (executable)
@@ -40,7 +40,7 @@ if [ $DISTRIB_ID == "Ubuntu" ]; then
     update-alternatives --install /bin/sh sh /bin/bash 100
 
     # Install useful but non-mandatory tools
-    apt-get install -y emacs git-review gdb gdbserver
+    apt-get install -y emacs x11-utils git-review gdb gdbserver
 elif [ $DISTRIB_ID == "CentOS" ]; then
     # Standard update + upgrade dance
     yum check-update
index 5c25e1e..fe9ff03 100644 (file)
 
 bin_PROGRAMS += vppapigen
 
-# We cannot rely on BUILT_SOURCES here as other built sources are relying
-# on vppapigen, so make can start compiling lex.c before gram.h is created.
-# This way we introduce new dependency by running C preprocessor.
-
-tools/vppapigen/lex_e.c: tools/vppapigen/lex.c tools/vppapigen/gram.y
+tools/vppapigen/gram.h: tools/vppapigen/gram.y
        @$(YACC) -d @srcdir@/tools/vppapigen/gram.y
        @mv y.tab.h tools/vppapigen/gram.h
        @rm y.tab.c
-       @$(CC) -I. -E -o $@ $<
 
-vppapigen_SOURCES = tools/vppapigen/gram.y tools/vppapigen/lex_e.c tools/vppapigen/node.c
+tools/vppapigen/lex.o: tools/vppapigen/gram.h
+tools/vppapigen/node.o: tools/vppapigen/gram.h
+
+vppapigen_SOURCES = tools/vppapigen/gram.y tools/vppapigen/lex.c tools/vppapigen/node.c
 vppapigen_LDADD = libvppinfra.la
 vppapigen_LDFLAGS = -static
 
 CLEANFILES += tools/vppapigen/gram.c tools/vppapigen/gram.h
-CLEANFILES += tools/vppapigen/lex_e.c
 # vi:syntax=automake