mirror of
https://github.com/dockur/macos.git
synced 2026-03-11 08:34:24 +00:00
feat: Make CPU model and flags configurable (#34)
This commit is contained in:
parent
0b23f617a9
commit
9bcc4bb095
1 changed files with 12 additions and 5 deletions
17
src/boot.sh
17
src/boot.sh
|
|
@ -81,14 +81,21 @@ if [ ! -f "$BOOT_DRIVE" ] || [ ! -s "$BOOT_DRIVE" ]; then
|
|||
echo "$BOOT_SIZE" > "$BOOT_VERSION"
|
||||
fi
|
||||
|
||||
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},scsi=off,bus=pcie.0,addr=0x5,iothread=io2,bootindex=$BOOT_INDEX"
|
||||
DISK_OPTS+=" -drive file=$BOOT_DRIVE,id=$BOOT_DRIVE_ID,format=raw,cache=$DISK_CACHE,aio=$DISK_IO,readonly=on,if=none"
|
||||
DISK_OPTS+=" -device virtio-blk-pci,drive=${BOOT_DRIVE_ID},scsi=off,bus=pcie.0,addr=0x5,bootindex=$BOOT_INDEX"
|
||||
DISK_OPTS+=" -drive file=$BOOT_DRIVE,id=$BOOT_DRIVE_ID,format=raw,cache=unsafe,readonly=on,if=none"
|
||||
|
||||
CPU_VENDOR=$(lscpu | awk '/Vendor ID/{print $3}')
|
||||
CPU_FLAGS="vendor=GenuineIntel,vmware-cpuid-freq=on,-pdpe1gb"
|
||||
DEFAULT_FLAGS="vendor=GenuineIntel,vmware-cpuid-freq=on,-pdpe1gb"
|
||||
|
||||
if [[ "$CPU_VENDOR" != "GenuineIntel" ]]; then
|
||||
CPU_MODEL="Haswell-noTSX"
|
||||
if [[ "$CPU_VENDOR" != "GenuineIntel" ]] || [[ "${KVM:-}" == [Nn]* ]]; then
|
||||
[ -z "${CPU_MODEL:-}" ] && CPU_MODEL="Haswell-noTSX"
|
||||
DEFAULT_FLAGS+=",+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+bmi1,+bmi2,+xsave,+xsaveopt,+rdrand,check"
|
||||
fi
|
||||
|
||||
if [ -z "${CPU_FLAGS:-}" ]; then
|
||||
CPU_FLAGS="$DEFAULT_FLAGS"
|
||||
else
|
||||
CPU_FLAGS="$DEFAULT_FLAGS,$CPU_FLAGS"
|
||||
fi
|
||||
|
||||
USB="nec-usb-xhci,id=xhci"
|
||||
|
|
|
|||
Loading…
Reference in a new issue