mirror of
https://github.com/dockur/macos.git
synced 2026-03-11 08:34:24 +00:00
fix: Simplify conditional checks (#302)
This commit is contained in:
parent
109b84fd6f
commit
a737399811
1 changed files with 3 additions and 3 deletions
|
|
@ -157,7 +157,7 @@ DISK_OPTS+=" -drive file=$IMG,id=$BOOT_DRIVE_ID,format=raw,cache=unsafe,readonly
|
|||
CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}')
|
||||
DEFAULT_FLAGS="vendor=GenuineIntel,vmware-cpuid-freq=on,-pdpe1gb"
|
||||
|
||||
if [[ "$CPU_VENDOR" == "AuthenticAMD" ]] || [[ "${KVM:-}" == [Nn]* ]]; then
|
||||
if [[ "$CPU_VENDOR" == "AuthenticAMD" || "${KVM:-}" == [Nn]* ]]; then
|
||||
[ -z "${CPU_MODEL:-}" ] && CPU_MODEL="Haswell-noTSX"
|
||||
DEFAULT_FLAGS+=",+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+bmi1,+bmi2,+smep,+xsave,+xsavec,+xsaveopt,+xgetbv1,+movbe,+rdrand,check"
|
||||
fi
|
||||
|
|
@ -168,7 +168,7 @@ else
|
|||
CPU_FLAGS="$DEFAULT_FLAGS,$CPU_FLAGS"
|
||||
fi
|
||||
|
||||
if [[ "$CPU_VENDOR" == "AuthenticAMD" ]] && [[ "${CPU_CORES,,}" != "1" ]] && [[ "${FORCE:-}" == [Nn]* ]] && [[ "${KVM:-}" != [Nn]* ]]; then
|
||||
if [[ "$CPU_VENDOR" == "AuthenticAMD" && "${CPU_CORES,,}" != "1" && "${FORCE:-}" == [Nn]* && "${KVM:-}" != [Nn]* ]]; then
|
||||
warn "Restricted processor to a single core (instead of $CPU_CORES cores) because an AMD CPU was detected! (Set FORCE=Y to disable this measure)"
|
||||
CPU_CORES="1"
|
||||
fi
|
||||
|
|
@ -186,7 +186,7 @@ else
|
|||
case "${result,,}" in
|
||||
"${CLOCKSOURCE,,}" ) ;;
|
||||
"kvm-clock" )
|
||||
if [[ "$CPU_VENDOR" == "AuthenticAMD" ]] && [[ "${CPU_CORES,,}" != "1" ]] && [[ "${FORCE:-}" == [Nn]* ]] && [[ "${KVM:-}" != [Nn]* ]]; then
|
||||
if [[ "$CPU_VENDOR" == "AuthenticAMD" && "${CPU_CORES,,}" != "1" && "${FORCE:-}" == [Nn]* && "${KVM:-}" != [Nn]* ]]; then
|
||||
warn "Restricted processor to a single core (instead of $CPU_CORES cores) because nested KVM virtualization on an AMD CPU was detected! (Set FORCE=Y to disable this measure)"
|
||||
CPU_CORES="1"
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue