(prototype)
Expose ubus library to build OpenWRT Rust apps.
Requires cross installed.
Tested on:
- Windows WSL (requires Docker)
- Windows (does not work/requires Docker)
cross build --target mips-unknown-linux-musl -p ubus-cli
Then scp
the executable files on target/mips-unknown-linux-musl
Add this as a dependency:
[dependencies]
ubus-sys = { git = "https://github.com/bltavares/ubus-rs" }
Copy the custom Cross.toml
file from this project to yours, in order to use an image that works with OpenWRT for cross-compilation.
Then it should be possible to run:
cross build --target mips-unknown-linux-musl
No promises there...
cross build --target mips-unknown-linux-musl -p ubus-cli --release
docker run --rm -v ${PWD}/target/mips-unknown-linux-musl/release:/target bltavares/rust-cross-mips-openwrt mips-linux-muslsf-strip /target/ubus-cli
scp target/mips-unknown-linux-musl/release/ubus-cli root@router.ip:~/ubus-cli