Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work on raspberry pi 3 / arm ? #225

Open
anarchy89 opened this issue Jun 20, 2022 · 9 comments
Open

Does it work on raspberry pi 3 / arm ? #225

anarchy89 opened this issue Jun 20, 2022 · 9 comments

Comments

@anarchy89
Copy link

Can this be installed on debian on raspberry pi 3?

@strohel
Copy link
Member

strohel commented Jun 21, 2022

Hi, @anarchy89, I'm successfully running innernet on Raspberry 4B, so I think it should work. I've compiled from sources by installing the Rust toolchain on the Pi and then running cargo install https://github.com/tonarino/innernet.git client (or something like this).

BTW, innernet's GitHub Discussions is the best place to ask support questions.

@stheid
Copy link

stheid commented Jul 8, 2022

image

Except it does not build on a fresh Raspberry Pi OS.

@bschwind
Copy link
Member

bschwind commented Jul 9, 2022

Hi @stheid , you'll likely need a newer version of cargo/rustc than what's currently installed on that raspberry pi. I think you need Rust 1.56 or later.

@alerque
Copy link
Contributor

alerque commented Jul 9, 2022

Hardware wise sure. I'm running it on even older 1st gen PIs. You just have to compile it. You'll need a newish Rust and such. As long as you have a supported kernel and Rust and a platform Rust can compile to innernet shouldn't be a problem.

@stheid
Copy link

stheid commented Jul 10, 2022

curl https://sh.rustup.rs -sSf | sh
cargo install --git https://github.com/tonarino/innernet --tag v1.5.4 client

Brought me further. thanks for the fast replies.

Maybe it would be a good idea to add the first command to the readme as this will effect everyone that uses a debian-based system that rolls out software from the last century :D

It fails after 2:30 hours, with a segfault though. I assume it gets killed because 500MB RAM of my Pi1B is probalbly not sufficient for compilation...

@esbeeb
Copy link

esbeeb commented Sep 24, 2022

If you had a ton of patience, you could attach an external drive (spinning rust, or lower-powered SSD) via USB, and format it with a swap partition. Then use the "swapon" and "swapoff" commands to temporarily use that additional swap. I hand-compiled the Veloren server once using this trick (also written in rust, build took more RAM than I had).

@bschwind
Copy link
Member

bschwind commented Oct 3, 2022

I've successfully built innernet on a Pi 4 (faster/better hardware, I know) by increasing the swap. The default swap settings resulted in a failed build.

I followed steps here to enable it.

sudo dphys-swapfile swapoff
sudo vim /etc/dphys-swapfile

Here is the contents of /etc/dphys-swapfile (I set the swap size to 2GB):

# /etc/dphys-swapfile - user settings for dphys-swapfile package
# author Neil Franklin, last modification 2010.05.05
# copyright ETH Zuerich Physics Departement
#   use under either modified/non-advertising BSD or GPL license

# this file is sourced with . so full normal sh syntax applies

# the default settings are added as commented out CONF_*=* lines


# where we want the swapfile to be, this is the default
#CONF_SWAPFILE=/var/swap

# set size to absolute value, leaving empty (default) then uses computed value
#   you most likely don't want this, unless you have an special disk situation
CONF_SWAPSIZE=2048

# set size to computed value, this times RAM size, dynamically adapts,
#   guarantees that there is enough swap without wasting disk space on excess
#CONF_SWAPFACTOR=2

# restrict size (computed and absolute!) to maximally this limit
#   can be set to empty for no limit, but beware of filled partitions!
#   this is/was a (outdated?) 32bit kernel limit (in MBytes), do not overrun it
#   but is also sensible on 64bit to prevent filling /var or even / partition
#CONF_MAXSWAP=2048

Then:

sudo dphys-swapfile setup
sudo dphys-swapfile swapon

I did this as well, but I'm not sure if it's necessary as I didn't test without it after setting up a swapfile:

export CARGO_BUILD_JOBS=1

After that I was able to run cargo build --release as normal and it succeeded.

The more proper version will be to cross-compile for ARM targets in github CI when releases are cut.

@esbeeb
Copy link

esbeeb commented Nov 3, 2022

I just compiled innernet 1.5.5 on Raspberry Pi OS lite 64bit, on a Raspberry Pi 4B with 2GB of RAM. I had disabled the small amount of default swap. As in:

sudo apt remove dphys-swapfile

... trusting the 2GB would be enough. I kept an eye on the used RAM, to see if it would run out. The rust compile briefly surged above 1GB of usage by a couple hundred MB or so (and this is command-line only, no desktop environment).

So yeah, you'll have no compilation problems whatsoever on a Raspberry Pi with >= 2GB of RAM.

@ekini
Copy link

ekini commented Jan 17, 2023

I successfully crosscompiled it for pi 3 on my x86 machine. Needed 2 things:
In ~/.cargo/config:

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
rustflags = ["-C", "target-feature=+crt-static"]

And then

    cargo deb -p client --target armv7-unknown-linux-gnueabihf

Of course the rust toolchaing and arm-linux-gnueabihf-gcc need to be installed (OS-specific).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants