# HOWTO Build Maxwell This documents how to build the Maxwell meshing software with OpenWRT. Base system is Debian Bullseye (11/testing) on ppc64le architecture. Should also work fine on x86_64. # Build thang Do. OpenWRT build system: * https://openwrt.org/docs/guide-developer/build-system/start ## Install Dependencies Dependencies for other distros are listed here: * https://openwrt.org/docs/guide-developer/build-system/install-buildsystem#examp Get current: ``` apt update ``` Upstream command suggests for Debian: ``` apt install build-essential ccache ecj fastjar file g++ gawk \ gettext git java-propose-classpath libelf-dev libncurses5-dev \ libncursesw5-dev libssl-dev python python2.7-dev python3 unzip wget \ python3-distutils python3-setuptools python3-dev rsync subversion swig time \ xsltproc zlib1g-dev ``` Full docs list more dependencies for full list, that work with Debian Bullseye. Takes over 6 gigs on root filesystem ``` apt install \ asciidoc \ bash \ binutils \ bzip2 \ flex \ git-core \ g++ \ gcc \ util-linux \ gawk \ help2man \ intltool \ libelf-dev \ zlib1g-dev \ make \ libncurses5-dev \ libssl-dev \ patch \ perl-modules \ python2-dev \ python3-dev \ unzip \ wget \ gettext \ xsltproc \ zlib1g-dev \ libboost-dev \ libxml-parser-perl \ libusb-dev \ bin86 \ bcc \ sharutils ``` Maybe want to use `ccache` to save on rebuilds: ``` apt install ccache ``` Add to your `~/.bashrc`: ``` PATH=/usr/lib/ccache:$PATH ``` Then log out and back in and run `echo $PATH` to make sure it is there. Run `ccache -s` during build to see cache hit rate. ## Get Source Clone OpenWRT sources, around ~300 megs: ``` git clone https://git.openwrt.org/openwrt/openwrt.git ``` Add Maxwell source code, around ~5 megs, to `openwrt` directory: ``` cd openwrt git clone https://github.com/drandyhaas/haasmesh.git ``` ## Configure Build If you've done other builds, it is good to clean up first, maybe: ``` make clean ``` There are a variety of units the setup script is compatible with: * luma * Maxwell Indoor 3-Band: ea8300 * Maxwell Outdoor 2-Band: ew72 * c7v2 * c7v5 * jetstream * redmi You will need to check out the correct git branch or commit depending on your radio. To get the stock version `OpenWrt 19.07.4, r11208-ce6496d796` of the Maxwell Indoor 3-Band EA8300: ``` git checkout ce6496d796 ``` To get the stock version `OpenWrt SNAPSHOT, r14229-b52b4afa15` of the Maxwell Outdoor 2-Band EW-72: ``` git checkout b52b4afa15 ``` TODO: Add more versions, newer releases. To build, run the build script with one of these options. ``` haasmesh/script/setupnodebuild.sh [luma|ea8300|ew72|c7v2|c7v5|jetstream|redmi] ``` For example, to configure the build system for the Maxwell Outdoor 2-Band, run: ``` haasmesh/script/setupnodebuild.sh ew72 ``` The configure script should run in ~1 second. Once it is configured, run the menuconfig: ``` make menuconfig ``` Hit `` to get to `EXIT`, then `` to select `Yes` to save the configuration. ## Build Source Now, actually build it. Takes over an hour or two, depending on hardware. ``` make ```