jm-observer / ubus-rs

(prototype) providing openwrt ubus functionallity in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ubus-rs

(prototype)

Expose ubus library to build OpenWRT Rust apps.

Compile the project

Requires cross installed.

⚠️ Has git submodules. ⚠️

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

Using this as a library to build other projects

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...

Release

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

About

(prototype) providing openwrt ubus functionallity in Rust


Languages

Language:RenderScript 91.6%Language:Rust 8.3%Language:C 0.1%