Consolidate start up status messages

This commit is contained in:
Martin Wimpress 2021-10-04 22:19:37 +01:00
parent 9611080f50
commit 1c53d86004
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -149,11 +149,12 @@ function vm_boot() {
# Force to lowercase. # Force to lowercase.
boot=${boot,,} boot=${boot,,}
guest_os=${guest_os,,}
# Always Boot macOS using EFI # Always Boot macOS using EFI
if [ "${guest_os}" == "macos" ]; then if [ "${guest_os}" == "macos" ]; then
boot="efi" boot="efi"
echo " - BOOT: EFI" echo " - BOOT: EFI (${guest_os})"
if [ -e "${VMDIR}/OVMF_CODE.fd" ] && [ -e "${VMDIR}/OVMF_VARS-1024x768.fd" ]; then if [ -e "${VMDIR}/OVMF_CODE.fd" ] && [ -e "${VMDIR}/OVMF_VARS-1024x768.fd" ]; then
local EFI_CODE="${VMDIR}/OVMF_CODE.fd" local EFI_CODE="${VMDIR}/OVMF_CODE.fd"
local EFI_VARS="${VMDIR}/OVMF_VARS-1024x768.fd" local EFI_VARS="${VMDIR}/OVMF_VARS-1024x768.fd"
@ -177,7 +178,7 @@ function vm_boot() {
fi fi
elif [[ "${boot}" == *"efi"* ]]; then elif [[ "${boot}" == *"efi"* ]]; then
if [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ]; then if [ -e "/usr/share/OVMF/OVMF_CODE_4M.fd" ]; then
echo " - BOOT: EFI" echo " - BOOT: EFI (${guest_os})"
local EFI_CODE="/usr/share/OVMF/OVMF_CODE_4M.fd" local EFI_CODE="/usr/share/OVMF/OVMF_CODE_4M.fd"
local EFI_VARS="${VMDIR}/OVMF_VARS_4M.fd" local EFI_VARS="${VMDIR}/OVMF_VARS_4M.fd"
if [ -e "${VMDIR}/${VMNAME}-vars.fd" ]; then if [ -e "${VMDIR}/${VMNAME}-vars.fd" ]; then
@ -188,16 +189,14 @@ function vm_boot() {
fi fi
else else
boot="legacy" boot="legacy"
echo " - BOOT: Legacy BIOS - EFI requested but no EFI firmware found." echo " - BOOT: Legacy BIOS (${guest_os}) - EFI requested but no EFI firmware found."
fi fi
else else
echo " - BOOT: Legacy BIOS" echo " - BOOT: Legacy BIOS (${guest_os})"
fi fi
# Force to lowercase.
guest_os=${guest_os,,}
HOST_CPU=$(grep vendor /proc/cpuinfo | uniq | cut -d':' -f2 | sed 's/ //g') #A CPU with Intel VT-x / AMD SVM support is required
# Make any OS specific adjustments # Make any OS specific adjustments
case ${guest_os} in case ${guest_os} in
@ -261,7 +260,6 @@ function vm_boot() {
echo "WARNING! Unrecognised guest OS: ${guest_os}" echo "WARNING! Unrecognised guest OS: ${guest_os}"
;; ;;
esac esac
echo " - Guest: ${guest_os^} optimised"
echo " - Disk: ${disk_img} (${disk})" echo " - Disk: ${disk_img} (${disk})"
if [ ! -f "${disk_img}" ]; then if [ ! -f "${disk_img}" ]; then
@ -400,7 +398,6 @@ function vm_boot() {
if [ "${guest_os}" != "macos" ]; then if [ "${guest_os}" != "macos" ]; then
echo " - Screen: ${X_RES}x${Y_RES}" echo " - Screen: ${X_RES}x${Y_RES}"
fi fi
echo " - Display: ${OUTPUT^^}"
# https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/ # https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/
if [ "${guest_os}" == "linux" ]; then if [ "${guest_os}" == "linux" ]; then
@ -425,12 +422,12 @@ function vm_boot() {
DISPLAY_DEVICE="qxl-vga" DISPLAY_DEVICE="qxl-vga"
fi fi
echo -n " - Display: ${OUTPUT^^}, ${DISPLAY_DEVICE}"
if [ "${OUTPUT}" == "spice" ]; then if [ "${OUTPUT}" == "spice" ]; then
OUTPUT="none" OUTPUT="none"
fi fi
echo " - Video: ${DISPLAY_DEVICE}"
# Build the video configuration # Build the video configuration
VIDEO="-device ${DISPLAY_DEVICE}" VIDEO="-device ${DISPLAY_DEVICE}"
@ -456,13 +453,12 @@ function vm_boot() {
if [ "${OUTPUT}" != "none" ]; then if [ "${OUTPUT}" != "none" ]; then
OUTPUT="${OUTPUT},gl=${GL}" OUTPUT="${OUTPUT},gl=${GL}"
fi fi
echo " - GL: ${GL^^}"
if [ "${GL}" == "on" ] && [[ "${DISPLAY_DEVICE}" == *"virtio"* ]]; then if [ "${GL}" == "on" ] && [[ "${DISPLAY_DEVICE}" == *"virtio"* ]]; then
DISPLAY_DEVICE="${DISPLAY_DEVICE},virgl=on" DISPLAY_DEVICE="${DISPLAY_DEVICE},virgl=on"
echo " - Virgil3D: ON" echo ", GL (${GL}), VirGL (on)"
else else
echo " - Virgil3D: OFF" echo ", GL (${GL}), VirGL (off)"
fi fi
# Set the hostname of the VM # Set the hostname of the VM