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 | sh
cargo install --git --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.

1 Like