Compare commits
3 commits
c91e7a1989
...
3c614f48bd
Author | SHA1 | Date | |
---|---|---|---|
Andreas Mieke | 3c614f48bd | ||
Andreas Mieke | 89495dabd1 | ||
Andreas Mieke | cb4958ae3f |
39
.woodpecker.yml
Normal file
39
.woodpecker.yml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
settings:
|
||||||
|
dry-run: true
|
||||||
|
repo: git.merp.digital/${CI_REPO_OWNER}/${CI_REPO_NAME}
|
||||||
|
platforms: linux/amd64
|
||||||
|
registry: git.merp.digital
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch:
|
||||||
|
exclude: [develop, master]
|
||||||
|
|
||||||
|
publish-nightly:
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
settings:
|
||||||
|
repo: git.merp.digital/${CI_REPO_OWNER}/${CI_REPO_NAME}
|
||||||
|
platforms: linux/amd64
|
||||||
|
registry: git.merp.digital
|
||||||
|
tags: develop
|
||||||
|
username: ${CI_REPO_OWNER}
|
||||||
|
password:
|
||||||
|
from_secret: cb_token
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: develop
|
||||||
|
|
||||||
|
publish-release:
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
settings:
|
||||||
|
repo: git.merp.digital/${CI_REPO_OWNER}/${CI_REPO_NAME}
|
||||||
|
platforms: linux/amd64
|
||||||
|
registry: git.merp.digital
|
||||||
|
tags: ["latest", "${CI_COMMIT_TAG}"]
|
||||||
|
username: ${CI_REPO_OWNER}
|
||||||
|
password:
|
||||||
|
from_secret: cb_token
|
||||||
|
when:
|
||||||
|
- event: tag
|
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
FROM ghcr.io/cross-rs/mips-unknown-linux-musl:latest
|
||||||
|
RUN apt update && apt install -y git wget subversion build-essential libncurses5-dev zlib1g-dev gawk flex quilt git-core unzip libssl-dev python-dev python-pip libxml-parser-perl time
|
||||||
|
|
||||||
|
RUN git clone https://github.com/OnionIoT/source.git
|
||||||
|
|
||||||
|
COPY openwrt-build-config source/.config
|
||||||
|
|
||||||
|
ENV FORCE_UNSAFE_CONFIGURE=1
|
||||||
|
RUN cd source && make -j12
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 zenermerps
|
Copyright (c) 2024 zenermerps (Andreas Mieke)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
|
34
README.md
34
README.md
|
@ -1,3 +1,35 @@
|
||||||
# onion2s-build
|
# onion2s-build
|
||||||
|
Docker image for cross to build rust packages for the Onion Omega 2S(+)
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
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:
|
||||||
|
```toml
|
||||||
|
[workspace.metadata.cross.target.mipsel-unknown-linux-musl]
|
||||||
|
image = "git.merp.digital/zenermerps/onion2s-build:latest"
|
||||||
|
build-std = ["std"]
|
||||||
|
```
|
||||||
|
|
||||||
|
.cargo/config:
|
||||||
|
```toml
|
||||||
|
[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:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cross build --release --target mipsel-unknown-linux-musl
|
||||||
|
```
|
2966
openwrt-build-config
Normal file
2966
openwrt-build-config
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue