Compiling “crowdsec” (v.1.4.1) for aarch64 / arm64 (OpenWrt / FriendlyWrt 22.03)?

Build system: Ubuntu 22.04.1 LTS (5.15.0-48-generic) on x86_64
Host system: FriendlyWRT NanoPi R4SE running FriendlyWRT 22.03;

Hello,

Recently tried out FriendlyWRT which is a fork (?) of OpenWRT and got quite far using the existing package for OpenWRT;
crowdsec for OpenWRT 22.03;
/releases/packages-22.03/aarch64_cortex-a53/packages/crowdsec_1.3.0-3_aarch64_cortex-a53
however in OpenWRT 22.03 the package for “cs-firewall-bouncer” is missing as multiple people have reported but it exists on 21.02 (ex below is for 21.02.3);
releases/21.02.3/packages/aarch64_cortex-a53/packages/crowdsec-firewall-bouncer_0.0.21-3_aarch64_cortex-a53.ipk

I did get so far as to get both the agent and bouncer registered onto the web dashboard and installed multiple scenarios.
However when trying to simulate scenarios and list decisions using the instructions shown under “Simulation” in CrowdSec’s user guide no decisions were shown and I received an error when checking the log.
I didn’t save that error (sat late last night) and decided to see if it’s possible to compile the latest version for:
crowdsec (v.1.4.1);
for aarch64?

“cs-firewall-bouncer” seem to already have a precompiled version for “aarch64” which I believe was the one I installed when trying it out manually instead of trying out the package available in OpenWRT’s repo;

Now this is my very first time trying to “make” something from source so be nice:

Using these general instructions on my Ubuntu VM;
https://jensd.be/1126/linux/cross-compiling-for-arm-or-aarch64-on-debian-or-ubuntu

  1. Downloading the source code for 1.4.1:
    wget https://github.com/crowdsecurity/crowdsec/archive/refs/tags/v1.4.1.tar.gz
  2. Installing necessary build-tools for crosscompiling aarch64 / arm64 on x86_64:
    sudo apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
  3. Extracting the compressed file:
tar -xf v1.4.1.tar.gz
cd crowdsec-1.4.1
  1. Trying to run “configure”;
    ./configure --build x86_64-pc-linux-gnu --host aarch64-linux-gnu
    returns
    bash: ./configure: No such file or directory
  2. Ok so no “configure”-file, lets try to run make “as-is” (“make”) which returns (log-snippet):
Building for linux
[...]
/bin/sh: 1: git: not found
/bin/sh: 1: go: not found
[...]
make[1]: *** [Makefile:29: build] Error 127
make: *** [Makefile:122: crowdsec] Error 2
  1. Ok so seem to be missing “go” and “git”, lets install them:
sudo apt-get install golang
sudo apt install git
  1. “make” now returns (log-snippet):
[...]
make -C ./plugins/notifications/dummy build --no-print-directory GOARCH=amd64 GOOS=linux RM="rm -rf" WIN_IGNORE_ERR="" CP="cp" CPR="cp -r" MKDIR="mkdir -p"
fatal: not a git repository (or any of the parent directories): .git

Err…well that (running “make” to make a native x86_64-build) didn’t (?) work I guess?
Any suggestions?

It might be well above someone who is just delving into this to do a crosscompilation of x86_64 to aarch64 / arm64 and even if the compilation would work it would require a lot more work?

Sorry for a long post and thanks for getting this far regardless of if you answer or not! / Karl