chore: set up QEMU env.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d1002fc3a3
commit
b864490612
3 changed files with 43 additions and 1 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -15,3 +15,7 @@
|
|||
|
||||
# If the VM crashes, it generates a dump, let's ignore it too.
|
||||
erl_crash.dump
|
||||
|
||||
# Test drive images.
|
||||
/tmp
|
||||
*.img
|
||||
|
|
|
@ -66,7 +66,7 @@ config :mdns_lite,
|
|||
# because otherwise any of the devices may respond to nerves.local leading to
|
||||
# unpredictable behavior.
|
||||
|
||||
hosts: [:hostname, "nerves"],
|
||||
hosts: [:hostname, "bivouac"],
|
||||
ttl: 120,
|
||||
|
||||
# Advertise the following services over mDNS.
|
||||
|
|
38
run-qemu.sh
Executable file
38
run-qemu.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Run a nerves_system_x86_64-based image in QEMU
|
||||
#
|
||||
# Usage:
|
||||
# run-qemu.sh [Path to .img file]
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
IMAGE="$1"
|
||||
DEFAULT_IMAGE="bivouac.img"
|
||||
|
||||
help() {
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo " run-qemu.sh [Path to .img file]"
|
||||
echo
|
||||
echo "Run 'mix firmware.image' to create the starter image. Since qemu isn't"
|
||||
echo "supported by Nerves, we don't have instructions for how to make this a"
|
||||
echo "productive development environment. You should be able to see this"
|
||||
echo "boot, though."
|
||||
exit 1
|
||||
}
|
||||
[ -n "$IMAGE" ] || IMAGE="$DEFAULT_IMAGE"
|
||||
|
||||
[ -f "$IMAGE" ] || (echo "Error: can't find '$IMAGE'"; help)
|
||||
|
||||
echo "Starting QEMU..."
|
||||
qemu-system-x86_64 \
|
||||
-drive file="$IMAGE",if=virtio,format=raw \
|
||||
-drive file="tmp/disk0.img",if=virtio,format=raw \
|
||||
-drive file="tmp/disk1.img",if=virtio,format=raw \
|
||||
-drive file="tmp/disk2.img",if=virtio,format=raw \
|
||||
-net nic,model=virtio \
|
||||
-net user,hostfwd=tcp::10022-:22 \
|
||||
-serial stdio
|
Loading…
Reference in a new issue