diff options
-rw-r--r-- | build-root/vagrant/Vagrantfile | 2 | ||||
-rw-r--r-- | build-root/vagrant/bootstrap.centos7.sh | 84 |
2 files changed, 31 insertions, 55 deletions
diff --git a/build-root/vagrant/Vagrantfile b/build-root/vagrant/Vagrantfile index f4021659..1f6a3b9c 100644 --- a/build-root/vagrant/Vagrantfile +++ b/build-root/vagrant/Vagrantfile @@ -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' - 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" diff --git a/build-root/vagrant/bootstrap.centos7.sh b/build-root/vagrant/bootstrap.centos7.sh index 72ee2460..0f815868 100644 --- a/build-root/vagrant/bootstrap.centos7.sh +++ b/build-root/vagrant/bootstrap.centos7.sh @@ -3,59 +3,35 @@ 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 -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 |