# [[OpenNDS]] Dev Setup via [[OpenWrt]] SDK on [[Docker]]
Instructions here: https://hub.docker.com/r/openwrtorg/sdk
## Attempt 1
```shell
# Open some dev folder
cd ~/projects
# Get the docker image
docker run --rm -v "$(pwd)"/bin/:/home/build/openwrt/bin -it openwrtorg/sdk
# Run the OpenWrt installation scripts, uninstalling the OpenNDS that comes packaged with OpenWrt by default:
./scripts/feeds update -a
./scripts/feeds install -a
./scripts/feeds uninstall opennds
# Go back to the home dir
cd ~
# Clone the Higher-Brothers fork of OpenNDS:
git clone git://github.com/Higher-Brothers/opennds.git
# Copy the Higher-Brothers OpenNDS package into OpenWrt:
cp -rf ~/opennds/linux_openwrt/opennds ~/openwrt/package/feeds/routing
# Generate config files
cd openwrt
make defconfig
# Config, follow the Open
make menuconfig
```
Didn't work:
- Couldn't configure targets in menuconfig - options not available
- Couldn't compile either, using their `firewall` package example but substituted to `opennds` (and without the `-j` flag)
## openwrt/docker
https://github.com/openwrt/docker
- Looks like SDK is the one we need
## Attempt 2
```shell
# Open dev folder
cd ~/projects
# Get and enter the container
docker run -it openwrtorg/sdk
# Install OpenNDS build system prerequisites
# Documented here (duplicates intentionally left in):
# https://opennds.readthedocs.io/en/stable/compile.html#openwrt-package
sudo apt install git subversion g++ libncurses5-dev gawk zlib1g-dev build-essential
# Go to home dir
cd
# 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
# Copy the Higher-Brothers OpenNDS package into OpenWrt:
cp -rf ~/opennds/linux_openwrt/opennds ~/openwrt/package/feeds/routing
# Generate config files
make defconfig
# Config, follow the OpenNDS instructions
# make menuconfig
# Compile / build
# Optionally add -jN to parallize to N cores,
# e.g. if your computer has 4 cores, run `make -j4`
make
```
`spidev_test` fails
![[Screen Shot 2021-08-23 at 6.41.29 PM.png]]