mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
Give qemu.sh better option handling
This commit is contained in:
29
qemu.sh
29
qemu.sh
@@ -1,19 +1,29 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
build="$(dirname $0)/build"
|
||||||
debug=""
|
debug=""
|
||||||
if [[ $1 = "--debug" ]]; then
|
gfx="-nographic"
|
||||||
debug="-s"
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
build=${1:-"$(dirname $0)/build"}
|
for arg in $@; do
|
||||||
|
case "${arg}" in
|
||||||
|
--debug)
|
||||||
|
debug="-s"
|
||||||
|
;;
|
||||||
|
--gfx)
|
||||||
|
gfx=""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
build="${arg}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
kvm=""
|
kvm=""
|
||||||
if [[ -f /dev/kvm ]]; then
|
if [[ -c /dev/kvm ]]; then
|
||||||
kvm="--enable-kvm"
|
kvm="-enable-kvm"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ninja -C $build && \
|
ninja -C "${build}" && \
|
||||||
exec qemu-system-x86_64 \
|
exec qemu-system-x86_64 \
|
||||||
-drive "if=pflash,format=raw,file=${build}/flash.img" \
|
-drive "if=pflash,format=raw,file=${build}/flash.img" \
|
||||||
-drive "format=raw,file=${build}/popcorn.img" \
|
-drive "format=raw,file=${build}/popcorn.img" \
|
||||||
@@ -24,5 +34,4 @@ exec qemu-system-x86_64 \
|
|||||||
-cpu Broadwell \
|
-cpu Broadwell \
|
||||||
-M q35 \
|
-M q35 \
|
||||||
-no-reboot \
|
-no-reboot \
|
||||||
-nographic \
|
$gfx $kvm $debug
|
||||||
$kvm $debug
|
|
||||||
|
|||||||
Reference in New Issue
Block a user