How to build zeronsd on Raspberry Pi 0/1

As a decade-long, proud owner of a Raspberry Pi 1 B I find satisfaction in finding good use cases for this little board. I also happen to have a couple of Linux hosts scattered around the world for that I use zerotier to access. To use names instead of IP addresses in my ansible script keeping apt updated on them, I was very happy to find zeronsd. As I only use x86/amd64 occasionally but I keep my Raspberry Pi 1 B on all the time, the ideal place for me to run zeronsd is my Raspberry Pi 1 B. Since there are no pre-build images for ARM (let alone ARMv6) in the github repo I took the heavy lifting to figure out how to build zeronsd on Raspberry Pi 0/1 ARMv6 architecture. As these little boards only have 512M RAM it is important to use Raspberry Pi OS Lite (32-bit) for this build process unless you are ready to increase swap size to 512M which case I could also build with default desktop Raspberry Pi OS (32-bit). After flashing and updating this OS the following commands build zeronsd on this platform:

sudo apt install librust-openssl-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install --git https://github.com/zerotier/zeronsd --branch main --jobs 1

Please note I had to use the latest 1.69.0 version of cargo and build the main 0.5.2 branch of zeronsd that takes almost 10 hours to build on this little board. I managed to cross-compile in much less time on an AMD Ryzen but I had to use vendored openssl and the resulting binary has become 10 times the size so I decided to share the above method instead.
Hope this will be useful for someone in similar needs like me.

2 Likes

Bumping this post to the top with an update.

I can confirm that this works with bookworm lite 64 bit on a pi4 board with 8GB

sudo /usr/bin/apt-get -y install net-tools librust-openssl-dev pkg-config cargo
cargo install --git https://github.com/zerotier/zeronsd --branch main --jobs 1

run cargo --version to make sure it is >> 1.63 current is 1.75
slight modification from the tutorial at DNS | ZeroTier Documentation following the tutorial breaks at compiling zerotier api and exits.

Thanks to the OP for helping me with his old post.

1 Like