Meta: Provide better instructions when QEMU is not installed or too old

This commit is contained in:
Gunnar Beutner 2021-07-03 10:39:16 +02:00 committed by Andreas Kling
parent 0ec1077bcb
commit d0c4524234
Notes: sideshowbarker 2024-07-18 11:04:53 +09:00

View File

@ -59,9 +59,17 @@ fi
fi
}
if ! command -v $SERENITY_QEMU_BIN >/dev/null 2>&1 ; then
die "Please install QEMU version 5.0 or newer or use the Toolchain/BuildQemu.sh script."
fi
SERENITY_QEMU_MIN_REQ_VERSION=5
installed_major_version=$("$SERENITY_QEMU_BIN" -version | head -n 1 | sed -E 's/QEMU emulator version ([1-9][0-9]*|0).*/\1/')
[ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ] && die "Required QEMU >= 5.0! Found $($SERENITY_QEMU_BIN -version | head -n 1)"
if [ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ]; then
echo "Required QEMU >= 5.0! Found $($SERENITY_QEMU_BIN -version | head -n 1)"
echo "Please install a newer version of QEMU or use the Toolchain/BuildQemu.sh script."
die
fi
SERENITY_SCREENS="${SERENITY_SCREENS:-1}"
if (uname -a | grep -iq WSL) || (uname -a | grep -iq microsoft); then