Skip to content

Commit

Permalink
Meta+Documentation: Bump required QEMU version
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nathanbw authored and trflynn89 committed May 24, 2022
1 parent 2f1029e commit 0c0a760
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Documentation/BuildInstructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions Meta/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c0a760

Please sign in to comment.