Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation, trivial cleanup, change OpenCore prefs #139

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 33 additions & 45 deletions OpenCore-BS.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,37 @@
#!/usr/bin/env bash

# All credits for OpenCore support go to https://github.com/Leoyzen/KVM-Opencore and
# https://github.com/thenickdude/KVM-Opencore/. Thanks!
#
# Special thanks to...
# https://github.com/Leoyzen/KVM-Opencore
# https://github.com/thenickdude/KVM-Opencore/
# https://github.com/qemu/qemu/blob/master/docs/usb2.txt

# qemu-img create -f qcow2 mac_hdd_ng.img 128G
#
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)

############################################################################
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
############################################################################

# This works for Catalina as well as Mojave. Tested with macOS 10.14.6 and macOS 10.15.

MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"

# OVMF=./firmware
OVMF="./"

# This causes high cpu usage on the *host* side
# qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\


qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 \
-smp 4,cores=2 \
-usb \
-device usb-ehci,id=ehci \
-device usb-kbd,bus=ehci.0 \
-device usb-mouse,bus=ehci.0 \
-device nec-usb-xhci,id=xhci \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=./'OpenCore-BS/OpenCore.qcow2' \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
ALLOCATED_RAM="3072" # MiB
CPU_SOCKETS="1"
CPU_CORES="2"
CPU_THREADS="4"

REPO_PATH="./"
OVMF_DIR="."

qemu-system-x86_64 -enable-kvm -m "$ALLOCATED_RAM" -cpu host,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on \
-machine q35 -usb \
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS" \
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd" \
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd" \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=$REPO_PATH/'OpenCore-BS/OpenCore.qcow2' \
-drive id=InstallMedia,if=none,file=$REPO_PATH/BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=$REPO_PATH/mac_hdd_ng.img,format=qcow2 \
-smbios type=2 \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-device usb-ehci,id=ehci \
-device usb-kbd,bus=ehci.0 \
-device usb-mouse,bus=ehci.0 \
-device nec-usb-xhci,id=xhci \
-device ich9-ahci,id=sata \
-device ich9-intel-hda -device hda-duplex \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
127 changes: 97 additions & 30 deletions OpenCore-BS/config.plist
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,40 @@
<key>Emulate</key>
<dict>
<key>Cpuid1Data</key>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these changes tested with Big Sur?

fail

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Every change needs to be tested end-to-end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They weren't. I couldn't get Big Sur to work due to problems on my end, sorry about that. I figured changes from Catalina should translate over

<data>
VAYFAAAAAAAAAAAAAAAAAA==
</data>
<data>VwYFAAAAAAAAAAAAAAAAAA==</data>
<key>Cpuid1Mask</key>
<data>
////AAAAAAAAAAAAAAAAAA==
</data>
<data>/////wAAAAAAAAAAAAAAAA==</data>
</dict>
<key>Patch</key>
<array>
<dict>
<key>Base</key>
<string></string>
<key>Comment</key>
<string>algrey - cpuid_set_generic_info - disable check to allow leaf7</string>
<key>Count</key>
<integer>1</integer>
<key>Enabled</key>
<false/>
<key>Find</key>
<data>ADoPgg==</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data></data>
<key>MaxKernel</key>
<string>19.99.99</string>
<key>MinKernel</key>
<string>17.0.0</string>
<key>Replace</key>
<data>AAAPgg==</data>
<key>ReplaceMask</key>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Base</key>
<string>_cpu_topology_sort</string>
Expand All @@ -360,28 +384,21 @@
<key>Enabled</key>
<false/>
<key>Find</key>
<data>
6AAA//8=
</data>
<data>6AAA//8=</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data>
/wAA//8=
</data>
<data>/wAA//8=</data>
<key>MaxKernel</key>
<string>19.99.99</string>
<key>MinKernel</key>
<string>17.0.0</string>
<key>Replace</key>
<data>
Dx9EAAA=
</data>
<data>Dx9EAAA=</data>
<key>ReplaceMask</key>
<data>
</data>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
Expand All @@ -395,28 +412,77 @@
<key>Enabled</key>
<false/>
<key>Find</key>
<data>
MduAPQAAAAAGdQA=
</data>
<data>MduAPQAAAAAGdQA=</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data>
/////wAAAP///wA=
</data>
<data>/////wAAAP///wA=</data>
<key>MaxKernel</key>
<string>19.99.99</string>
<key>MinKernel</key>
<string>17.0.0</string>
<key>Replace</key>
<data>
u7xP6njpXQAAAJA=
</data>
<data>u7xP6njpXQAAAJA=</data>
<key>ReplaceMask</key>
<data>
</data>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Base</key>
<string></string>
<key>Comment</key>
<string>algrey - - skip cpuid_cores_per_package test -10.15</string>
<key>Count</key>
<integer>0</integer>
<key>Enabled</key>
<false/>
<key>Find</key>
<data>gz0AAAAAAA8AAAAAAItdvA==</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data>//8AAAD///8AAAAA/////w==</data>
<key>MaxKernel</key>
<string>19.99.99</string>
<key>MinKernel</key>
<string>19.0.0</string>
<key>Replace</key>
<data>AAAAAAAAAQAAAAAAAAAAAA==</data>
<key>ReplaceMask</key>
<data>AAAAAAAADwAAAAAAAAAAAA==</data>
<key>Skip</key>
<integer>0</integer>
</dict>
<dict>
<key>Base</key>
<string></string>
<key>Comment</key>
<string>algrey - - skip cpuid_cores_per_package test</string>
<key>Count</key>
<integer>0</integer>
<key>Enabled</key>
<false/>
<key>Find</key>
<data>gz0AAAAAAHQAi128</data>
<key>Identifier</key>
<string>kernel</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data>//8AAAD///8A////</data>
<key>MaxKernel</key>
<string>18.99.99</string>
<key>MinKernel</key>
<string>17.0.0</string>
<key>Replace</key>
<data>AAAAAAAAAQAAAAAA</data>
<key>ReplaceMask</key>
<data>AAAAAAAADwAAAAAA</data>
<key>Skip</key>
<integer>0</integer>
</dict>
Expand Down Expand Up @@ -516,7 +582,8 @@
<key>HaltLevel</key>
<integer>2147483648</integer>
<key>ScanPolicy</key>
<integer>18809603</integer>
<integer>0</integer>
<!-- <integer>18809603</integer> -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (commented stuff) is not valid for OpenCore 0.6.0.

Copy link
Contributor Author

@kwvg kwvg Aug 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenCore doesn't like the comment or doesn't like 18809603?
Just checked with the commit, it doesn't like the comment.

Are there any problems with the additional algrey patches? The leaf7 patch was really useful to get AVX working on my AMD system w/o manually specifying it.

<key>Vault</key>
<string>Optional</string>
</dict>
Expand Down Expand Up @@ -573,7 +640,7 @@
<key>SystemAudioVolume</key>
<data>Rg==</data>
<key>boot-args</key>
<string>keepsyms=1 -v</string>
<string>-v keepsyms=1</string>
<key>run-efi-updater</key>
<string>No</string>
<key>csr-active-config</key>
Expand Down
78 changes: 33 additions & 45 deletions OpenCore-Boot.sh
Original file line number Diff line number Diff line change
@@ -1,49 +1,37 @@
#!/usr/bin/env bash

# All credits for OpenCore support go to https://github.com/Leoyzen/KVM-Opencore and
# https://github.com/thenickdude/KVM-Opencore/. Thanks!
#
# Special thanks to...
# https://github.com/Leoyzen/KVM-Opencore
# https://github.com/thenickdude/KVM-Opencore/
# https://github.com/qemu/qemu/blob/master/docs/usb2.txt

# qemu-img create -f qcow2 mac_hdd_ng.img 128G
#
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)

############################################################################
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
############################################################################

# This works for Catalina as well as Mojave. Tested with macOS 10.14.6 and macOS 10.15.

MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"

# OVMF=./firmware
OVMF="./"

# This causes high cpu usage on the *host* side
# qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\


qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 \
-smp 4,cores=2 \
-usb \
-device usb-ehci,id=ehci \
-device usb-kbd,bus=ehci.0 \
-device usb-mouse,bus=ehci.0 \
-device nec-usb-xhci,id=xhci \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-drive if=pflash,format=raw,readonly,file=$OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=$OVMF/OVMF_VARS-1024x768.fd \
-smbios type=2 \
-device ich9-intel-hda -device hda-duplex \
-device ich9-ahci,id=sata \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=./'OpenCore-Catalina/OpenCore.qcow2' \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-drive id=InstallMedia,if=none,file=BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=./mac_hdd_ng.img,format=qcow2 \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
ALLOCATED_RAM="3072" # MiB
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorporated. Thanks.

CPU_SOCKETS="1"
CPU_CORES="2"
CPU_THREADS="4"

REPO_PATH="./"
OVMF_DIR="."

qemu-system-x86_64 -enable-kvm -m "$ALLOCATED_RAM" -cpu host,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on \
-machine q35 -usb \
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS" \
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd" \
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd" \
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=$REPO_PATH/'OpenCore-Catalina/OpenCore.qcow2' \
-drive id=InstallMedia,if=none,file=$REPO_PATH/BaseSystem.img,format=raw \
-drive id=MacHDD,if=none,file=$REPO_PATH/mac_hdd_ng.img,format=qcow2 \
-smbios type=2 \
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-device usb-ehci,id=ehci \
-device usb-kbd,bus=ehci.0 \
-device usb-mouse,bus=ehci.0 \
-device nec-usb-xhci,id=xhci \
-device ich9-ahci,id=sata \
-device ich9-intel-hda -device hda-duplex \
-device ide-hd,bus=sata.2,drive=OpenCoreBoot \
-device ide-hd,bus=sata.3,drive=InstallMedia \
-device ide-hd,bus=sata.4,drive=MacHDD \
-netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 \
-monitor stdio \
-vga vmware
Loading