diff --git a/.cargo/config.toml b/.cargo/config.toml index fde396f..585f05a 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,11 @@ +[alias] +# Build the daemon with "firmware" profile and "ring" TLS backend. +# Requires a cross-compiler (see github actions workflows) and is very slow to build. +build-daemon-firmware = "build -p rayhunter-daemon --bin rayhunter-daemon --target armv7-unknown-linux-musleabihf --profile firmware --no-default-features --features ring-tls" +# Build the daemon with "firmware-devel" profile and "rustcrypto" backend. +# Works with just the Rust toolchain, and is medium-slow to build. Binaries are slightly larger. +build-daemon-firmware-devel = "build -p rayhunter-daemon --bin rayhunter-daemon --target armv7-unknown-linux-musleabihf --profile firmware-devel" + [target.aarch64-apple-darwin] linker = "rust-lld" rustflags = ["-C", "target-feature=+crt-static"] diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4fdf912..7e4105f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -258,7 +258,7 @@ jobs: # what the feature selection in rayhunter-daemon is. # # https://github.com/rust-lang/cargo/issues/4463 - CC_armv7_unknown_linux_musleabihf=arm-linux-gnueabihf-gcc cargo build -p rayhunter-daemon --bin rayhunter-daemon --target armv7-unknown-linux-musleabihf --profile=firmware --no-default-features --features ring-tls + CC_armv7_unknown_linux_musleabihf=arm-linux-gnueabihf-gcc cargo build-daemon-firmware - uses: actions/upload-artifact@v4 with: name: rayhunter-daemon diff --git a/doc/installing-from-source.md b/doc/installing-from-source.md index a35d6a6..be86c59 100644 --- a/doc/installing-from-source.md +++ b/doc/installing-from-source.md @@ -36,10 +36,12 @@ rustup target add x86_64-pc-windows-gnu Now you can root your device and install Rayhunter by running: ```sh -# Profile can be changed to 'firmware-devel' when building for development. -# Build time will decrease at the expense of binary size. -cargo build -p rayhunter-daemon --bin rayhunter-daemon --target armv7-unknown-linux-musleabihf --profile firmware +cargo build-daemon-firmware-devel +# Alternatively, if you have a cross-compilation toolchain for C installed, +# you can build it exactly like in CI: +# CC_armv7_unknown_linux_musleabihf=arm-linux-gnueabihf-gcc cargo build-daemon-firmware +# Build rootshell cargo build -p rootshell --bin rootshell --target armv7-unknown-linux-musleabihf --profile firmware # Replace 'orbic' with your device type if different. @@ -50,7 +52,7 @@ cargo run -p installer --bin installer orbic ### If you're on Windows or can't run the install scripts * Root your device on Windows using the instructions here: -* Build the web UI using `cd bin/web && npm install && npm run build` +* Build the web UI using `cd daemon/web && npm install && npm run build` * Push the scripts in `scripts/` to `/etc/init.d` on device and make a directory called `/data/rayhunter` using `adb shell` (and sshell for your root shell if you followed the steps above) * You also need to copy `config.toml.in` to `/data/rayhunter/config.toml`. Uncomment the `device` line and set the value to your device type if necessary. * Then run `./make.sh`, which will build the binary, push it over adb, and restart the device. Once it's restarted, Rayhunter should be running!