mirror of
https://github.com/dockur/macos.git
synced 2026-03-11 08:34:24 +00:00
feat: Detect nested virtualization (#94)
This commit is contained in:
parent
2fa64cf373
commit
b6be959712
1 changed files with 16 additions and 0 deletions
16
src/boot.sh
16
src/boot.sh
|
|
@ -98,6 +98,22 @@ else
|
|||
CPU_FLAGS="$DEFAULT_FLAGS,$CPU_FLAGS"
|
||||
fi
|
||||
|
||||
CLOCK="/sys/devices/system/clocksource/clocksource0/current_clocksource"
|
||||
[ -f "$CLOCK" ] && CLOCK=$(<"$CLOCK")
|
||||
|
||||
if [[ "${CLOCK,,}" == "kvm-clock" ]]; then
|
||||
if [[ "$CPU_VENDOR" != "GenuineIntel" ]] && [[ "${CPU_CORES,,}" == "2" ]]; then
|
||||
warn "Restricted processor to a single core because nested virtualization was detected!"
|
||||
CPU_CORES="1"
|
||||
else
|
||||
warn "Nested virtualization was detected, this might cause issues running macOS!"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${CLOCK,,}" == "hpet" ]]; then
|
||||
warn "Your clocksource is HPET instead of TSC, this will cause issues running macOS!"
|
||||
fi
|
||||
|
||||
case "$CPU_CORES" in
|
||||
"" | "0" | "3" ) CPU_CORES="2" ;;
|
||||
"5" ) CPU_CORES="4" ;;
|
||||
|
|
|
|||
Loading…
Reference in a new issue