feat: Parse CPU flags (#1010)

This commit is contained in:
Kroese 2025-09-17 17:54:50 +02:00 committed by GitHub
parent 238ebd273b
commit 10466d7851
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,6 +128,30 @@ else
fi fi
if [[ "$ARGUMENTS" == *"-cpu host,"* ]]; then
args="${ARGUMENTS} "
prefix="${args/-cpu host,*/}"
suffix="${args/*-cpu host,/}"
param="${suffix%% *}"
suffix="${suffix#* }"
args="${prefix}${suffix}"
ARGUMENTS="${args::-1}"
if [ -z "$CPU_FLAGS" ]; then
CPU_FLAGS="$param"
else
CPU_FLAGS+=",$param"
fi
else
if [[ "$ARGUMENTS" == *"-cpu host"* ]]; then
ARGUMENTS="${ARGUMENTS//-cpu host/}"
fi
fi
if [ -z "$CPU_FLAGS" ]; then if [ -z "$CPU_FLAGS" ]; then
if [ -z "$CPU_FEATURES" ]; then if [ -z "$CPU_FEATURES" ]; then
CPU_FLAGS="$CPU_MODEL" CPU_FLAGS="$CPU_MODEL"