| 1 | [[PageOutline]] |
| 2 | |
| 3 | = Overview = |
| 4 | |
| 5 | NOX is "an open-source OpenFlow controller. Its purpose is to provide a simplified platform for writing network control software in C++ or Python." That second clause is important: "NOX itself" isn't really an OpenFlow controller per se; you always run NOX with one or more modules, and those modules are, more precisely, the OpenFlow controllers. NOX comes with some example controllers, including a C++ learning-switch controller called 'switch'. (Not to be confused with the Python learning-switch controller called 'pyswitch'.) |
| 6 | |
| 7 | = Building NOX = |
| 8 | |
| 9 | This is known to work on Ubuntu 10.04. |
| 10 | |
| 11 | These steps are based on the docs at http://noxrepo.org/noxwiki/index.php/NOX_Installation. |
| 12 | |
| 13 | Update the version number below before you start building (in the version and description strings in the Debian manifest). |
| 14 | |
| 15 | == Install depended-upon packages == |
| 16 | |
| 17 | {{{ |
| 18 | cd /etc/apt/sources.list.d |
| 19 | sudo wget http://openflowswitch.org/downloads/debian/nox.list |
| 20 | sudo apt-get update |
| 21 | sudo apt-get install nox-dependencies git-core subversion |
| 22 | sudo rm nox.list |
| 23 | }}} |
| 24 | |
| 25 | == Build NOX == |
| 26 | |
| 27 | {{{ |
| 28 | mkdir -p ~/src |
| 29 | cd ~/src |
| 30 | rm -rf nox |
| 31 | git clone git://noxrepo.org/nox |
| 32 | cd nox |
| 33 | ./boot.sh |
| 34 | mkdir build |
| 35 | cd build |
| 36 | ../configure --prefix=/usr --with-python=yes |
| 37 | make -j 5 |
| 38 | make check |
| 39 | }}} |
| 40 | |
| 41 | == Package it up == |
| 42 | |
| 43 | {{{ |
| 44 | sudo rm -rf ~/pkgbuild/root |
| 45 | mkdir -p ~/pkgbuild/root/etc/init.d ~/pkgbuild/root/usr |
| 46 | make INSTALL='/usr/bin/install -C' prefix=~/pkgbuild/root/usr install |
| 47 | |
| 48 | cd ~/pkgbuild/root/etc/init.d |
| 49 | svn export http://groups.geni.net/svn/syseng/trunk/gposw/nox/noxctl/noxctl.sh nox |
| 50 | chmod 544 nox |
| 51 | |
| 52 | mkdir ~/pkgbuild/root/DEBIAN |
| 53 | cd ~/pkgbuild/root/DEBIAN |
| 54 | echo "Package: nox" > control |
| 55 | echo "Version: 0.9.0.20101110-0ubuntu1" >> control |
| 56 | echo "Architecture: i386" >> control |
| 57 | echo "Maintainer: GPO Ops <gpo-ops@geni.net>" >> control |
| 58 | echo "Section: misc" >> control |
| 59 | echo "Priority: optional" >> control |
| 60 | echo "Description: NOX Zaku 0.9.0 as of 2010-11-10." >> control |
| 61 | echo "Depends: libboost-filesystem1.40.0,libboost-test1.40.0" >> control |
| 62 | |
| 63 | cd .. |
| 64 | sudo chown -Rh root . |
| 65 | sudo chgrp -Rh root . |
| 66 | sudo find . \( -type f -o -type d \) -exec chmod ugo-w {} \; |
| 67 | sudo chmod u+w DEBIAN |
| 68 | |
| 69 | cd .. |
| 70 | ctlfile="root/DEBIAN/control" |
| 71 | pkgname=$(grep "^Package:" ${ctlfile} | awk '{print $2}') |
| 72 | version=$(grep "^Version:" ${ctlfile} | awk '{print $2}') |
| 73 | arch=$(grep "^Architecture:" ${ctlfile} | awk '{print $2}') |
| 74 | tgtfile="${pkgname}_${version}_${arch}.deb" |
| 75 | |
| 76 | dpkg -b root $tgtfile |
| 77 | }}} |