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;
However since the agent that is available for 21.02 is 1.3.0.3 and the latest agent is 1.4.1 I would like to try and compile it from source.
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
-
Downloading the source code for 1.4.1:
wget https://github.com/crowdsecurity/crowdsec/archive/refs/tags/v1.4.1.tar.gz
-
Installing necessary build-tools for crosscompiling aarch64 / arm64 on x86_64:
sudo apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
-
Extracting the compressed file:
tar -xf v1.4.1.tar.gz
cd crowdsec-1.4.1
-
Trying to run “configure”;
./configure --build x86_64-pc-linux-gnu --host aarch64-linux-gnu
returns
bash: ./configure: No such file or directory
-
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
- Ok so seem to be missing “go” and “git”, lets install them:
sudo apt-get install golang
sudo apt install git
- “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