Generate tutorial p4vm with a specific ONOS version
Also:
- Updated Bazel version
- Removed non-working code to auto-login user and disable screen saver
- Reduce size by doing a shallow clone of ONOS
Change-Id: Ie6efc3ebd6766164e7051f28dff89046141afa7f
(cherry picked from commit 68a0a00b4f332cb1cc518dc9c76e587d70cb4492)
diff --git a/tools/dev/p4vm/user-bootstrap.sh b/tools/dev/p4vm/user-bootstrap.sh
index a3af30b..17d3b10 100755
--- a/tools/dev/p4vm/user-bootstrap.sh
+++ b/tools/dev/p4vm/user-bootstrap.sh
@@ -1,12 +1,14 @@
#!/bin/bash
set -xe
+ONOS_BRANCH=${1:-master}
+
cp /etc/skel/.bashrc ~/
cp /etc/skel/.profile ~/
cp /etc/skel/.bash_logout ~/
# ONOS
-git clone https://github.com/opennetworkinglab/onos.git
+git clone https://github.com/opennetworkinglab/onos.git --depth 1 -b ${ONOS_BRANCH}
tee -a ~/.bashrc <<EOF
# ONOS
@@ -49,7 +51,7 @@
git clone https://github.com/opennetworkinglab/fabric-p4test.git
# Set Python path for bmv2 in fabric.p4
-echo 'export PYTHONPATH=$PYTHONPATH:~/onos/tools/dev/mininet/bmv2.py' >> ~/.bashrc
+echo 'export PYTHONPATH=$PYTHONPATH:$ONOS_ROOT/tools/dev/mininet' >> ~/.bashrc
# FIXME: for some reason protobuf python bindings are not properly installed
cd ~/p4tools/protobuf/python