This Pad describes the process of rebuilding the Kernel for EdgeMAX ER-e50 Devices (ER-X, ER-X-SFP, EP-R6) to add BATMAN Advanced support

  1. Requiremets
    1. Download Ubiquiti GPL Archive: https://www.ubnt.com/download/edgemax/edgerouter-x-sfp/default/edgerouter-er-xer-x-sfpep-r6-firmware-v180
    2. Download Buildroot 2016.02: https://buildroot.org/download.html
    3. Download batman-adv, batctl and alfred sources: https://downloads.open-mesh.org/batman/releases
    4. Install u-boot-tools binfmt-support qemu qemu-user-static debootstrap lzma-alone
  2. Build MIPS Toolchain
    1. Extract buildroot and change to extracted folder
    2. make menuconfig
    1. make
  1. Crosscompile Kernel
    1. Extract Ubiquiti sources
    2. Change to extracted folder (usually ./sources)
    3. extract kernel sources and change to extraced folder
    4. replace .config with https://gist.github.com/belzebub40k/5f3d7cb946a19d5271823f81cd28f8a7#file-kernel-config-ffmwu
    5. sadly the supplied kernel only supprts gzip as output format so we need to patch it
    1. append MIPS Toolchain to $PATH
    1. Build kernel/u-boot image
    1. Boot image via TFTP
  1. Crosscompile batman-adv
    1. extract source tarball and change to extracted folder
    2. build with UBNT kernel sources
    1. copy ./net/batman-adv/batman-adv.ko to EdgeOS
    2. load module
  1. Crosscompile userland applications
    1. Debootstrap Debian Wheezy MIPSel
    1. Build packages as described in their READMEs


==== TODO =====

Link to the Pad