Files
jsix_import/qemu.sh
2019-03-10 12:57:43 -07:00

46 lines
698 B
Bash
Executable File

#!/usr/bin/env bash
build="$(dirname $0)/build"
debug=""
gfx="-nographic"
for arg in $@; do
case "${arg}" in
--debug)
debug="-s"
;;
--gfx)
gfx=""
;;
*)
build="${arg}"
;;
esac
done
kvm=""
if [[ -c /dev/kvm ]]; then
kvm="-enable-kvm"
fi
if ! ninja -C "${build}"; then
exit 1
fi
if [[ -n $TMUX ]]; then
tmux split-window "sleep 1; telnet localhost 45454" &
fi
exec qemu-system-x86_64 \
-drive "if=pflash,format=raw,file=${build}/flash.img" \
-drive "format=raw,file=${build}/popcorn.img" \
-monitor telnet:localhost:45454,server,nowait \
-smp 1 \
-m 512 \
-d mmu,int,guest_errors \
-D popcorn.log \
-cpu Broadwell \
-M q35 \
-no-reboot \
$gfx $kvm $debug