From 0777915b2a98ea6353e6c0951c3aa195d4751d35 Mon Sep 17 00:00:00 2001 From: Srivatsa Sangli Date: Fri, 15 Apr 2016 13:59:00 -0700 Subject: ubuntu 16.04 build support. Supporting systemd with vpp.service files. Incorporating review comments : modified debian/control dependencies Change-Id: Ib2fe85d81eb7f1803ef8f54294c7c18cd07c61ba Signed-off-by: Srivatsa Sangli --- Makefile | 2 +- build-root/deb/debian/control | 2 +- build-root/deb/debian/rules | 2 +- build-root/deb/debian/vpp.service | 14 +++++++++++ build-root/vagrant/bootstrap.ubuntu1604.sh | 39 ++++++++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 build-root/deb/debian/vpp.service create mode 100644 build-root/vagrant/bootstrap.ubuntu1604.sh diff --git a/Makefile b/Makefile index 68652836..fd1d0ff9 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ MINIMAL_STARTUP_CONF="unix { interactive }" GDB_ARGS= -ex "handle SIGUSR1 noprint nostop" DEB_DEPENDS = curl build-essential autoconf automake bison libssl-dev ccache -DEB_DEPENDS += debhelper dkms default-jdk git libtool libganglia1-dev libapr1-dev +DEB_DEPENDS += debhelper dkms default-jdk git libtool libganglia1-dev libapr1-dev dh-systemd DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope RPM_DEPENDS_GROUPS = 'Development Tools' diff --git a/build-root/deb/debian/control b/build-root/deb/debian/control index cf22fd02..97464e42 100644 --- a/build-root/deb/debian/control +++ b/build-root/deb/debian/control @@ -2,7 +2,7 @@ Source: vpp Section: net Priority: extra Maintainer: Cisco OpenVPP Packaging Team -Build-Depends: debhelper (>= 9), dkms +Build-Depends: debhelper (>= 9), dkms, dh-systemd Standards-Version: 3.9.4 Package: vpp diff --git a/build-root/deb/debian/rules b/build-root/deb/debian/rules index bcee0121..b5afbdb6 100755 --- a/build-root/deb/debian/rules +++ b/build-root/deb/debian/rules @@ -18,7 +18,7 @@ include /usr/share/dpkg/default.mk # main packaging script based on dh7 syntax %: - dh $@ --with dkms + dh $@ --with dkms --with systemd override_dh_install: dh_install --exclude .git diff --git a/build-root/deb/debian/vpp.service b/build-root/deb/debian/vpp.service new file mode 100644 index 00000000..a2849296 --- /dev/null +++ b/build-root/deb/debian/vpp.service @@ -0,0 +1,14 @@ +[Unit] +Description=vector packet processing engine +After=network.target + +[Service] +Type=simple +ExecStartPre=-/bin/rm -f /dev/shm/* +ExecStartPre=-/sbin/modprobe igb_uio +ExecStart=/usr/bin/vpp -c /etc/vpp/startup.conf +ExecStopPost=/bin/rm -f /dev/shm/* +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/build-root/vagrant/bootstrap.ubuntu1604.sh b/build-root/vagrant/bootstrap.ubuntu1604.sh new file mode 100644 index 00000000..2e607f1e --- /dev/null +++ b/build-root/vagrant/bootstrap.ubuntu1604.sh @@ -0,0 +1,39 @@ +# Fix grub-pc on Virtualbox with Ubuntu +export DEBIAN_FRONTEND=noninteractive + +# Standard update + upgrade dance +apt-get update +apt-get upgrade -y + +# Fix the silly notion that /bin/sh should point to dash by pointing it to bash + +sudo update-alternatives --install /bin/sh sh /bin/bash 100 + +cd /vpp +sudo -H -u vagrant make install-dep + +# Install useful but non-mandatory tools +apt-get install -y emacs git-review gdb gdbserver + +sudo -H -u vagrant make bootstrap +sudo -H -u vagrant make pkg-deb +(cd build-root/;dpkg -i *.deb) + +# Capture all the interface IPs, in case we need them later +ifconfig -a > ~vagrant/ifconfiga +chown vagrant:vagrant ~vagrant/ifconfiga + +# 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 + +systemctl start vpp +cat /vagrant/README -- cgit 1.2.3-korg