Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Hacky tessel-rust deployment on T2

Run this somewhere:

tar -xf OpenWrt-SDK-ramips-mt7620_gcc-4.8-linaro_uClibc-

Change into that directory. Run mkdir -p ~/tessel/sdk/darwin/, then run cp -rf OpenWrt-SDK*/staging_dir/* ~/tessel/sdk/darwin/.

Save this as /usr/local/bin/t2-run-rust:


set -e

export PATH=~/.tessel/sdk/darwin/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-$PATH


if [[ $TESSEL_IP == "" ]]; then
  echo "Usage: t2-run-rust IP"
  exit 1

rustup override add nightly
rustup target add mipsel-unknown-linux-gnu

cargo build --release --target=mipsel-unknown-linux-gnu
BINARY=$(cd target/mipsel-unknown-linux-gnu/release; ls -l | egrep '^[^d]..x..x..x.*$' | rev | cut -d" " -f1 | rev)
if [[ $BINARY == "" ]]; then
  echo "No binary created!"
  exit 1

scp -i ~/.tessel/id_rsa target/mipsel-unknown-linux-gnu/release/$BINARY root@$TESSEL_IP:/tmp
ssh -i ~/.tessel/id_rsa root@$TESSEL_IP -t "/tmp/$BINARY"

You can then run t2-run-rust from your target directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.