summaryrefslogtreecommitdiff
path: root/Meta/run.sh
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-08-03 14:49:57 +0200
committerLinus Groh <mail@linusgroh.de>2021-08-03 13:59:57 +0100
commitb082488e948b2ae6b782309cc0b5205348998600 (patch)
tree39b505abe330a8321ad2e4289eb81cbbb06e92a3 /Meta/run.sh
parent46d4ef5e1186c8ec3b1ccfec859f680a2f9f26ba (diff)
downloadserenity-b082488e948b2ae6b782309cc0b5205348998600.zip
Meta: Prefer to use -machine pcspk-audiodev for QEMU >=5.1
This gets rid of the following warning message from QEMU on startup: qemu-system-i386: warning: '-soundhw pcspk' is deprecated, please set a backend using '-machine pcspk-audiodev=<name>' instead Fixes #4093.
Diffstat (limited to 'Meta/run.sh')
-rwxr-xr-xMeta/run.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/Meta/run.sh b/Meta/run.sh
index 1af3902e8f..61929cb178 100755
--- a/Meta/run.sh
+++ b/Meta/run.sh
@@ -82,6 +82,7 @@ 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)"
echo "Please install a newer version of QEMU or use the Toolchain/BuildQemu.sh script."
@@ -104,10 +105,10 @@ else
SERENITY_AUDIO_BACKEND="-audiodev pa,id=snd0"
fi
-if [ "$installed_major_version" -gt 5 ]; then
- SERENITY_AUDIO_HW="-machine pcspk-audiodev=snd0"
-else
+if [ "$installed_major_version" -eq 5 ] && [ "$installed_minor_version" -eq 0 ]; then
SERENITY_AUDIO_HW="-soundhw pcspk"
+else
+ SERENITY_AUDIO_HW="-machine pcspk-audiodev=snd0"
fi
SERENITY_SCREENS="${SERENITY_SCREENS:-1}"