Skip to content

Instantly share code, notes, and snippets.

@fdelacruz
Last active July 29, 2024 13:19
Show Gist options
  • Select an option

  • Save fdelacruz/3acfb257dad5b6ea4c89f4ed9a5b4873 to your computer and use it in GitHub Desktop.

Select an option

Save fdelacruz/3acfb257dad5b6ea4c89f4ed9a5b4873 to your computer and use it in GitHub Desktop.
Cross build to aarch64-unknown-linux-gnu
#!/bin/bash -xe
readonly TARGET_ARCH=aarch64-unknown-linux-gnu
readonly SOURCE_PATH="./target/$TARGET_ARCH/release/hello-world"
readonly TARGET_PATH=/home/fdelacruz/workspace/cross_build
# readonly PI_IP=192.168.1.x
readonly TARGET_HOST=fdelacruz@$PI_IP
readonly PORT=2202
cargo install -f cross
cross build --release --target $TARGET_ARCH
scp -P $PORT -r "$SOURCE_PATH" "$TARGET_HOST":$TARGET_PATH
ssh -p $PORT "$USER"@"$PI_IP" $TARGET_PATH/hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment