Skip to content

Commit

Permalink
improved p4 install in case it was not installed with our full VM scr…
Browse files Browse the repository at this point in the history
…ipt, python site packages are moved. Added user and password to VM documentation
  • Loading branch information
edgar-costa committed Oct 13, 2023
1 parent d469e31 commit f2b1454
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ <h3>Build your own VM<a class="headerlink" href="#build-your-own-vm" title="Perm
<div class="section" id="use-our-preconfigured-vm">
<h3>Use our preconfigured VM<a class="headerlink" href="#use-our-preconfigured-vm" title="Permalink to this headline"></a></h3>
<p>To download our preconfiugred VMs, please click on the folllwing links:</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">Use the following credentials to acces the VMs
- <code class="docutils literal notranslate"><span class="pre">username:</span></code> p4.
- <code class="docutils literal notranslate"><span class="pre">password:</span></code> p4.</p>
</div>
<ul class="simple">
<li><a class="reference external" href="https://polybox.ethz.ch/index.php/s/QlrfHm7uYw6vISe">QEMU VM (Ubuntu 20)</a></li>
<li><a class="reference external" href="https://polybox.ethz.ch/index.php/s/9orcmetpNxOAhlI">Deprecated: QEMU VM (UBuntu 18.04)</a></li>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docsrc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ Use our preconfigured VM

To download our preconfiugred VMs, please click on the folllwing links:

.. Important::
Use the following credentials to acces the VMs
- ``username:`` p4.
- ``password:`` p4.

- __ https://polybox.ethz.ch/index.php/s/QlrfHm7uYw6vISe

`QEMU VM (Ubuntu 20)`__
Expand Down
24 changes: 24 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# p4-utils branch
P4_UTILS_BRANCH="master"

install_p4utils() {
pip3 install -e "."
}
Expand All @@ -26,5 +29,26 @@ mx() {
cd ..
}

PY3LOCALPATH=`curl -sSL https://raw.githubusercontent.com/nsg-ethz/p4-utils/${P4_UTILS_BRANCH}/install-tools/scripts/py3localpath.py | python3`
function site_packages_fix {
local SRC_DIR
local DST_DIR

SRC_DIR="${PY3LOCALPATH}/site-packages"
DST_DIR="${PY3LOCALPATH}/dist-packages"

# When I tested this script on Ubunt 16.04, there was no
# site-packages directory. Return without doing anything else if
# this is the case.
if [ ! -d ${SRC_DIR} ]; then
return 0
fi

echo "Adding ${SRC_DIR} to Python3 path..."
sudo su -c "echo '${SRC_DIR}' > ${DST_DIR}/p4-tools.pth"
echo "Done!"
}

install_p4utils
mx
site_packages_fix

0 comments on commit f2b1454

Please sign in to comment.