Skip to content

Instantly share code, notes, and snippets.

@9names
Created July 3, 2022 12:26
Show Gist options
  • Save 9names/7b5c95299604e177e64bfbc84206d893 to your computer and use it in GitHub Desktop.
Save 9names/7b5c95299604e177e64bfbc84206d893 to your computer and use it in GitHub Desktop.
Set up Rust and try to build probe-rs under qemu
sudo qemu-debootstrap --arch=mipsel --keyring /usr/share/keyrings/debian-archive-keyring.gpg \
--variant=buildd --exclude=debfoster unstable debian-mipsel http://ftp.debian.org/debian
sudo apt install qemu binfmt-support qemu-user-static
sudo cp /usr/bin/qemu-mipsel-static debian-mipsel/usr/bin/
cd debian-mipsel
for f in dev dev/pts sys proc run ; do sudo mount --bind /$f ./$f ; done
sudo chroot .
apt update
apt install dialog locales
apt install curl vim pkgconfig git sed
apt install libudev-dev
adduser debian
mkdir /home/debian/.cargo
# regular filesystem is cursed, need tmpfs or git hates us
mount -t tmpfs tmpfs /home/debian/.cargo
mount -t tmpfs tmpfs /home/debian/vc
su - debian
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
# hack in _cputype=mipsel somewhere after the call to get_endianness() since that fails
./rustup.sh
source $HOME/.cargo/env
cd ~/vc
git clone https://github.com/probe-rs/probe-rs
cd probe-rs
cargo build --bin probe-rs-cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment