7

If you skip this step, type in the routers password manually when the script asks for it.

Install dependencies

sudo apt update
sudo apt install git libgmp3-dev gawk qpdf bison flex make automake texinfo libtool-bin g++ python2 python-is-python2
sudo reboot

Install Nexmon

We will cross-compile Nexmon_CSI on your VM and then send it to the RT AC86-U.

cd ~
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libc6:i386 libncurses5:i386 libstdc++6:i386

git clone <https://github.com/seemoo-lab/nexmon.git>
cd nexmon
source setup_env.sh
make

cd patches/bcm4366c0/10_10_122_20/
git clone <https://github.com/seemoo-lab/nexmon_csi.git>
cd nexmon_csi
make install-firmware REMOTEADDR=<RT AC86Us IP Address>

Get Merlin Toolchain

cd ~
git clone <https://github.com/RMerl/am-toolchains.git>
export AMCC=$(pwd)/am-toolchains/brcm-arm-hnd/crosstools-aarch64-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/bin/aarch64-buildroot-linux-gnu-
export LD_LIBRARY_PATH=$(pwd)/am-toolchains/brcm-arm-hnd/crosstools-aarch64-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/lib

Build Nexutil

Let's cross-compile Nexutil.

cd nexmon/utilities/libnexio
${AMCC}gcc -c libnexio.c -o libnexio.o -DBUILD_ON_RPI
${AMCC}ar rcs libnexio.a libnexio.o
cd ../nexutil
echo "typedef uint32_t uint;" > types.h
sed -i 's/argp-extern/argp/' nexutil.c
${AMCC}gcc -static -o nexutil nexutil.c bcmwifi_channels.c b64-encode.c b64-decode.c -DBUILD_ON_RPI -DVERSION=0 -I. -I../libnexio -I../../patches/include -L../libnexio/ -lnexio

# Install Nexutil on the router
scp nexutil admin@<IP address of your RT-AC86u>:/jffs/nexutil
ssh admin@<IP address of your RT-AC86u> "/bin/chmod +x /jffs/nexutil"

Build Makecsiparams