fix: Custom CPU model (#12)

This commit is contained in:
Kroese 2024-02-05 06:40:33 +01:00 committed by GitHub
parent 5a9f08c88a
commit 644cca0786
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,8 @@ set -Eeuo pipefail
: "${KVM:="Y"}"
: "${CPU_FLAGS:=""}"
: "${CPU_MODEL:="cortex-a53"}"
: "${DEF_MODEL:="cortex-a53"}"
: "${CPU_MODEL:="$DEF_MODEL"}"
[[ "$ARCH" != "arm"* ]] && KVM="N"
@ -32,7 +33,10 @@ fi
if [[ "$KVM" != [Nn]* ]]; then
if [[ "$CPU_MODEL" == "$DEF_MODEL" ]]; then
CPU_MODEL="host"
fi
KVM_OPTS=",accel=kvm -enable-kvm"
CPU_FEATURES="kvm=on,migratable=no"
WIN_FEATURES=""
@ -46,8 +50,10 @@ else
KVM_OPTS=" -accel tcg,thread=multi"
if [[ "$ARCH" == "arm"* ]]; then
if [[ "$CPU_MODEL" == "$DEF_MODEL" ]]; then
CPU_MODEL="max"
fi
fi
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
MACHINE="$MACHINE,virtualization=on"