Add Trellis dependency into p4vm
Change-Id: Ieddb3ffa9da620ea78e4538aae02869804e2d0d1
diff --git a/tools/dev/p4vm/pre-ova-cleanup.sh b/tools/dev/p4vm/pre-ova-cleanup.sh
index 0718dd8..45c6a41 100755
--- a/tools/dev/p4vm/pre-ova-cleanup.sh
+++ b/tools/dev/p4vm/pre-ova-cleanup.sh
@@ -15,6 +15,7 @@
sudo rm -rf ~/p4tools/sysrepo
sudo rm -rf ~/p4tools/scapy-vxlan
sudo rm -rf ~/p4tools/ptf
+sudo rm -rf ~/quagga
sudo apt-get clean
sudo apt-get -y autoremove
diff --git a/tools/dev/p4vm/root-bootstrap.sh b/tools/dev/p4vm/root-bootstrap.sh
index 9a1d4e9..47fb509 100755
--- a/tools/dev/p4vm/root-bootstrap.sh
+++ b/tools/dev/p4vm/root-bootstrap.sh
@@ -50,7 +50,17 @@
vlan \
ntp \
vim nano emacs \
- arping
+ arping \
+ gawk \
+ texinfo \
+ build-essential \
+ iptables \
+ automake \
+ autoconf \
+ libtool \
+ isc-dhcp-server
+
+DEBIAN_FRONTEND=noninteractive apt-get -yq install wireshark
rm -f ${BAZEL_DEB}
@@ -58,6 +68,8 @@
python2.7 get-pip.py --force-reinstall
rm -f get-pip.py
+pip install ipaddress
+
tee -a /etc/ssh/sshd_config <<EOF
UseDNS no
diff --git a/tools/dev/p4vm/user-bootstrap.sh b/tools/dev/p4vm/user-bootstrap.sh
index 8e7cee3..a3af30b 100755
--- a/tools/dev/p4vm/user-bootstrap.sh
+++ b/tools/dev/p4vm/user-bootstrap.sh
@@ -25,9 +25,26 @@
git clone git://github.com/mininet/mininet
sudo ~/mininet/util/install.sh -nv
-# Trellis routing repo
+# Trellis - checkout routing repo
git clone https://github.com/opennetworkinglab/routing.git
+# Trellis - install Quagga
+git clone -b onos-1.11 https://gerrit.opencord.org/quagga
+cd quagga
+./bootstrap.sh
+./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root
+make
+sudo make install
+cd ..
+sudo ldconfig
+
+# Trellis - modify apparmor for the DHCP to run properly
+sudo /etc/init.d/apparmor stop
+sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/
+sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd
+sudo sed -i '30i /var/lib/dhcp{,3}/dhcpclient* lrw,' /etc/apparmor.d/sbin.dhclient
+sudo /etc/init.d/apparmor start
+
# fabric-p4test
git clone https://github.com/opennetworkinglab/fabric-p4test.git