From 149745f95eec5b2e88685d0b08993d0f977f5935 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Sun, 12 Feb 2017 21:37:30 -0500 Subject: Update default Vagrant box to Ubuntu 16.04, VPP-616 - Hand merge of ed0e49c5 and 46f133d5 into stable/1701 Change-Id: Ib7260f07d22e546c6a92fb713b61b7e5edf247c9 Signed-off-by: Dave Wallace --- build-root/vagrant/Vagrantfile | 54 ++++++++++++++++++++++++++---------------- build-root/vagrant/run.sh | 11 +++++---- build-root/vagrant/update.sh | 2 +- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/build-root/vagrant/Vagrantfile b/build-root/vagrant/Vagrantfile index 1f8cf9ab7c2..b463d646092 100644 --- a/build-root/vagrant/Vagrantfile +++ b/build-root/vagrant/Vagrantfile @@ -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,27 +69,31 @@ Vagrant.configure(2) do |config| vmram=(ENV['VPP_VAGRANT_VMRAM'] || 4096) config.ssh.forward_agent = true - - config.vm.synced_folder "../../", "/vpp", type: "rsync", - rsync__auto: false, - rsync__exclude: [ - "build-root/build*/", - "build-root/install*/", - "build-root/images*/", - "build-root/*.deb", - "build-root/*.rpm", - "build-root/*.changes", - "build-root/python", - "build-root/deb/debian/*.dkms", - "build-root/deb/debian/*.install", - "build-root/deb/debian/changes", - "build-root/tools"] + config.ssh.forward_x11 = true config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--ioapic", "on"] vb.memory = "#{vmram}" vb.cpus = "#{vmcpu}" + # rsync the vpp directory if provision hasn't happened yet + unless File.exist? (".vagrant/machines/default/virtualbox/action_provision") + config.vm.synced_folder "../../", "/vpp", type: "rsync", + rsync__auto: false, + rsync__exclude: [ + "build-root/build*/", + "build-root/install*/", + "build-root/images*/", + "build-root/*.deb", + "build-root/*.rpm", + "build-root/*.changes", + "build-root/python", + "build-root/deb/debian/*.dkms", + "build-root/deb/debian/*.install", + "build-root/deb/debian/changes", + "build-root/tools"] + end + #support for the SSE4.x instruction is required in some versions of VB. vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.1", "1"] vb.customize ["setextradata", :id, "VBoxInternal/CPUM/SSE4.2", "1"] diff --git a/build-root/vagrant/run.sh b/build-root/vagrant/run.sh index 7342f38881e..1cd3382640a 100755 --- a/build-root/vagrant/run.sh +++ b/build-root/vagrant/run.sh @@ -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 diff --git a/build-root/vagrant/update.sh b/build-root/vagrant/update.sh index 2a377398678..f4139d74c80 100755 --- a/build-root/vagrant/update.sh +++ b/build-root/vagrant/update.sh @@ -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 -- cgit 1.2.3-korg