Here´s my little tutorial:
-
Download Firmware Mod Kit v0.99: Google Code Archive - Long-term storage for Google Code Project Hosting.
https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/firmware-mod-kit/fmk_099.tar.gz
Note: if there’s a problem while extracting firmware, check that ${BINWALK} is really pointing to the binwalk binary. I just replaced ${BINWALK} with binwalk inside extract-firmware.sh file
Follow Google Code Archive - Long-term storage for Google Code Project Hosting. in order to have all the required dependencies.
-
Clone GitHub - domino-team/openwrt-cc: openwrt CC with Domino/GL patches
Install required dependencies.
Update and Install the Feeds (follow instructions in their main page)
-
Download WifiPineApple NANO firmware WiFi Pineapple - Downloads
(v1.0.6)
Note that the kernel in use here is 3.18.23 (we will do some modifications on this later)
-
Extract the files in NANO’s firm “upgrade-1.0.6”:
cd firmware-mod-kit
./extract-firmware.sh upgrade-1.0.6
(remember that if there’s a problem it might be because the binwalk binary is wrongly specified, check step 1)
-
After the successful extraction, in the same directory, under fmw/rootfs, the full “filesystem” of the NANO will appear. All files in there should be copied into a new directory called “files” in the openwrt-cc main directory (this is for customizing the final result, as shown in OpenWrt Buildroot – Uso [Old OpenWrt Wiki] — Custom Files section —). So:
cd openwrt-cc
mkdir files
then
cp -R firmware-mod-kit/fmw/rootfs/* openwrt-cc/files/
Example of the final result:
root@kali:~/Desktop/openwrt-cc/files# ls
bin etc mnt pineapple rom sbin tmp var
dev lib overlay proc root sys usr www
We are going to refer to this directory structure as “The Pineapple NANO” one.
-
Now, some magic tricks are needed from here:
a)
Remove the “modules” directory in /lib/ of the above structure:
rm -rf openwrt-cc/files/lib/modules
The modules for NANO v1.0.6 (kernel 3.18.23) conflict with the current in openwrt-cc project (3.18.27). It’s OK if we completely remove them. I think that this first trick will work for every update even for NANO or for the openwrt-cc project.
b)
Remove the modprobe binary (under the /sbin/ dir) and all the iptables* + ip6tables binaries (under /usr/sbin/ dir) in the PineApple NANO directory structure
I found that because of the difference on the kernel version, these two little guys weren’t working without doing this magic trick #2. And they are VERY necessary (example SSLsplit module).
-
Now, we are ready to cross compile! First, lets add some modules we will probably use later:
root@kali:~/Desktop/openwrt-cc# make menuconfig
a) Change “Target Profile” to match “GL-AR150”
b) Kernel Modules -> Wireless Drivers -> kmod-rtl8187 (so we can connect an ALFA wifi device with a REALTEK 8187 chipset using the USB port available in the AR150. Select any other chipset or install it later using opkg)
Save config and Exit.
b) Time to make, time to wait (from half an hour to 5 or 6 hours 
make -j1 V=s
-
If everything went fine (I can promise it works!) under the bin/ar71xx directory you will find a lot of binaries, the one we will use is:
ls -la openwrt-ar71xx-generic-gl-ar150-squashfs-sysupgrade.bin
-rw-r–r-- 1 root root 14155780 May 13 14:58 openwrt-ar71xx-generic-gl-ar150-squashfs-sysupgrade.bin
(size could be slightly different, but always <16MB!)
-
Replace the firmware on the AR150 with this one, following the UBOOT procedure or just using the GLInet custom web interface (the second one will check if everything on the binary is “OK”). Remember if you use the second procedure to de-select the “Keep current config” options. We need to start from a clear config.
-
Connect to the “WAN” port and wait for the DHCP from the AR150 to offer one new IP like 172.16.42.XXX (important: USE THE WAN PORT!!! I lost a few hours dealing with this, so disconnect from the LAN port and connect to the WAN port now)
-
Using any browser: http://172.16.42.1:1471
-
Follow the procedures for the very first time, use the reset button on the AR150 when asked to “press the reset button on the NANO” after the initial step. Configure a password and the rest of the things. Done!
-
As the NANO has one USB port acting as an eth and two wlan interfaces, some of the internal scripts will fail since they are using hardcoded identifiers (example: wlan1 for the “Recon - AP&Client” module and there is no wlan1 in our current config). So a few more fine tuning should be executed.
Can can connect an ALFA device and it will be immediately recognized as wlan1, so with that we can work perfectly without modifying any of the modules.
-
iptables should be working OK at this point, but we will need to run the following command to update our kmod utilities for the current kernel:
root@Pineapple:~# opkg install kmod -force-overwrite
-
Try iptables -L and modprobe both should be working OK now.