## Natively on [[macOS]] ### [[OpenWrt]] dev dependencies The `sudo apt-get` line installs the [[OpenWrt]] dev dependencies, but it's written for Linux. To install OpenWrt dependencies for your OS, read the docs here, and use the OS-specific instructions to set up the dev dependencies: https://openwrt.org/docs/guide-developer/start ![[Screen Shot 2021-08-22 at 9.25.36 PM.png]] For MacOS: ```shell hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage hdiutil attach OpenWrt.sparseimage cd /Volumes/OpenWrt brew install coreutils findutils gawk grep gnu-getopt gnu-tar wget diffutils git-extras quilt make ncurses pkg-config ``` Create a file called `env.sh` in `/Volumes/OpenWrt` to allow the utilities we just installed to be used instead of the macOS provided ones: ```shell PATH="/usr/local/opt/make/libexec/gnubin:$PATH" PATH="/usr/local/opt/gnu-getopt/bin:$PATH" PATH="/usr/local/opt/gettext/bin:$PATH" PATH="/usr/local/opt/coreutils/bin:$PATH" PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH" export PATH ``` Run the script to add these entries to your `PATH`. **You will need to do this anytime you begin working on OpenNDS in a new terminal window.** ```shell source env.sh ``` Check that the variables have been included in your `PATH`: ```shell echo $PATH ``` ### Compiling OpenNDS Continue on the OpenNDS tutorial, skipping the `sudo apt-get` line since dev dependencies were already built using macOS-specific instructions. ```shell # Enter the OpenWrt volume cd /Volumes/OpenWrt # Clone OpenWrt and the Higher-Brothers fork of OpenNDS: git clone https://git.openwrt.org/openwrt/openwrt.git git clone git://github.com/Higher-Brothers/opennds.git # Run the OpenWrt installation scripts, uninstalling the OpenNDS that comes packaged with OpenWrt by default: cd openwrt ./scripts/feeds update -a ./scripts/feeds install -a ./scripts/feeds uninstall opennds # Symlink the Higher-Brothers OpenNDS fork into the OpenWrt packages, rather than stock cd /Volumes/OpenWrt/openwrt/package/feeds/routing ln -s /Volumes/OpenWrt/opennds/linux_openwrt/opennds opennds # Go back to the root of the OpenWrt clone cd ../../.. # Generate config files make defconfig make menuconfig ``` ### Menu config (continue following the instructions) ### Compile / build ```shell make ``` This will take a while, possibly a few hours. ### Failure Not a supported build option