From 0c0a760aadbdfa2b0049165f31d4cb9771991d69 Mon Sep 17 00:00:00 2001 From: Nathan Wallace Date: Mon, 23 May 2022 17:03:59 -0400 Subject: [PATCH] Meta+Documentation: Bump required QEMU version This commit bumps the required QEMU version to 6.2 and updates the version checking logic in Meta/run.sh to support checking against major and minor version numbers instead of checking against the major version only --- Documentation/BuildInstructions.md | 8 +++++--- Meta/run.sh | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Documentation/BuildInstructions.md b/Documentation/BuildInstructions.md index e9af4949a12..9885b0d4049 100644 --- a/Documentation/BuildInstructions.md +++ b/Documentation/BuildInstructions.md @@ -31,10 +31,12 @@ Now on Ubuntu or Debian you can install gcc-11 with apt like this: sudo apt install gcc-11 g++-11 ``` -#### QEMU 5 or later +#### QEMU 6.2 or later -QEMU version 5 is available in Ubuntu 20.10, but it is recommended to build Qemu as provided by the toolchain by running `Toolchain/BuildQemu.sh`. -Note that you might need additional dev packages: +Version 6.2 of QEMU is available in Ubuntu 22.04. On earlier versions of Ubuntu, +you can build the recommended version of QEMU as provided by the toolchain by running +`Toolchain/BuildQemu.sh`. +Note that you might need additional dev packages in order to build QEMU on your machine: ```console sudo apt install libgtk-3-dev libpixman-1-dev libsdl2-dev libspice-server-dev diff --git a/Meta/run.sh b/Meta/run.sh index 49bdc613c8d..62080175f95 100755 --- a/Meta/run.sh +++ b/Meta/run.sh @@ -104,15 +104,19 @@ fi fi } +SERENITY_QEMU_MIN_REQ_MAJOR_VERSION=6 +SERENITY_QEMU_MIN_REQ_MINOR_VERSION=2 +SERENITY_QEMU_MIN_REQ_VERSION="$SERENITY_QEMU_MIN_REQ_MAJOR_VERSION.$SERENITY_QEMU_MIN_REQ_MINOR_VERSION" 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." + die "Please install QEMU version $SERENITY_QEMU_MIN_REQ_VERSION 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_minor_version=$("$SERENITY_QEMU_BIN" -version | head -n 1 | sed -E 's/QEMU emulator version [0-9]+\.([1-9][0-9]*|0).*/\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)" +if [ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_MAJOR_VERSION" ] || + { [ "$installed_major_version" -eq "$SERENITY_QEMU_MIN_REQ_MAJOR_VERSION" ] && + [ "$installed_minor_version" -lt "$SERENITY_QEMU_MIN_REQ_MINOR_VERSION" ]; }; then + echo "Required QEMU >= $SERENITY_QEMU_MIN_REQ_VERSION! 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