<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>NanostationM5AirOSModOLSR</title><revhistory><revision><revnumber>29</revnumber><date>2012-12-17 22:35:36</date><authorinitials>host99-110-dynamic.4-87-r.retail.telecomitalia.it</authorinitials></revision><revision><revnumber>28</revnumber><date>2012-05-10 12:14:03</date><authorinitials>ZioPRoTo</authorinitials><revremark>cambiamento banale</revremark></revision><revision><revnumber>27</revnumber><date>2011-12-21 21:39:10</date><authorinitials>ZioPRoTo</authorinitials><revremark>Sburratone4 Apply the patch to remove mandatory default gw from web interface</revremark></revision><revision><revnumber>26</revnumber><date>2011-12-21 18:36:47</date><authorinitials>ZioPRoTo</authorinitials><revremark>add security patch</revremark></revision><revision><revnumber>25</revnumber><date>2011-12-21 18:16:30</date><authorinitials>ZioPRoTo</authorinitials><revremark>modificato link ad SDK stabile perche' non usiamo piu' la vecchia reversata</revremark></revision><revision><revnumber>24</revnumber><date>2011-11-02 18:02:52</date><authorinitials>ZioPRoTo</authorinitials><revremark>Aggiunta documentazione su command line di AirOS per fare operazioni via shell</revremark></revision><revision><revnumber>23</revnumber><date>2011-09-23 10:18:27</date><authorinitials>ClauzClauz</authorinitials><revremark>adding toc</revremark></revision><revision><revnumber>22</revnumber><date>2011-09-23 10:17:15</date><authorinitials>ClauzClauz</authorinitials><revremark>traduzione ita2eng</revremark></revision><revision><revnumber>21</revnumber><date>2011-09-16 06:51:09</date><authorinitials>ZioPRoTo</authorinitials><revremark>updated link to ubnt-base-files.patch</revremark></revision><revision><revnumber>20</revnumber><date>2011-09-01 17:13:33</date><authorinitials>ZioPRoTo</authorinitials></revision><revision><revnumber>19</revnumber><date>2011-09-01 08:44:59</date><authorinitials>ZioPRoTo</authorinitials></revision><revision><revnumber>18</revnumber><date>2011-08-31 07:39:44</date><authorinitials>ZioPRoTo</authorinitials></revision><revision><revnumber>17</revnumber><date>2011-08-31 07:31:04</date><authorinitials>ZioPRoTo</authorinitials><revremark>istruzioni per usare la SDK 5.3.3 hacked</revremark></revision><revision><revnumber>16</revnumber><date>2011-04-02 13:57:54</date><authorinitials>ZioPRoTo</authorinitials><revremark>pilla gay</revremark></revision><revision><revnumber>15</revnumber><date>2011-03-05 01:24:36</date><authorinitials>stefanopilla</authorinitials></revision><revision><revnumber>14</revnumber><date>2011-02-19 11:06:21</date><authorinitials>nino</authorinitials></revision><revision><revnumber>13</revnumber><date>2011-01-26 17:42:49</date><authorinitials>stefanopilla</authorinitials></revision><revision><revnumber>12</revnumber><date>2011-01-17 15:01:20</date><authorinitials>maruscia</authorinitials><revremark>cambiati link</revremark></revision><revision><revnumber>11</revnumber><date>2011-01-17 14:44:08</date><authorinitials>maruscia</authorinitials></revision><revision><revnumber>10</revnumber><date>2011-01-17 14:42:28</date><authorinitials>maruscia</authorinitials><revremark>added md5 of binaries</revremark></revision><revision><revnumber>9</revnumber><date>2011-01-17 11:18:00</date><authorinitials>stefanopilla</authorinitials></revision><revision><revnumber>8</revnumber><date>2011-01-16 15:51:42</date><authorinitials>maruscia</authorinitials></revision><revision><revnumber>7</revnumber><date>2011-01-16 15:49:35</date><authorinitials>maruscia</authorinitials><revremark>added firmware binary images</revremark></revision><revision><revnumber>6</revnumber><date>2011-01-15 17:40:32</date><authorinitials>maruscia</authorinitials></revision><revision><revnumber>5</revnumber><date>2011-01-14 15:15:48</date><authorinitials>stefanopilla</authorinitials></revision><revision><revnumber>4</revnumber><date>2011-01-10 02:30:04</date><authorinitials>maruscia</authorinitials></revision><revision><revnumber>3</revnumber><date>2011-01-10 02:28:24</date><authorinitials>maruscia</authorinitials></revision><revision><revnumber>2</revnumber><date>2011-01-10 02:27:41</date><authorinitials>maruscia</authorinitials></revision><revision><revnumber>1</revnumber><date>2011-01-10 02:26:47</date><authorinitials>maruscia</authorinitials><revremark>modifiche alla pagina e inserimento 5.2.1 + olsr</revremark></revision></revhistory></articleinfo><section><title>Ubiquiti Nanostation M5 with AirOS firmware and OLSR</title><para>Ubiquiti Networks provides developers with a SDK to build their factory firmware, AirOS. Both the SDK and the cross-compiler toolchain can be found in the support section of their homepage [0]. </para><para>By default AirOS uses no dynamic routing protocol, while Ninux.org uses OLSR. The only way to use OLSR with AirOS to make a Ninux node speak OLSR is to patch the firmware and the web interface to include OLSR support. </para><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="https://wiki.graz.funkfeuer.at/moin_static171/mandarin/img/icon-info.png" width="16"/></imageobject><textobject><phrase>{i}</phrase></textobject></inlinemediaobject>   This patch does not modify the existing kernel configuration nor the wifi driver in order to preserve the stability and functionality of the original firmware. So please note that this patched firmware, like the original one, has <emphasis role="strong">no adhoc mode</emphasis>. </para><para>You can build your own Image on your preferred linux distribution by invoking the following commands: </para><section><title>SDK 3.5  with Debian/Ubuntu</title><screen><![CDATA[# mkdir ubnt-3.x
# cd ubnt-3.x
# wget http://www.ubnt.com/downloads/sdk/toolchain-mips-ls_0.1-1.deb
# dpkg -i toolchain-mips-ls_0.1-1.deb
# wget http://www.ubnt.com/downloads/firmwares/XS-fw/v3.5/SDK.UBNT.v3.5.4499.tar.bz2
# tar xjf SDK.UBNT.v3.5.4499.tar.bz2
# wget http://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/patches/AirOS3.x/patches.tar.gz
# tar -xzvf patches.tar.gz
# cd SDK.UBNT.v3.5.4499
# patch -p1 < ../UBNT_SDK3.5_with_olsrd-01.patch
# tar xzf ../UBNT_SDK3.5_files-02.tar.gz]]></screen><para>now we have to download and copy the olsrd source </para><screen><![CDATA[# cd apps/gpl/olsrd
# wget http://www.olsr.org/releases/0.6/olsrd-<version>.tar.bz2
# tar --strip 1 -xjf olsrd-<version>.tar.bz2
# rm olsrd-<version>.tar.bz2
# cd ../../../
# make xs5]]></screen><para>You can build a image for 2.4GHz Hardware by replacing the <emphasis role="strong">xs5</emphasis> with <emphasis role="strong">xs2</emphasis>. </para><para>After  building the Image it can be installed via the AirOS Webinterface. If  the interface complaints about a wrong image file you have to upgrade  AirOS to a newer version which allows the use of third party firmware  images. </para></section><section><title>SDK 5.2 with OLSR 0.6.0</title><screen><![CDATA[# mkdir ubnt-5.x
# cd ubnt-5.x
# wget http://www.ubnt.com/downloads/firmwares/XN-fw/v5.2/SDK.UBNT.v5.2.tar.bz2
# tar xjf SDK.UBNT.v5.2.tar.bz2
# wget http://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/patches/AirOS5.x/patches.tar.gz
# tar -xzvf patches.tar.gz
# cd SDK.UBNT.v5.2
# patch -p1 < ../olsrd-package.patch
# patch -p1 < ../ubnt-web-with-olsrd.patch
# patch -p1 < ../optional-default-gw.patch
# patch -p1 < ../fffversion.patch
# tar xzf ../additional-files.tar.gz
# cd openwrt
# make]]></screen></section><section><title>SDK 5.2.1 with OLSR 0.6.1</title><screen><![CDATA[# mkdir ubnt-5.x
# cd ubnt-5.x
# wget http://www.ubnt.com/downloads/firmwares/XN-fw/v5.2.1/SDK.UBNT.v5.2.1.tar.bz2
# tar jxf SDK.UBNT.v5.2.1.tar.bz2
# wget http://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/patches/AirOS5.x/patches.tar.gz
# tar -xzvf patches.tar.gz
# cd SDK.UBNT.v5.2.1
# patch -p1 < ../ninux-airos_olsr0.6.1_final.patch
# tar -zxvf ../additional-content.tar.gz
# cd openwrt
# make]]></screen><para>After building the binary file can be found in openwrt/bin and can be installed via the AirOS Webinterface. </para><para>If  you have successfully installed the image you can turn on olsrd using  the enable button at the services section of the Web Interface. </para><para>You can also download your own olsrd.conf via the  Webinterface. If you download an own configuration file be sure it  includes the configuration lines for the txtinfo plugin as this plugin  is needed by the Web Inteface to show the OLSR Info. </para><para>If  you want to edit the olsrd.conf via ssh or telnet you have to make sure  that it gets stored inside the persistent storage area of the flash.  Create the Configuration file inside the <emphasis>/etc/persistent/</emphasis> directory and invoke the following command: </para><screen><![CDATA[# cfgmtd -w -p /etc/]]></screen><para>After that you have to reboot. </para></section><section><title>Official Ubiquiti SDK 5.3.3  with olsrd (stable git)</title><para>This document is written for people that are already a little familiar with the OpenWRT toolchain. </para><para>Download the SDK (here we provide a mirror): <ulink url="http://stud.netgroup.uniroma2.it/~saverio/SDK.UBNT.v5.3.3.tar.bz2"/> </para><para>Go in the <code>openwrt</code> folder and add to the <code>feeds.conf.default</code> these lines: </para><screen><![CDATA[src-svn zninux https://svn.ninux.org/svn/ninuxdeveloping/packages
src-svn zopenwrtpackages svn://svn.openwrt.org/openwrt/packages/]]></screen><para><emphasis role="strong">OPTIONAL:</emphasis> I like to use the src-link feed because usually I have already the Ninux packages and the OpenWRT packages on my machine but you can also use src-svn feeds style </para><screen><![CDATA[src-link zninux /somepath/packagesninux
src-link zopenwrtpackages /somepath/packages]]></screen><para>Update the feeds: </para><screen><![CDATA[./scripts/feeds update]]></screen><para>Install necessary package in the toolchain. Note that for some packages like radvd, that are present in more feeds, we need to specify which feed where to pick the package from. </para><screen><![CDATA[./scripts/feeds install olsrd-ninux
./scripts/feeds install -p zopenwrtpackages radvd]]></screen><para>run <code>make menuconfig</code> and select packages you need, like olsrd-ninux, ipv6, radvd and so on. </para><para><emphasis role="strong">UPDATE</emphasis>: Add this security patch <ulink url="https://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/patches/AirOS5.3.3/lighttpd-mod-airos-exploit-fix.patch"/> </para><para><emphasis role="strong">Update</emphasis>: Apply the patch to remove mandatory default gw from web interface <ulink url="https://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/patches/AirOS5.3.3/optional-default-gw.patch"/> </para><para>Now apply this patch to the ubnt-base-files package: <ulink url="https://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/patches/AirOS5.3.3/000-ubnt-base-files.patch"/> </para><para><emphasis role="strong"> the patch adds a file called <code>/ninux</code> in the / directory, remember to set it executable with chmod +x</emphasis> </para><para>What is this patch doing ? </para><para>At boot time the existance of /etc/persistent/ninux is cheched. If it exists it is executed, otherwise the file /ninux is executed. </para><para>The /ninux script acts in the same way, checking for the existance of /etc/persistent/olsrd.conf, otherwise it uses /olsrd.conf </para><para>This means that when the device is freshly flashed, olsrd is already running with a default configuration, ideally just the HNA configuration is missing. </para></section><section><title>Binary Firmware Images</title><para>AirOS version 5.2.1 + OLSR 0.6.0 (stable) + tinc: <ulink url="https://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/fw-binaries/XM.v5.2.1.sdk-olsr0.6.0-tinc.bin"/> </para><para>md5: cd28bfcd173c9e019ed8e781526deb6b </para><para>AirOS version 5.2.1 + OLSR 0.6.1 (git) + tinc: <ulink url="https://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/fw-binaries/XM.v5.2.1.sdk-olsr0.6.1-tinc.bin"/> </para><para>md5: e7bd9bc254639aec389876326b3ff3b6 </para><para>AirOS version 5.3 + OLSR 0.6.1 + tinc + IPv6: <ulink url="https://svn.ninux.org/ninuxdeveloping/browser/UbntM5AirOsOLSR/fw-binaries/XM.v5.3.sdk-olsr0.6.1-tinc-ipv6.bin"/> </para><para>md5: f4590559755e99c8c1afaefb53d35121 </para></section></section><section><title>Links</title><para><ulink url="http://www.ubnt.com/support/downloads"/> </para><para><ulink url="http://www.olsr.org"/> </para><para><ulink url="https://wiki.graz.funkfeuer.at/UbntStations"/> </para></section><section><title>persistent configurations</title><para><ulink url="http://www.ubnt.com/wiki/Manual_Routes"/> </para></section><section><title>Quick and dirty notes</title><para>Comandi da terminale comodi su AirOS </para><para>Per fare upgrade del firmware se /tmp/fwupdate.bin è l'immagine che vogliamo flashare (controllate l'md5 prima di proseguire) </para><screen><![CDATA[/sbin/ubntbox fwupdate.real -m /tmp/fwupdate.bin -d ]]></screen><para>Per caricare un file di configurazione </para><screen><![CDATA[cfgmtd -f /tmp/system.cfg -w && reboot]]></screen></section></article>