Fix vagrant centos flavor to work with top level make file 94/594/3
authorEd Warnicke <eaw@cisco.com>
Tue, 22 Mar 2016 21:10:07 +0000 (16:10 -0500)
committerGerrit Code Review <gerrit@fd.io>
Fri, 25 Mar 2016 20:37:28 +0000 (20:37 +0000)
Change-Id: I89044ed27130a036536ed33aba847034ed15ad7d
Signed-off-by: Ed Warnicke <eaw@cisco.com>
build-root/vagrant/Vagrantfile
build-root/vagrant/bootstrap.centos7.sh

index f402165..1f6a3b9 100644 (file)
@@ -6,7 +6,7 @@ Vagrant.configure(2) do |config|
   # Pick the right distro and bootstrap, default is ubuntu1404
   distro = ENV['VPP_VAGRANT_DISTRO']
   if distro == 'centos7'
   # Pick the right distro and bootstrap, default is ubuntu1404
   distro = ENV['VPP_VAGRANT_DISTRO']
   if distro == 'centos7'
-    config.vm.box = "puppetlabs/centos-7.0-64-nocm"
+    config.vm.box = "puppetlabs/centos-7.2-64-nocm"
     config.vm.provision 'shell', path: 'bootstrap.centos7.sh'
   else
     config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
     config.vm.provision 'shell', path: 'bootstrap.centos7.sh'
   else
     config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
index 72ee246..0f81586 100644 (file)
@@ -3,59 +3,35 @@
 yum check-update
 yum update -y
 
 yum check-update
 yum update -y
 
-# Install build tools
-yum groupinstall 'Development Tools' -y
-yum install openssl-devel -y
-yum install glibc-static -y
-
-# Install development tools
-yum install gdb -y
-yum install gdbserver -y
-
-# Install jdk and maven
-yum install -y java-1.8.0-openjdk-devel
-
-# Install EPEL
-yum install -y epel-release
-
-# Install components to build Ganglia modules
-yum install -y apr-devel
-yum install -y --enablerepo=epel libconfuse-devel
-yum install -y --enablerepo=epel ganglia-devel
-
-# PCIutils
-yum install -y pciutils
-
-# Load the uio kernel module
+# Install dependencies
+cd /vpp
+make install-dep
+
+# Build rpms
+make bootstrap
+make pkg-rpm
+
+# Install rpms
+
+(cd build-root/;sudo rpm -Uvh *.rpm)
+
+# Disable all ethernet interfaces other than the default route
+# interface so VPP will use those interfaces.  The VPP auto-blacklist
+# algorithm prevents the use of any physical interface contained in the
+# routing table (i.e. "route --inet --inet6") preventing the theft of
+# the management ethernet interface by VPP from the kernel.
+for intf in $(ls /sys/class/net) ; do
+    if [ -d /sys/class/net/$intf/device ] && 
+        [ "$(route --inet --inet6 | grep default | grep $intf)" == "" ] ; then
+        ifconfig $intf down
+    fi
+done
+
+# Install uio-pci-generic
 modprobe uio_pci_generic
 
 modprobe uio_pci_generic
 
-echo uio_pci_generic >> /etc/modules-load.d/uio_pci_generic.conf
-
-# Setup for hugepages using upstart so it persists across reboots
-sysctl -w vm.nr_hugepages=1024
-echo "vm.nr_hugepages=1024" >> /etc/sysctl.conf
-mkdir -p /mnt/huge
-echo "hugetlbfs       /mnt/huge  hugetlbfs       defaults        0 0" >> /etc/fstab
-mount /mnt/huge
-
-# Setup the vpp code
-cd ~vagrant/
-sudo -u vagrant mkdir git
-cd git/
-
-# Check if git exists and remove it before attempting clone, else clone ineffective when "reload --provision"
-[ -d vpp ] && rm -rf vpp
-sudo -H -u vagrant git clone /vpp
-cd vpp
-
-# Initial vpp build
-if [ -d build-root ]; then
-  # Bootstrap vpp
-  cd build-root/
-  sudo -H -u vagrant ./bootstrap.sh
-
-  # Build vpp
-  sudo -H -u vagrant make PLATFORM=vpp TAG=vpp_debug install-packages
-  cd ~vagrant/
-  cat /vagrant/README
-fi
+# Start vpp
+service vpp start
+
+# cat README
+cat /vagrant/README