Meta: Check installed QEMU version

`ninja install` fails with a clueless error message if the installed
QEMU version is less than 5.0.
This commit is contained in:
Apoorv Mishra 2021-06-08 22:11:33 +05:30 committed by Andreas Kling
parent 340f6cde2d
commit 5d57384bc4
Notes: sideshowbarker 2024-07-18 12:33:14 +09:00

View file

@ -43,6 +43,10 @@ SERENITY_RUN="${SERENITY_RUN:-$1}"
fi fi
} }
SERENITY_QEMU_MIN_REQ_VERSION=5
installed_major_version=$("$SERENITY_QEMU_BIN" -version | head -n 1 | grep -Po "(?<=QEMU emulator version )([1-9]\d*|0)")
[ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ] && die "Required QEMU >= 5.0! Found $($SERENITY_QEMU_BIN -version | head -n 1)"
[ -z "$SERENITY_COMMON_QEMU_ARGS" ] && SERENITY_COMMON_QEMU_ARGS=" [ -z "$SERENITY_COMMON_QEMU_ARGS" ] && SERENITY_COMMON_QEMU_ARGS="
$SERENITY_EXTRA_QEMU_ARGS $SERENITY_EXTRA_QEMU_ARGS
-s -m $SERENITY_RAM_SIZE -s -m $SERENITY_RAM_SIZE