All checks were successful
Run Check Script / check (pull_request) Successful in 1m54s
44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
# Cross-compile agent crates for aarch64 (Raspberry Pi)
|
|
#
|
|
# Prerequisites (Debian/Ubuntu):
|
|
# sudo apt install gcc-aarch64-linux-gnu
|
|
# rustup target add aarch64-unknown-linux-gnu
|
|
#
|
|
# Prerequisites (Arch Linux):
|
|
# sudo pacman -S aarch64-linux-gnu-gcc
|
|
# rustup target add aarch64-unknown-linux-gnu
|
|
|
|
TARGET="aarch64-unknown-linux-gnu"
|
|
|
|
echo "=== Cross-compiling for $TARGET ==="
|
|
|
|
# Check prerequisites
|
|
if ! rustup target list --installed | grep -q "$TARGET"; then
|
|
echo "ERROR: Rust target $TARGET not installed. Run: rustup target add $TARGET"
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v aarch64-linux-gnu-gcc > /dev/null 2>&1; then
|
|
echo "ERROR: aarch64-linux-gnu-gcc not found. Install the cross-compilation toolchain."
|
|
echo " Debian/Ubuntu: sudo apt install gcc-aarch64-linux-gnu"
|
|
echo " Arch Linux: sudo pacman -S aarch64-linux-gnu-gcc"
|
|
exit 1
|
|
fi
|
|
|
|
echo "--- Building harmony_agent ---"
|
|
cargo build --release --target "$TARGET" -p harmony_agent
|
|
|
|
echo "--- Building harmony_inventory_agent ---"
|
|
cargo build --release --target "$TARGET" -p harmony_inventory_agent
|
|
|
|
echo ""
|
|
echo "=== Build complete ==="
|
|
echo "Binaries:"
|
|
echo " target/$TARGET/release/harmony_agent"
|
|
echo " target/$TARGET/release/harmony_inventory_agent"
|