Skip to content

Instantly share code, notes, and snippets.

@patrickelectric
Last active March 24, 2019 17:15
Show Gist options
  • Save patrickelectric/76868a165199520392f192028adbc14c to your computer and use it in GitHub Desktop.
Save patrickelectric/76868a165199520392f192028adbc14c to your computer and use it in GitHub Desktop.
Ardusub with qemu and chroot
#Download ardusub image
wget https://s3.amazonaws.com/downloads.bluerobotics.com/Pi/stable/ardusub-raspbian.img.zip
unzip ardusub-raspbian.img.zip
#mount image as device
sudo kpartx -va 0.0.10.img
sudo mkdir -p /mnt/image
#mount device partition as folder
sudo mount /dev/mapper/loop0p2 image
#move qemu inside /usr/bin
sudo cp /usr/bin/qemu-arm-static image/usr/bin
#register qemu-static executables with binfmt_misc
binfmt_manager register arm
cd /mnt
#bind all necessary things in host
sudo mount -t proc /proc arm-chroot/proc
sudo mount -t proc /proc image/proc
sudo mount -o bind /dev image/dev
sudo mount -o bind /dev/pts image/dev/pts
sudo mount -o bind /sys image/sys
sudo mount --bind /etc/resolv.conf image/etc/resolv.conf
#enter the matrix (go inside ardusub file system)
sudo chroot image /bin/bash
Inside image:
cd /home/pi
#update ardusub
./setup.sh
cd companion/scripts
#update companion
./setup.sh
#run web app
./start_webui.sh
#qemu + arm
https://gist.github.com/mikkeloscar/a85b08881c437795c1b9
#Internet
https://lukeplant.me.uk/blog/posts/sharing-internet-connection-to-chroot/
#binfmt-manager
https://github.com/mikkeloscar/binfmt-manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment