2019-02-20 22:10:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2021-10-31 12:07:59 +00:00
|
|
|
set --
|
2021-11-14 13:19:15 +00:00
|
|
|
set -- "$@" -machine pc -smp "${VM_CPU:?}" -m "${VM_RAM:?}"
|
2021-11-02 18:23:18 +00:00
|
|
|
set -- "$@" -serial stdio -monitor unix:/run/qemu-monitor,server,nowait -device VGA -display vnc=:0
|
2021-11-11 22:15:37 +00:00
|
|
|
set -- "$@" -device e1000,netdev=n0 -netdev user,id=n0,"${VM_NET_GUESTFWD_OPTIONS?}","${VM_NET_HOSTFWD_OPTIONS?}","${VM_NET_EXTRA_OPTIONS?}"
|
2021-11-14 13:08:28 +00:00
|
|
|
set -- "$@" -drive file=/var/lib/qemu/image/reactos.qcow2,index=0,media=disk,format=qcow2
|
2021-11-11 22:15:37 +00:00
|
|
|
set -- "$@" -usb -device usb-tablet -k "${VM_KEYBOARD:?}"
|
2021-08-02 19:23:21 +00:00
|
|
|
|
2021-10-31 12:07:59 +00:00
|
|
|
if [ "${VM_KVM:?}" = true ] && [ -c /dev/kvm ]; then
|
2021-11-15 18:51:53 +00:00
|
|
|
set -- "$@" -accel kvm -cpu host
|
2021-10-31 12:07:59 +00:00
|
|
|
else
|
|
|
|
set -- "$@" -accel tcg
|
2021-08-02 19:23:21 +00:00
|
|
|
fi
|
2019-02-20 22:10:38 +00:00
|
|
|
|
2021-11-14 13:08:28 +00:00
|
|
|
iso_i=2
|
|
|
|
for iso in /var/lib/qemu/iso/*; do
|
|
|
|
[ -f "${iso:?}" ] || continue
|
|
|
|
set -- "$@" -drive file="${iso:?}",index="${iso_i:?}",media=cdrom,format=raw
|
|
|
|
iso_i="$((iso_i + 1))"
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "${iso_i:?}" -gt 2 ]; then
|
|
|
|
set -- "$@" -boot order=dc,menu=on,splash-time=5000
|
|
|
|
fi
|
|
|
|
|
2019-09-15 18:55:14 +00:00
|
|
|
cd /var/lib/qemu/
|
2019-02-20 22:10:38 +00:00
|
|
|
exec 2>&1
|
2021-10-31 12:07:59 +00:00
|
|
|
exec /usr/bin/qemu-system-x86_64 "$@"
|