Add support for guest_os hinting

Adds an optional `$guest_so` variable to the config files. Supported options are `linux` and `windows` which defaults to `linux` if not provided. Allows for OS specific tuning in `quickemu`.
This commit is contained in:
Martin Wimpress 2020-03-21 10:34:21 +00:00
parent 373a83f9a4
commit ce523fecdf
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3
2 changed files with 33 additions and 2 deletions

View file

@ -113,6 +113,33 @@ function vm_boot() {
echo " - BIOS: Legacy"
fi
# If guest_os is unset, default to "linux"
if [ -z "${guest_os}" ]; then
guest_os="linux"
else
# Force to lowercase.
guest_os=$(echo ${guest_os,,})
fi
# Make any OS specific adjustments
case ${guest_os} in
linux)
VIDEO_DRV="virtio-vga"
;;
windows)
VIDEO_DRV="qxl"
;;
*)
echo "ERROR! Unrecognised guest OS: ${guest_os}"
exit
;;
esac
echo " - Guest: ${guest_os^} optimised."
if [ -z "${disk}" ]; then
disk="64G"
fi
echo " - Disk: ${disk_img} (${disk})"
if [ ! -f "${disk_img}" ]; then
# If there is no disk image, create a new image.