HowTo build an image of Nightwing for the Ubiquiti PicoStation2

This document shows how to build an image of Nightwing to flash in an Ubiquiti PicoStation2 using nightwing 0.6beta3 or 0.6beta4 . As base system it was used Ubuntu.

Download and install the toolchain of UBNT needed to run the UBNT SDK:

# wget http://www.ubnt.com/downloads/sdk/toolchain-mips-ls_0.1-1.deb
# sudo dpkg -i toolchain-mips-ls_0.1-1.deb

Download and decompress the UBNT SDK:

# wget http://ubnt.com/downloads/XS-fw/v3.3.2/SDK.UBNT.v3.3.2.4257.tar.bz2

In Ubuntu these files of the UBNT SDK are modified (don't know in other distros, I just test it on Ubuntu, I guess is the same):

Index: SDK.UBNT.v3.3.2.4257/apps/gpl/mkfwimage/src/mkfwimage.c
===================================================================
--- SDK.UBNT.v3.3.2.4257/apps/gpl/mkfwimage/src/mkfwimage.c (revision 3426)
+++ SDK.UBNT.v3.3.2.4257/apps/gpl/mkfwimage/src/mkfwimage.c (revision 3427)
@@ -27,6 +27,7 @@
#include
#include
#include
+#include

#include "fw.h"

Index: SDK.UBNT.v3.3.2.4257/apps/gpl/mkfwimage/src/fwsplit.c
===================================================================
--- SDK.UBNT.v3.3.2.4257/apps/gpl/mkfwimage/src/fwsplit.c (revision 3426)
+++ SDK.UBNT.v3.3.2.4257/apps/gpl/mkfwimage/src/fwsplit.c (revision 3427)
@@ -26,8 +26,8 @@
#include
#include
#include
+#include

-
#include "fw.h"

static int debug = 0;

In apps/gpl/mkfwimage/src generate this file lx2-8.txt with this content:

kernel 0x01 0xA8030000 0x000D0000 0x80041000
0x80041000 nightwing_v0.6beta4-vmlinux.lzma
rootfs 0x02 0xA8100000 0x006C0000 0x00000000
0x00000000 nightwing_v0.6beta4-root.squashfs

In apps/gpl/mkfwimage/src download the files:

# wget http://nightwing.lugro-mesh.org.ar/download/0.6/nightwing_v0.6beta4-vmlinux.lzma
# wget http://nightwing.lugro-mesh.org.ar/download/0.6/nightwing_v0.6beta4-root.squashfs

And run this command:

# mkfwimage -i lx2-8.txt -v XS2.ar2316.OpenWRT-kamikaze -o nightwing_v0.6beta4-picostation2-squashfs.bin

Which returns something like:

Firmware version: 'XS2.ar2316.OpenWRT-kamikaze'
Output file: 'nightwing_v0.6beta4-picostation2-squashfs.bin'
Part count: 2
kernel: 720896 bytes (free: 131072)
rootfs: 1966080 bytes (free: 5111808)

Done, the image created to load in a PicoStation2. It's flashed according to the document: HowTo Flash Nightwing in an Ubiquiti device

All this was compiled by searching in google, source, openwrt forum, openwrt documentation and UBNT SDK. It was tested in 4 pico2, it flash correctly and is running smoothly.

Document created by: Cesar "kissas" Bermudez. Change _AT_ por @.
Licensed under: Creative Commons Atribución 2.5 Argentina