|
@@ -1,16 +1,21 @@
|
|
|
#!/usr/bin/env bash
|
|
#!/usr/bin/env bash
|
|
|
# To setup cross build on a linux machine, do the following
|
|
# To setup cross build on a linux machine, do the following
|
|
|
# 1. Install package arm-linux-gnu-gcc (yum) or gcc-arm-linux-gnueabihf (apt).
|
|
# 1. Install package arm-linux-gnu-gcc (yum) or gcc-arm-linux-gnueabihf (apt).
|
|
|
|
|
+# 5. Install build-essential (apt only).
|
|
|
# 2. Run `rustup target add armv7-unknown-linux-musleabihf`
|
|
# 2. Run `rustup target add armv7-unknown-linux-musleabihf`
|
|
|
# 1. Add the following to ~/.cargo/config
|
|
# 1. Add the following to ~/.cargo/config
|
|
|
# [target.armv7-unknown-linux-musleabihf]
|
|
# [target.armv7-unknown-linux-musleabihf]
|
|
|
-# linker = "arm-linux-gnu-gcc"
|
|
|
|
|
|
|
+# linker = "arm-linux-gnu-gcc" (yum)
|
|
|
|
|
+# linker = "arm-linux-gnueabihf-gcc" (apt)
|
|
|
|
|
+# 4. Install rsync.
|
|
|
|
|
|
|
|
set -ex
|
|
set -ex
|
|
|
-rsync -av /Users/ditsing/Code/ruaft ec2:~/compile/ --exclude 'ruaft/target' --exclude 'ruaft/.git' --exclude '.idea'
|
|
|
|
|
-ssh ec2 'cd ~/compile/ruaft/durio && cargo build --target=armv7-unknown-linux-musleabihf --release'
|
|
|
|
|
|
|
+
|
|
|
|
|
+MACHINE=gcloud
|
|
|
|
|
+rsync -av /Users/ditsing/Code/ruaft $MACHINE:~/compile/ --exclude 'ruaft/target' --exclude 'ruaft/.git' --exclude '.idea'
|
|
|
|
|
+ssh $MACHINE 'cd ~/compile/ruaft/durio && cargo build --target=armv7-unknown-linux-musleabihf --release'
|
|
|
mkdir -p /tmp/ruaft
|
|
mkdir -p /tmp/ruaft
|
|
|
-rsync -av 'ec2:~/compile/ruaft/target/armv7-unknown-linux-musleabihf/release/durio' '/tmp/ruaft/durio'
|
|
|
|
|
|
|
+rsync -av $MACHINE:'~/compile/ruaft/target/armv7-unknown-linux-musleabihf/release/durio' '/tmp/ruaft/durio'
|
|
|
|
|
|
|
|
ssh alice 'pkill -9 durio || echo nothing'
|
|
ssh alice 'pkill -9 durio || echo nothing'
|
|
|
rsync -av '/tmp/ruaft/durio' alice:/tmp/durio
|
|
rsync -av '/tmp/ruaft/durio' alice:/tmp/durio
|