Last active
March 24, 2019 17:15
-
-
Save patrickelectric/76868a165199520392f192028adbc14c to your computer and use it in GitHub Desktop.
Ardusub with qemu and chroot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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