Zoxc / crusader

A network throughput and latency tester.
Apache License 2.0
107 stars 8 forks source link

Crusader builds for other OpenWrt architectures than aarch64? #56

Closed richb-hanover closed 5 days ago

richb-hanover commented 2 weeks ago

I think it would be cool to give instructions for running Crusader Server on lots of different OpenWrt devices. (And I would be willing to write the document.) I know the aarch64...linux build works great for the GL.iNet GL-MT6000 router. But there are a zillion combinations that I don't entirely understand.

To get a handle on the problem, I made a table of all OpenWrt devices and their architectures. It's at: https://openwrt.org/playground/richb/alttoh To use it , enter "23.05" in the Supported Current Release column, and sort by the "Package Architecture" column. It shows many variations:

My questions:

Many thanks

Zoxc commented 2 weeks ago

arm_cortex should work with arm-unknown-linux-musleabihf and aarch64 with aarch64-unknown-linux-musl. I probably wouldn't bother with older and slower ARM / MIPS variants.

richb-hanover commented 2 weeks ago

Good information. Thanks

richb-hanover commented 2 weeks ago

@Zoxc Follow-up: I think I understand how this works. Is the following correct?

Once it is correct, we can talk about where/when to post it. (I'm not looking to talk Crusader up to a broad audience before you think it's ready...)


Crusader on OpenWrt

The Crusader pre-built binaries work well for certain OpenWrt devices/architectures: aarch64, arm, and x86_64.

To determine if your router can run a pre-built binary, enter its Model in the Table of Hardware and find its Package architecture column. If it's listed in the table below, retrieve the proper binary from latest pre-built binary page using the table below:

Architecture Latest Pre-built Binary
aarch64 (all architectures) [^1] crusader-aarch64-unknown-linux-musl.tar.gz
arm_cortex, arm_mpcore [^2] crusader-arm-unknown-linux-musleabihf.tar.gz
x86_64 crusader-x86_64-unknown-linux-musl.tar.gz
other architectures [^3] No pre-built binary

Installing/Running Crusader on OpenWrt

SSH into the router, then download the proper pre-built binary to your computer. A good place is /usr/bin. Then extract the binaries, and execute ./crusader serve to start the Crusader server. To stop the server, use ^C (Control-C). This set of commands below will:

cd /usr/bin
mkdir -p crusader-prebuilt
cd crusader-prebuilt
wget -O crusader.tar.gz <link-to-pre-built-binary>
tar -xzvf crusader.tar.gz 
cp crusader-*/crusader .
./crusader serve
# ^C to stop the server

To keep the Crusader server running after logging out, change the last command to
./crusader serve > /tmp/output.log 2>&1 & This will keep the Crusader server running until a reboot, or until you kill -9 the process. Alternatively, check into procd init scripts that would start the Crusader when the router boots up.

[^1]: More generally, crusader-aarch64-unknown-linux-musl works on 64-bit ARMv8-A (and higher).

[^2]: Similarly, crusader-arm-unknown-linux-musleabihf works on ARMv7-A (and higher) processors

[^3]:The other architectures (mips, powerpc, risc, etc.) tend to be used in older devices that may not have the CPU power to run Crusader. You could try building your own version from source.

Zoxc commented 2 weeks ago

There's no prebuilt i686 (32-bit x86) binary for Linux. x86_64 (not x86) would map to crusader-x86_64-unknown-linux-musl.

richb-hanover commented 2 weeks ago

I edited the text above - did I get it right? Thanks

Zoxc commented 2 weeks ago

You'd still want the arm_cortex to arm mapping.

richb-hanover commented 2 weeks ago

You'd still want the arm_cortex to arm mapping.

Here's where I display my ignorance. The ToH linked above lists devices as having many different "arm" architectures. When I search for my own router, I'll see one of the choices below.

How can I tell whether the pre-built arm binary for Crusader will work? Does the crusader-arm-unknown-linux-musleabihf.tar.gz build work on all these? On only the ones labeled "cortex"? Is there some other flag/hint? Thanks.

Zoxc commented 2 weeks ago

Just the arm_cortex ones and arm_mpcore which is a special Cortex A9 variant for some reason.

Zoxc commented 2 weeks ago

More generally crusader-arm-unknown-linux-musleabihf works on ARMv7-A (and higher) processors and crusader-aarch64-unknown-linux-musl works on 64-bit ARMv8-A (and higher).

richb-hanover commented 2 weeks ago

Thanks. I updated the note above with the info so far.

I also see that the ToH lists aarch64_cortex-53, aarch64_cortex-72, and aarch64_generic. Which of these would work with a pre-built binary? Anything else I should mention? Thanks again

Zoxc commented 2 weeks ago

Which of these would work with a pre-built binary?

All of them should.

richb-hanover commented 2 weeks ago

Thanks. Any comments on the (new) Installing / Running... section? Thanks again

Zoxc commented 2 weeks ago

You'd probably want to run it as a service to deal with crashes or reboots.

https://openwrt.org/docs/techref/initscripts / https://openwrt.org/docs/guide-developer/procd-init-scripts

richb-hanover commented 2 weeks ago

Good point. I updated the description above to mention procd init scripts.

A different question: how much more work do you expect to do on Crusader before it's "good enough" to release to a broader audience? This relates to testing of new features; documentation of any new features; descriptions of how to use it; etc. I'm happy to help with some of this. Thanks again

Zoxc commented 2 weeks ago

how much more work do you expect to do on Crusader before it's "good enough" to release to a broader audience?

I'm wondering if it makes sense to have a simplified GUI that focuses on just the client / server and hides other features and test parameters.

richb-hanover commented 2 weeks ago

I'm moving this conversation to a new issue... #61

richb-hanover commented 5 days ago

Crusader is in great shape. Closing...