summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Wallace <dev@nathanbw.com>2022-05-23 17:03:59 -0400
committerTim Flynn <trflynn89@pm.me>2022-05-24 06:30:57 -0400
commit0c0a760aadbdfa2b0049165f31d4cb9771991d69 (patch)
tree330d797d35cc3bc7d7ee11255b919924c83a8b06
parent2f1029e7c40c68284192c0a31b0da87edb58ed20 (diff)
downloadserenity-0c0a760aadbdfa2b0049165f31d4cb9771991d69.zip
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
-rw-r--r--Documentation/BuildInstructions.md8
-rwxr-xr-xMeta/run.sh12
2 files changed, 13 insertions, 7 deletions
diff --git a/Documentation/BuildInstructions.md b/Documentation/BuildInstructions.md
index e9af4949a1..9885b0d404 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 49bdc613c8..62080175f9 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