Docker image for cross to build rust packages for the Onion Omega 2S(+)
Go to file
Andreas Mieke 7d1aba878c
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Merge branch 'release/1.0.0' into develop
2024-07-26 11:38:19 -04:00
.gitignore Initial commit 2024-07-26 06:34:07 +00:00
.woodpecker.yml feat(build): Add Docker build 2024-07-26 05:49:36 -04:00
Dockerfile feat(build): Add Docker build 2024-07-26 05:49:36 -04:00
LICENSE feat(build): Add Docker build 2024-07-26 05:49:36 -04:00
openwrt-build-config feat(build): Add Docker build 2024-07-26 05:49:36 -04:00
README.md chore: Add content to README 2024-07-26 11:37:34 -04:00

onion2s-build

Docker image for cross to build rust packages for the Onion Omega 2S(+)

Prerequisites

You will need to have the rustup version of cargo installed, for more information look at the official Rust documentation. You need Docker (or Podman) up and running, and you need to install cross with:

cargo install cross --git https://github.com/cross-rs/cross

Configuration

To compile for the Onion Omega 2S(+) you need to add the following configuration:

Cargo.toml:

[workspace.metadata.cross.target.mipsel-unknown-linux-musl]
image = "git.merp.digital/zenermerps/onion2s-build:latest"
build-std = ["std"]

.cargo/config:

[target.mipsel-unknown-linux-musl]
linker = "/source/staging_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/bin/mipsel-openwrt-linux-musl-gcc"

Note: cargo will complain that this location is deprecated, however (at least on macOS) moving the file to the suggested location results in an error about Cargo.toml not being found (while a cargo.toml exists). I assume this is due to some discrepancy between macOS's case-insensitive vs Linux's case-sensistive file system.

Build

You then can use cross as replacement for cargo, you need to specify the target with: --target mipsel-unknown-linux-musl, this is all you need to compile for the Onion Omega 2S(+).

For example:

cross build --release --target mipsel-unknown-linux-musl