Compare commits

...

64 Commits
0.5.3 ... 0.6.1

Author SHA1 Message Date
Mykola Grymalyuk
ac2147684a Sync changelog 2023-01-23 20:49:29 -07:00
Mykola Grymalyuk
e16b6e4c22 build: Adjust for MacBookPro13,3 2023-01-23 20:08:48 -07:00
Mykola Grymalyuk
e84f3425d0 build: Adjust KDKlessWorkaround usage 2023-01-23 19:44:43 -07:00
Mykola Grymalyuk
e1b99b9084 Merge branch 'main' of https://github.com/dortania/OpenCore-Legacy-Patcher 2023-01-23 19:05:36 -07:00
Mykola Grymalyuk
b3775d35a5 Increment KDKless 2023-01-23 19:05:16 -07:00
Mykola Grymalyuk
498042ccb3 Increment build 2023-01-23 19:00:13 -07:00
Mykola Grymalyuk
7d4ee0d110 Merge pull request #1020 from dortania/054-docs
Docs: Sync 0.6.0 changes
2023-01-23 17:12:33 -07:00
Mykola Grymalyuk
cff1aaf3f4 Update support image 2023-01-23 12:47:31 -07:00
Mykola Grymalyuk
a776535e72 Adjust for 060 release 2023-01-23 11:43:15 -07:00
Mykola Grymalyuk
f7dea97289 Remove Navi mention 2023-01-23 11:30:36 -07:00
Mykola Grymalyuk
37e99ba49c sys_patch_detect.py: Avoid conflicting AMD patch installation 2023-01-23 11:24:03 -07:00
Mykola Grymalyuk
288b827616 sys_patch_helpers.py: Verify stderr before printing 2023-01-23 09:52:24 -07:00
Mykola Grymalyuk
e8a6f45329 sys_patch_helpers.py: Print errors 2023-01-23 09:31:36 -07:00
Mykola Grymalyuk
a1ffadf582 sys_patch_helpers.py: Unmount KDK drive on error 2023-01-23 09:30:52 -07:00
Mykola Grymalyuk
a6c4890d0f Merge branch 'main' of https://github.com/dortania/OpenCore-Legacy-Patcher 2023-01-23 09:20:50 -07:00
Mykola Grymalyuk
00b47aef47 Revert "sys_patch_helpers.py: Work around Read only error"
This reverts commit 92f85feda5.
2023-01-23 09:20:00 -07:00
Mykola Grymalyuk
92f85feda5 sys_patch_helpers.py: Work around Read only error 2023-01-23 09:19:20 -07:00
Mykola Grymalyuk
21778e8d92 sys_patch_helpers.py: Work around Read only error 2023-01-23 08:36:38 -07:00
Mykola Grymalyuk
57d2597c86 Sync PatcherSupportPkg 2023-01-23 06:51:14 -07:00
Mykola Grymalyuk
20baf8c417 Sync PatcherSupportPkg 2023-01-22 21:13:30 -07:00
Mykola Grymalyuk
99a145e7cb build: Add APFS Trim configuration 2023-01-20 17:10:59 -07:00
Mykola Grymalyuk
28b9948b45 Docs: Add more legacy Mac info 2023-01-20 16:22:46 -07:00
Mykola Grymalyuk
79f4ba17d9 gui_main.py: Adjust prompt 2023-01-20 16:03:02 -07:00
Mykola Grymalyuk
659d842023 Adjust versioning to 0.6.0, match changes 2023-01-19 12:39:42 -07:00
Mykola Grymalyuk
037ff0f2c3 sys_patch_helpers.py: Avoid saying RSRRepair
RSRRepair is used for syncing Boot and System Kernel Collections, users misintepreted this as supporting RSR on all models
2023-01-16 13:51:08 -07:00
Mykola Grymalyuk
fac1298a6e Merge pull request #1022 from ParaDoX1994/patch-1
Add note about building for other devices
2023-01-15 11:04:42 -07:00
neon ball
273910b69a Add note about building for other devices 2023-01-12 18:36:31 +02:00
Mykola Grymalyuk
1974cd6341 sys_patch_detect: prioritize USB 3.0 support 2023-01-12 08:52:39 -07:00
Mykola Grymalyuk
bef429b758 CHANGELOG: Adjust wording 2023-01-09 23:05:12 -07:00
Mykola Grymalyuk
bebbf646e1 sys_patch: Implement RSR handling for root patched Macs
Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1019
2023-01-09 23:03:18 -07:00
Mykola Grymalyuk
6504442d4f build: Implement NVGOP_GK.efi
Thanks @jazzzny
2023-01-09 21:35:33 -07:00
Mykola Grymalyuk
ff0012e214 CHANGELOG: Adjust BT note 2023-01-07 20:04:50 -07:00
Mykola Grymalyuk
91e7ff40e4 sys_patch: Add non-Metal support to Ventura 2023-01-07 08:44:37 -07:00
Mykola Grymalyuk
07d09d8eb2 sys_patch: Save HID CS when patching USB 1.1 2023-01-07 08:16:20 -07:00
Mykola Grymalyuk
b95ab91b43 sys_patch: Fix Patch set dictionary 2023-01-06 22:06:10 -07:00
Mykola Grymalyuk
4cc9e414d2 sys_patch: Add basic USB 1.1 support
Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021
2023-01-06 22:02:47 -07:00
Mykola Grymalyuk
a5d56147c0 sys_patch_detect: Ensure wifi patches are installed on subsequent runs 2023-01-06 15:19:58 -07:00
Mykola Grymalyuk
3e8963c372 Build: Add mini validation during GUI build 2023-01-06 14:33:40 -07:00
Mykola Grymalyuk
f4d6ef1741 Sync binaries to release variants 2023-01-02 09:23:14 -07:00
Mykola Grymalyuk
abbb9c1c66 Constants: Increment Copyright date 2023-01-01 19:10:35 -07:00
Mykola Grymalyuk
22b66e0a87 Sync CPUFriend 2022-12-30 12:55:14 -07:00
Mykola Grymalyuk
fd6c3d818d defaults: Work-around Control Center crashing with legacy Wifi 2022-12-30 11:45:10 -07:00
Mykola Grymalyuk
5fa0636f5c Docs: Sync Wifi and Vega changes 2022-12-27 20:48:18 -07:00
Mykola Grymalyuk
cefdd1df66 build: Add missing import 2022-12-27 18:24:12 -07:00
Mykola Grymalyuk
fcda4a26bf build: Expand KDKLWA usage to pre-AVX2 with native AMD 2022-12-27 18:05:39 -07:00
Mykola Grymalyuk
60f6482d43 sys_patch_detect: Ensure Network error halts patching 2022-12-26 11:44:23 -07:00
Mykola Grymalyuk
c316e6f5fe kdk_handler: Add extra network error handling 2022-12-25 21:58:13 -07:00
Mykola Grymalyuk
d30972e5ef generate.command: Support downloading latest release 2022-12-25 16:31:30 -07:00
Mykola Grymalyuk
5206028478 Constants: Fix CI validation 2022-12-25 15:08:25 -07:00
Mykola Grymalyuk
00043087c4 sys_patch_auto: Prompt on mismatched versions 2022-12-25 15:03:49 -07:00
Mykola Grymalyuk
d7ecdf3871 sys_patch: Adjust more indenation logic 2022-12-25 13:58:08 -07:00
Mykola Grymalyuk
6fe7ed614c auto_patcher: Adjust indentation logic 2022-12-25 13:44:14 -07:00
Mykola Grymalyuk
09f77490a5 Payloads: Remove unused gfxutil binary 2022-12-25 12:25:24 -07:00
Mykola Grymalyuk
1cc6d50474 OpenCore: Refactor generation script
Ensures utilities shipped with OpenCorePkg are always in-sync
2022-12-25 12:21:51 -07:00
Mykola Grymalyuk
549cb9fc9a build: Resolve SATA enumeration 2022-12-24 18:05:57 -07:00
Mykola Grymalyuk
a8ef84acf9 build: Add proper TS0128F/256F detection 2022-12-24 12:13:19 -07:00
Mykola Grymalyuk
f55d3ba5b2 build: Add backend comments for UHCI/OHCI 2022-12-23 10:38:11 -07:00
Mykola Grymalyuk
e46a5213a6 GUI: Move files into resources folder 2022-12-23 10:28:20 -07:00
Mykola Grymalyuk
2331aeb6d9 sys_patch: Add AMD Vega support for pre-AVX2.0 2022-12-22 20:14:10 -07:00
Mykola Grymalyuk
1277fef735 sys_patch: Clean LE properly 2022-12-21 21:15:06 -07:00
Mykola Grymalyuk
5fdde346cf sys_patch: Allow only wifi patches when no KDK/internet available 2022-12-19 17:01:06 -07:00
Mykola Grymalyuk
907ce75295 sys_patch: Implement legacy wifi support for Ventura 2022-12-19 14:13:17 -07:00
Mykola Grymalyuk
915d38eab1 build: Call NVMe fix function 2022-12-17 11:33:17 -07:00
Mykola Grymalyuk
8678200385 Increment Build 2022-12-17 11:30:01 -07:00
55 changed files with 1337 additions and 469 deletions

View File

@@ -85,6 +85,8 @@ class create_binary:
self.move_launcher()
self.patch_load_command()
self.add_commit_data()
self.post_flight_cleanup()
self.mini_validate()
def build_binary(self):
if Path(f"./dist/OpenCore-Patcher.app").exists():
@@ -266,5 +268,31 @@ class create_binary:
print(mv_output.stderr.decode('utf-8'))
raise Exception("Move failed")
def post_flight_cleanup(self):
# Remove ./dist/OpenCore-Patcher
path = "./dist/OpenCore-Patcher"
print(f" - Removing {path}")
rm_output = subprocess.run(
["rm", "-rf", path],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if rm_output.returncode != 0:
print(f" - Remove failed: {path}")
print(rm_output.stderr.decode('utf-8'))
raise Exception(f"Remove failed: {path}")
def mini_validate(self):
# Ensure binary can start
# Only build a single config, TUI CI will do in-depth validation
print(" - Validating binary")
validate_output = subprocess.run(
["./dist/OpenCore-Patcher.app/Contents/MacOS/OpenCore-Patcher", "--build", "--model", "MacPro3,1"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if validate_output.returncode != 0:
print(" - Validation failed")
print(validate_output.stderr.decode('utf-8'))
raise Exception("Validation failed")
if __name__ == "__main__":
create_binary()

View File

@@ -1,5 +1,66 @@
# OpenCore Legacy Patcher changelog
## 0.6.1
- Avoid usage of KDKlessWorkaround on hardware not requiring it
- Resolves AMD Graphics Regression from 0.5.3
- Increment Binaries:
- KDKlessWorkaround 1.0.0 - rolling (8e41f39)
## 0.6.0
- Resolve external NVMe reporting regression from 0.5.2
- Implement Legacy Wireless support for Ventura
- Applicable for BCM94328, BCM94322 and Atheros chipsets
- Implement Wifi-only patches when no internet connection available but required (ie. KDKs)
- Allows users to install Legacy Wireless patches, then connect to the internet to install remaining patches
- Resolve `/Library/Extensions` not being cleaned on KDK-less root patches
- Add AMD Vega Graphics support for pre-AVX2.0 systems on Ventura
- ex. AMD Vega 56 and 64, AMD Radeon VII
- Note: As with Polaris, Vega GPUs cannot be mixed with AMD GCN 1-3 patches
- Patcher will prioritize the AMD GCN 1-3 (assumption that GCN is primary GPU, ex. MacPro6,1)
- Implement proper `APPLE SSD TS0128F/256F` detection
- Allows all Macs to utilize patch if required
- Avoids usage of patch when host lacks affected drive (ex. MacBookAir6,x with upgraded SSD)
- Prompt with auto patcher when booted OpenCore is out of date to root patcher
- ex. Booted OCLP is 0.5.2, root patcher is 0.5.3
- Disable native AMD Graphics on pre-Haswell Macs in Ventura
- Allows for easy root patching, dropping reliance on Safe Mode to boot
- Primarily applicable for iMacs and Mac Pros with AMD Polaris and Vega GPUs
- Implement mini validation during GUI build
- Add early UHCI/OHCI support (USB1.1)
- Implemented via Root Volume patching, ie. no installer support at this time
- Support should be seen as experimental, especially for laptops
- Applicable for Penryn Macs and Cheese Grater Mac Pros (MacPro3,1 - MacPro5,1)
- See associated issue for current limitations: [Legacy UHCI/OHCI support in Ventura](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021)
- USB 3.0 controllers cannot be used along side USB 1.1 patches, OCLP will prioritize USB 3.0 support
- Add early non-Metal Graphics Acceleration support for macOS Ventura
- Applicable for following GPU architectures:
- Intel Ironlake and Sandy Bridge
- Nvidia Tesla, Maxwell and Pascal
- AMD TeraScale 1 and 2
- Notes:
- Bluetooth Pairing is currently semi-functional, see here for work around: [Tab+Space work-around](https://forums.macrumors.com/threads/macos-13-ventura-on-unsupported-macs-thread.2346881/post-31858759)
- AMFI currently needs to be outright disabled in Ventura
- Overall non-Metal improvements:
- Improved fake rim
- Fixed full screen animation
- Fixed split screen
- Improved menubar blur
- Add Nvidia Kepler GOP Driver injection
- Primarily for GPUs lacking GOPs and can't have a newer VBIOS flashed
- Resolve Rapid Security Response support for Haswell+ Macs requiring KDKs
- Implemented via:
- Userspace: [RSRRepair](https://github.com/flagersgit/RSRRepair) at `/etc/rc.server` (2b1c9e3)
- Kernelspace: [RSRHelper.kext](https://github.com/khronokernel/RSRHelper) (cbe1be9)
- Add APFS Trim Configuration
- Settings -> Misc Settings -> APFS Trim
- Increment Binaries:
- OpenCorePkg 0.8.8 - release
- PatcherSupportPkg 0.8.2 - release
- KDKlessWorkaround 1.0.0 - rolling (4924276)
- FeatureUnlock 1.1.2 - release
- CPUFriend 1.2.6 - release
- Lilu 1.6.3 - release
## 0.5.3
- Integrate FixPCIeLinkrate.efi v0.1.0
- Fixes link rate for PCIe 3.0 devices on MacPro3,1

View File

@@ -81,13 +81,12 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"/Library/Application Support/SkyLightPlugins": {
**({ "DropboxHack.dylib": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "DropboxHack.txt": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "CatalystButton.dylib": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "CatalystButton.txt": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
},
},
"Processes": {
# 'When Space Allows' option introduced in 12.4 (XNU 21.5)
**({"defaults write /Library/Preferences/.GlobalPreferences.plist ShowDate -int 1": True } if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 4, os_major, os_minor) else {}),
"defaults write /Library/Preferences/.GlobalPreferences.plist InternalDebugUseGPUProcessForCanvasRenderingEnabled -bool false": True,
},
},
"Non-Metal IOAccelerator Common": {
@@ -630,6 +629,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"AMD8000Controller.kext": "12.5",
"AMD9000Controller.kext": "12.5",
"AMD9500Controller.kext": "12.5",
"AMD10000Controller.kext": "12.5",
"AMDRadeonX4000.kext": "12.5",
"AMDRadeonX4000HWServices.kext": "12.5",
"AMDFramebuffer.kext": "12.5",
@@ -640,14 +640,6 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"AMDShared.bundle": "12.5",
},
},
"Remove": {
"/System/Library/Extensions": [
# Due to downgraded AMDSupport.kext
# In the future, we will have to downgrade the entire AMD stack
# to support non-AVX2.0 machines with Vega or newer
"AMD10000Controller.kext",
],
},
},
# Used only for AMD Polaris with host lacking AVX2.0
# Note missing framebuffers are not restored (ex. 'ATY,Berbice')
@@ -673,6 +665,51 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
},
"AMD Legacy Vega": {
"Display Name": "Graphics: AMD Legacy Vega",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Extensions": {
"AMDRadeonX5000.kext": "12.5",
"AMDRadeonX5000GLDriver.bundle": "12.5",
"AMDRadeonX5000MTLDriver.bundle": "12.5",
"AMDRadeonX5000Shared.bundle": "12.5",
"AMDShared.bundle": "12.5",
},
},
},
# Support mixed legacy and modern AMD GPUs
# Specifically systems using AMD GCN 1-3 and Vega (ex. MacPro6,1 with eGPU)
# Assume 'AMD Legacy GCN' patchset is installed alongside this
"AMD Legacy Vega Extended": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Extensions": {
"AMDRadeonX5000HWServices.kext": "12.5",
},
},
},
"Intel Ironlake": {
"Display Name": "Graphics: Intel Ironlake",
"OS Support": {
@@ -874,25 +911,50 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.monterey,
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/usr/libexec": {
"airportd": "11.5.2",
"airportd": "11.7.1",
},
"/System/Library/CoreServices": {
"WiFiAgent.app": "11.5.2",
"WiFiAgent.app": "11.7.1",
},
},
"Install Non-Root": {
"/Library/Application Support/SkyLightPlugins": {
**({ "CoreWLAN.dylib": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "CoreWLAN.txt": "SkyLightPlugins" } if os_major >= os_data.os_data.monterey else {}),
**({ "CoreWLAN.dylib": "SkyLightPlugins" } if os_major == os_data.os_data.monterey else {}),
**({ "CoreWLAN.txt": "SkyLightPlugins" } if os_major == os_data.os_data.monterey else {}),
},
},
},
"Legacy Wireless Extended": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/usr/libexec": {
"wps": "12.6.2",
},
"/System/Library/Frameworks": {
"CoreWLAN.framework": "12.6.2",
},
"/System/Library/PrivateFrameworks": {
"CoreWiFi.framework": "12.6.2",
"IO80211.framework": "12.6.2",
},
},
}
},
"Brightness": {
"Legacy Backlight Control": {
@@ -967,6 +1029,28 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"defaults write /Library/Preferences/.GlobalPreferences.plist Moraea_BacklightHack -bool true": True,
},
},
"Legacy USB 1.1": {
"Display Name": "Miscellaneous: Legacy USB 1.1",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Extensions/IOUSBHostFamily.kext/Contents/MacOS": {
"IOUSBHostFamily": "12.6.2",
},
"/System/Library/Extensions/IOUSBHostFamily.kext/Contents/PlugIns": {
"AppleUSBEHCI.kext": "12.6.2",
"AppleUSBHub.kext": "12.6.2",
},
},
}
},
}

View File

@@ -13,6 +13,7 @@
* [Unable to allow Safari Extensions](#unable-to-allow-Safari-Extensions)
* [Cannot Login on 2011 15" and 17" MacBook Pros](#cannot-login-on-2011-15-and-17-macbook-pros)
* [Black Boxes on HD3000 iGPUs](#black-boxes-on-hd3000-igpus)
* [Cannot Pair Bluetooth Devices](#cannot-pair-bluetooth-devices)
The below page is for users experiencing issues with their overall usage of macOS Big Sur / macOS Monterey and the Legacy Graphics Acceleration patches. Note that the following GPUs currently do not have acceleration support in Big Sur / Monterey:
@@ -179,8 +180,18 @@ A somewhat strange issue on Intel HD3000-based Macs, on 3rd party displays somet
* Mainly applicable for HDMI Displays, DVI and DisplayPort are generally unaffected.
* If you're inside Setup Assistant, press `Cmd` + `Option` + `Control` + `T` to launch Terminal. From there, run `open /System/Applications/System\ Preferences.app`
* Issue has spread to more Macs with macOS Ventura, including MacBook Airs and MacBook Pros
| Default Color Profile | Display/Display P3 Profile |
| :--- | :--- |
| ![](../images/HD3000-Default-Colors.png) | ![](../images/HD3000-Display-Colors.png) |
## Cannot Pair Bluetooth Devices
In macOS Ventura, hover states may not function correctly which results in the "Connect" button not appearing in System Settings. To resolve:
1. Enable Keyboard Navigation in System Settings -> Keyboard
2. Tab + space over Bluetooth devices in System Settings -> Bluetooth
3. Pair button should appear
For more information, see [ASentientBot's post](https://forums.macrumors.com/threads/macos-13-ventura-on-unsupported-macs-thread.2346881/page-116?post=31858759#post-31858759).

View File

@@ -10,6 +10,11 @@ Next, run the `OpenCore-Patcher.app`:
![](../images/OCLP-GUI-Main-Menu.png)
::: warning
OpenCore configurations are hardware specific.
If you're building OpenCore for a different model than you're currently running, it is absolutely necessary to select the proper model from Settings.
:::
Here we'll select Build and Install OpenCore and start building:
| Start Building | Finished Building |

View File

@@ -19,7 +19,7 @@ Here are some common errors users may experience while using this patcher:
* [Cannot Disable SIP in recoveryOS](#cannot-disable-sip-in-recoveryos)
* [Stuck on "Less than a minute remaining..."](#stuck-on-less-than-a-minute-remaining)
* [No acceleration after a Metal GPU swap on Mac Pro](#no-acceleration-after-a-metal-gpu-swap-on-mac-pro)
* [Keyboard, Mouse and Trackpad not working in installer or after update](#keyboard-mouse-and-trackpad-not-working-in-installer-or-after-update)
## OpenCore Legacy Patcher not launching
@@ -161,3 +161,26 @@ Alternatively, you can remove "AutoPkg-Assets.pkg" from /Library/Packages on the
The reason for this is that the autopatcher will assume that you will be using the original graphics card and therefore does non-metal patching, which includes removing some drivers for other cards. This causes Metal cards to not accelerate after swapping.
## Keyboard, Mouse and Trackpad not working in installer or after update
For Macs using legacy USB 1.1 controllers, OpenCore Legacy Patcher can only restore support once it has performed root volume patches. Thus to install macOS, you need to hook up a USB hub between your Mac and Keyboard/Mouse.
* For MacBook users, you'll need to find an external keyboard/mouse in addition to the USB hub
More information can be found here:
* [Legacy UHCI/OHCI support in Ventura #1021](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021)
Applicable models include:
| Family | Year | Model | Notes |
| :---------- | :--------------------| :---------------------------- | :----------------------------------------------- |
| MacBook | Mid 2010 and older | MacBook4,1 - MacBook7,1 | |
| MacBook Air | Late 2010 and older | MacBookAir2,1 - MacBookAir3,x | |
| MacBook Pro | Mid 2010 and older | MacBookPro4,1 - MacBookPro7,x | Excludes Mid 2010 15" and 17" (MacBookPro6,x) |
| iMac | Late 2009 and older | iMac7,1 - iMac10,x | Excludes Core i5/7 27" late 2009 iMac (iMac11,1) |
| Mac mini | Mid 2011 and older | Macmini3,1 - Macmini5,x | |
| Mac Pro | Mid 2010 and older | MacPro3,1 - MacPro5,1 | |
![](../images/usb11-chart.png)

View File

@@ -24,16 +24,12 @@ Ventura's release dropped a large amount of Intel hardware, thus requiring the u
## Current status
Overall, macOS Ventura is useable on most Metal-capable machines (ie. 2012 and newer). The graphics patches implemented have near feature parity to macOS Monterey, with patches still being under heavy development. See [Legacy Metal Graphics Support and macOS Ventura #1008](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1008) issue for more information.
<img width="625" alt="" src="../images/OCLP-051-Initial-Support.png">
<img width="625" alt="" src="../images/OCLP-060-Initial-Support.png">
For older hardware, see below sections:
* [Currently Unsupported/Broken Hardware in Ventura](#currently-unsupportedbroken-hardware-in-ventura)
* [AMD Polaris, Vega and Navi support on pre-2019 Mac Pros and pre-2012 iMacs](#amd-polaris-vega-and-navi-support-on-pre-2019-mac-pros-and-pre-2012-imacs)
* [Non-Metal Graphics Acceleration](#non-metal-graphics-acceleration)
* [Legacy Wireless Support](#legacy-wireless-support)
* [USB 1.1 (OHCI/UHCI) Support](#usb-11-ohciuhci-support)
* [Ethernet issue with Early 2008 Mac Pro](#ethernet-issue-with-early-2008-mac-pro)
@@ -47,22 +43,73 @@ For users with 2008 to 2013 Mac Pros (MacPro3,1-6,1) and 2009 to 2011 iMacs (iMa
* CPUs supporting AVX2.0 are Haswell or newer, which no pre-2019 Mac Pros can be upgraded with.
Currently at this time, OpenCore Legacy Patcher only supports patching the AMD Polaris Graphics stack to no longer require AVX2.0. However due to lack of hardware on-hand, we cannot support Navi on Ventura.
* If you have spare Navi GPU you'd like to donate, feel free to reach out: khronokernel@icloud.com
* Thanks to a gracious user, we've gotten an AMD Vega 64 on-hand for testing. No time estimate can be provided for Vega support at this time.
Additionally, the native stack will crash over and over on macOS Ventura as it fails to load the AVX2.0-based binaries. Thus to patch Ventura, you will need to boot in Safe Mode and run OCLP's Root Volume Patcher
* To enter Safe Mode, hold Shift+Enter when selecting Ventura in OCLP's Boot Picker
Currently at this time, OpenCore Legacy Patcher only supports patching the AMD Polaris and Vega Graphics stack to no longer require AVX2.0. We're recently received an AMD RX 6600 donation, so hopefully in the future the project can support AMD Navi with pre-Haswell Macs. However no time estimates can be given.
Following GPUs are applicable:
| GPU Architecture | Model Families | Supported |
| :--- | :--- | :--- |
| AMD Polaris | RX 4xx/5xx (10/20 series) | <span style="color:#30BCD5"> Supported with patching </span> |
| AMD Vega | Vega 56/64/VII (10/20 series) | <span style="color:red"> Unsupported </span> |
| AMD Navi | RX 5xxx/6xxx (10/20 series) | ^^ |
| AMD Vega | Vega 56/64/VII (10/20 series) | ^^ |
| AMD Navi | RX 5xxx/6xxx (10/20 series) | <span style="color:red"> Unsupported </span> |
### USB 1.1 (OHCI/UHCI) Support
For Penryn systems and pre-2013 Mac Pros, USB 1.1 support was outright removed in macOS Ventura. While USB 1.1 may seem unimportant, it handles many important devices on your system. These include:
* Keyboard and Trackpad for laptops
* IR Receivers
* Bluetooth
With OpenCore Legacy Patcher v0.6.0, basic support has been implemented via Root Volume patching. However due to this, users will need to use a USB hub for installation and post-OS updates when patches are cleaned:
![](../images/usb11-chart.png)
::: warning The following systems rely on USB 1.1
* iMac10,x and older
* Macmini3,1 and older
* MacBook7,1 and older
* MacBookAir3,1 and older
* MacBookPro7,1 and older
* MacBookPro6,x is exempt
* MacPro5,1 and older
:::
### Ethernet issue with Early 2008 Mac Pro
MacPro3,1 suffers from Ethernet driver dying after returning from sleep, current workaround is to use a USB Ethernet adapter or disable sleep.
::: details Legacy Wireless Support (Resolved in v0.6.0)
### Legacy Wireless Support
For systems that required Root Patches in macOS Monterey to achieve Wireless support, unfortunately macOS Ventura has broken the patch set. Currently the following Wifi cards are unsupported:
* Atheros: All models
* Broadcom: BCM94328 and BCM94322
The following machines shipped stock with these cards:
* iMac12,x and older
* Macmini3,1 and older
* MacBook5,x and older
* MacBookAir2,1 and older
* MacBookPro7,1 and older
* MacBookPro6,x is exempt
* MacPro5,1 and older
Currently BCM943224, BCM94331, BCM94360 and BCM943602 are still fully supported by OpenCore Legacy Patcher. Consider upgrading to these cards if possible.
:::
::: details Non-Metal Graphics Acceleration (Resolved in 0.6.0 and newer)
### Non-Metal Graphics Acceleration
@@ -84,8 +131,6 @@ The following GPUs are applicable:
The following machines shipped stock with an unsupported GPU:
::: warning Systems shipped with non-Metal Graphics Cards
* iMac7,1 - iMac12,x
* MacBook4,1 - MacBook7,1
* MacBookAir2,1 - MacBookAir4,x
@@ -94,54 +139,5 @@ The following machines shipped stock with an unsupported GPU:
* MacPro3,1 - MacPro5,1
* Xserve2,1 - Xserve3,1
:::
### Legacy Wireless Support
For systems that required Root Patches in macOS Monterey to achieve Wireless support, unfortunately macOS Ventura has broken the patch set. Currently the following Wifi cards are unsupported:
* Atheros: All models
* Broadcom: BCM94328 and BCM94322
The following machines shipped stock with these cards:
::: warning Systems shipped with applicable cards
* iMac12,x and older
* Macmini3,1 and older
* MacBook5,x and older
* MacBookAir2,1 and older
* MacBookPro7,1 and older
* MacBookPro6,x is exempt
* MacPro5,1 and older
:::
Currently BCM943224, BCM94331, BCM94360 and BCM943602 are still fully supported by OpenCore Legacy Patcher. Consider upgrading to these cards if possible.
### USB 1.1 (OHCI/UHCI) Support
For Penryn systems and pre-2013 Mac Pros, USB 1.1 support was outright removed in macOS Ventura. While USB 1.1 may seem unimportant, it handles many important devices on your system. These include:
* Keyboard and Trackpad for laptops
* IR Receivers
* Bluetooth
::: warning The following systems rely on USB 1.1
* iMac10,x and older
* Macmini3,1 and older
* MacBook7,1 and older
* MacBookAir3,1 and older
* MacBookPro7,1 and older
* MacBookPro6,x is exempt
* MacPro5,1 and older
:::
### Ethernet issue with Early 2008 Mac Pro
MacPro3,1 suffers from Ethernet driver dying after returning from sleep, current workaround is to use a USB Ethernet adapter or disable sleep.
:::

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 KiB

BIN
images/usb11-chart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 KiB

View File

@@ -1545,6 +1545,24 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>RSRHelper.kext</string>
<key>Comment</key>
<string>RSRHelper</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string>Contents/MacOS/RSRHelper</string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>20.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
</array>
<key>Block</key>
<array/>
@@ -2539,6 +2557,18 @@
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
<string></string>
<key>Path</key>
<string>NVGOP_GK.efi</string>
<key>Enabled</key>
<false/>
<key>Arguments</key>
<string></string>
<key>LoadEarly</key>
<false/>
</dict>
<dict>
<key>Comment</key>
<string></string>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,89 +0,0 @@
#!/usr/bin/env python3
# Simple script to delete unnecessary files from OpenCore and move into place
# To use, simply :
# - Download an OpenCore build
# - Place the X64 folder in the /payloads/OpenCore folder
# - Rename to OpenCore-VERSION (ie. DEBUG or RELEASE)
# - Run script
# - Rename folders to appropriate versions (ie. OpenCore-Build)
# - Zip folders
# TODO:
# - Download latest builds from dortania.github.io
import subprocess
from pathlib import Path
build_types = [
"DEBUG",
"RELEASE",
]
bad_drivers = [
"AudioDxe.efi",
"BiosVideo.efi",
"CrScreenshotDxe.efi",
"Ext4Dxe.efi",
"HiiDatabase.efi",
"NvmExpressDxe.efi",
"OpenHfsPlus.efi",
"OpenNtfsDxe.efi",
"OpenPartitionDxe.efi",
"OpenUsbKbDxe.efi",
"OpenVariableRuntimeDxe.efi",
"Ps2KeyboardDxe.efi",
"Ps2MouseDxe.efi",
"ToggleSipEntry.efi",
"UsbMouseDxe.efi",
"XhciDxe.efi",
"Udp4Dxe.efi",
"TcpDxe.efi",
"SnpDxe.efi",
"MnpDxe.efi",
"Ip4Dxe.efi",
"HttpUtilitiesDxe.efi",
"HttpDxe.efi",
"HttpBootDxe.efi",
"DpcDxe.efi",
"DnsDxe.efi",
"Dhcp4Dxe.efi",
"ArpDxe.efi",
]
bad_tools = [
"ChipTune.efi",
"CleanNvram.efi",
"ControlMsrE2.efi",
"GopStop.efi",
"KeyTester.efi",
"MmapDump.efi",
"OpenControl.efi",
"ResetSystem.efi",
"RtcRw.efi",
"CsrUtil.efi",
"TpmInfo.efi",
]
for version in build_types:
print("- Creating S/L/C")
subprocess.run(f"mkdir -p ./OpenCore-{version}/System/Library/CoreServices".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
print("- Creating boot.efi Bootstrap")
subprocess.run(f"cp ./OpenCore-{version}/EFI/BOOT/BOOTx64.efi ./OpenCore-{version}/System/Library/CoreServices/boot.efi".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
print("- Deleting old BOOTx64.efi")
subprocess.run(f"rm -R ./OpenCore-{version}/EFI/BOOT/".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
for delete_drivers in bad_drivers:
if Path(f"./OpenCore-{version}/EFI/OC/Drivers/{delete_drivers}").exists():
print(f"- Deleting {delete_drivers}")
subprocess.run(f"rm ./OpenCore-{version}/EFI/OC/Drivers/{delete_drivers}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
else:
print(f"- Unable to find {delete_drivers}, skipping")
for delete_tools in bad_tools:
if Path(f".//OpenCore-{version}/EFI/OC/Tools/{delete_tools}").exists():
print(f"- Deleting {delete_tools}")
subprocess.run(f"rm ./OpenCore-{version}/EFI/OC/Tools/{delete_tools}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
else:
print(f"- Unable to find {delete_tools}, skipping")
print("- Renaming folder to OpenCore-Build and zipping")
subprocess.run(f"mv ./OpenCore-{version} ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(f"zip -r ./OpenCore-{version}.zip ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(f"rm -rf ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()

View File

@@ -0,0 +1,286 @@
#!/usr/bin/env python3
# Script to download and generate valid OpenCorePkg folder/file structure for use with OpenCore-Legacy-Patcher
# To use:
# - Download OpenCore-{VERSION}-{VARIANT}.zip
# - If no files are found, the script will download the latest version
# - Place zips in same directory as this script
# - Run script
import subprocess
from pathlib import Path
import requests
REPO_URL = "https://api.github.com/repos/acidanthera/OpenCorePkg/releases/latest"
BUILD_VARIANTS = [
"DEBUG",
"RELEASE"
]
UNUSED_DRIVERS = [
"AudioDxe.efi",
"BiosVideo.efi",
"CrScreenshotDxe.efi",
"Ext4Dxe.efi",
"HiiDatabase.efi",
"NvmExpressDxe.efi",
"OpenHfsPlus.efi",
"OpenNtfsDxe.efi",
"OpenPartitionDxe.efi",
"OpenUsbKbDxe.efi",
"OpenVariableRuntimeDxe.efi",
"Ps2KeyboardDxe.efi",
"Ps2MouseDxe.efi",
"ToggleSipEntry.efi",
"UsbMouseDxe.efi",
"XhciDxe.efi",
"Udp4Dxe.efi",
"TcpDxe.efi",
"SnpDxe.efi",
"MnpDxe.efi",
"Ip4Dxe.efi",
"HttpUtilitiesDxe.efi",
"HttpDxe.efi",
"HttpBootDxe.efi",
"DpcDxe.efi",
"DnsDxe.efi",
"Dhcp4Dxe.efi",
"ArpDxe.efi",
]
UNUSED_TOOLS = [
"ChipTune.efi",
"CleanNvram.efi",
"ControlMsrE2.efi",
"GopStop.efi",
"KeyTester.efi",
"MmapDump.efi",
"OpenControl.efi",
"ResetSystem.efi",
"RtcRw.efi",
"CsrUtil.efi",
"TpmInfo.efi",
]
IMPORTANT_UTILITIES = [
"macserial",
"ocvalidate",
]
class GenerateOpenCore:
def __init__(self):
print("Generating new OpenCore bundles...")
self.working_dir = None
self.set_directory()
self.validate_files()
self.generate()
print("New OpenCore bundles generated!")
def set_directory(self):
self.working_dir = Path(__file__).parent.absolute()
print(f"Working directory: {self.working_dir}")
self.debug_zip = None
self.release_zip = None
# Find OpenCore DEBUG zip
for file in self.working_dir.iterdir():
if file.name.endswith("DEBUG.zip") and file.name != "OpenCore-DEBUG.zip":
print(f" Found DEBUG zip: {file.name}")
self.debug_zip = file
# Find OpenCore RELEASE zip
for file in self.working_dir.iterdir():
if file.name.endswith("RELEASE.zip") and file.name != "OpenCore-RELEASE.zip":
print(f" Found RELEASE zip: {file.name}")
self.release_zip = file
if self.debug_zip is None:
self.download_new_binaries("DEBUG")
if self.release_zip is None:
self.download_new_binaries("RELEASE")
# Unzip both, rename to OpenCore-DEBUG and OpenCore-RELEASE
print("Unzipping DEBUG zip...")
subprocess.run (
["unzip", f"{self.debug_zip}", "-d", f"{self.working_dir}/OpenCore-DEBUG-ROOT"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
print("Unzipping RELEASE zip...")
subprocess.run (
["unzip", f"{self.release_zip}", "-d", f"{self.working_dir}/OpenCore-RELEASE-ROOT"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
for variant in BUILD_VARIANTS:
print(f"Moving {variant} folder...")
subprocess.run (
["mv", f"{self.working_dir}/OpenCore-{variant}-ROOT/X64", f"{self.working_dir}/OpenCore-{variant}"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if variant == "DEBUG":
for utility in IMPORTANT_UTILITIES:
print(f"Moving {utility} from {variant} variant...")
subprocess.run (
["rm", "-rf", f"{self.working_dir}/{utility}"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
subprocess.run (
["mv", f"{self.working_dir}/OpenCore-{variant}-ROOT/Utilities/{utility}/{utility}", f"{self.working_dir}/{utility}"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Remove root folder
subprocess.run (
["rm", "-rf", f"{self.working_dir}/OpenCore-{variant}-ROOT"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Remove zip files
print("Removing zip files...")
# remove debug_zip
subprocess.run (
["rm", "-rf", self.debug_zip],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# remove release_zip
subprocess.run (
["rm", "-rf", self.release_zip],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
def download_new_binaries(self, variant):
# Get latest release
print(f"Getting latest {variant}...")
latest_release = requests.get(REPO_URL).json()
# Get latest release download url
print(f" Getting latest {variant} download url...")
for asset in latest_release["assets"]:
if asset["name"].endswith(f"{variant}.zip"):
download_url = asset["browser_download_url"]
print(f" Download url: {download_url}")
break
if variant == "DEBUG":
self.debug_zip = f"{self.working_dir}/{asset['name']}"
elif variant == "RELEASE":
self.release_zip = f"{self.working_dir}/{asset['name']}"
else:
raise ValueError("Invalid variant!")
# Download latest release
print(f" Downloading latest {variant}...")
download = requests.get(download_url)
with open(f"{self.working_dir}/{asset['name']}", "wb") as f:
f.write(download.content)
def clean_old_bundles(self):
print("Cleaning old bundles...")
for variant in BUILD_VARIANTS:
if (self.working_dir / f"OpenCore-{variant}").exists():
print(f" Deleting old {variant} variant...")
subprocess.run (
["rm", "-rf", f"{self.working_dir}/OpenCore-{variant}"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
def validate_files(self):
for variant in BUILD_VARIANTS:
if not (self.working_dir / f"OpenCore-{variant}").exists():
raise FileNotFoundError(f"OpenCore-{variant} folder not found!")
def generate(self):
for variant in BUILD_VARIANTS:
print(f"Generating {variant} variant...")
self.generate_opencore(variant)
def generate_opencore(self, variant):
# Create S/L/C
print(" Creating SLC folder")
subprocess.run (
["mkdir", "-p", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Relocate contents of /EFI/BOOT to /S/L/C
print(" Relocating BOOT folder to SLC")
for file in (self.working_dir / f"OpenCore-{variant}/EFI/BOOT").iterdir():
subprocess.run (
["mv", f"{file}", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Rename BOOTx64.efi to boot.efi
print(" Renaming BOOTx64.efi to boot.efi")
subprocess.run (
["mv", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices/BOOTx64.efi", f"{self.working_dir}/OpenCore-{variant}/System/Library/CoreServices/boot.efi"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Delete BOOT folder
print(" Deleting BOOT folder")
subprocess.run (
["rm", "-rf", f"{self.working_dir}/OpenCore-{variant}/EFI/BOOT"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Delete unused drivers
print(" Deleting unused drivers")
for driver in UNUSED_DRIVERS:
if Path(f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Drivers/{driver}").exists():
print(f" Deleting {driver}")
subprocess.run (
["rm", f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Drivers/{driver}"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
else:
print(f" {driver} not found")
# Delete unused tools
print(" Deleting unused tools")
for tool in UNUSED_TOOLS:
if Path(f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Tools/{tool}").exists():
print(f" Deleting {tool}")
subprocess.run (
["rm", f"{self.working_dir}/OpenCore-{variant}/EFI/OC/Tools/{tool}"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
else:
print(f" {tool} not found")
# Rename OpenCore-<variant> to OpenCore-Build
print(" Renaming OpenCore folder")
subprocess.run (
["mv", f"{self.working_dir}/OpenCore-{variant}", f"{self.working_dir}/OpenCore-Build"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Create OpenCore-<variant>.zip
print(" Creating OpenCore.zip")
subprocess.run (
["ditto", "-c", "-k", "--sequesterRsrc", "--keepParent", f"{self.working_dir}/OpenCore-Build", f"{self.working_dir}/OpenCore-{variant}.zip"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# Delete OpenCore-Build
print(" Deleting OpenCore-Build")
subprocess.run (
["rm", "-rf", f"{self.working_dir}/OpenCore-Build"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if __name__ == "__main__":
GenerateOpenCore()

BIN
payloads/OpenCore/macserial Executable file

Binary file not shown.

BIN
payloads/OpenCore/ocvalidate Executable file

Binary file not shown.

BIN
payloads/Tools/RSRRepair Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,7 +3,7 @@
from resources import constants, device_probe, utilities
from resources.build import support
from data import smbios_data, model_array, os_data
from data import smbios_data, model_array, os_data, cpu_data
from pathlib import Path
@@ -26,6 +26,7 @@ class build_graphics_audio:
self.firmware_handling()
self.spoof_handling()
self.imac_mxm_patching()
self.ioaccel_workaround()
def graphics_handling(self):
@@ -281,11 +282,18 @@ class build_graphics_audio:
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
# AMD GOP VBIOS injection for AMD GCN 1-4 GPUs
if self.constants.gop_injection is True:
if self.constants.amd_gop_injection is True:
print("- Adding AMDGOP.efi")
shutil.copy(self.constants.amd_gop_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("AMDGOP.efi", "UEFI", "Drivers")["Enabled"] = True
# Nvidia Kepler GOP VBIOS injection
if self.constants.nvidia_kepler_gop_injection is True:
print("- Adding NVGOP_GK.efi")
shutil.copy(self.constants.nvidia_kepler_gop_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("NVGOP_GK.efi", "UEFI", "Drivers")["Enabled"] = True
def spoof_handling(self):
if self.constants.serial_settings == "None":
return
@@ -368,4 +376,86 @@ class build_graphics_audio:
self.amd_mxm_patch(self.gfx0_path)
elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler:
self.backlight_path_detection()
self.nvidia_mxm_patch(self.gfx0_path)
self.nvidia_mxm_patch(self.gfx0_path)
def ioaccel_workaround(self):
# Handle misc IOAccelerator issues
# When MTL bundles are missing from disk, WindowServer will repeatedly crash
# This primarily occurs when installing an RSR update, where root is cleaned but AuxKC is not
gpu_dict = []
if not self.constants.custom_model:
gpu_dict = self.constants.computer.gpus
else:
if not self.model in smbios_data.smbios_dictionary:
return
gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"]
# Check if KDKless and KDK GPUs are present
# We only want KDKless.kext if there are no KDK GPUs
has_kdkless_gpu = False
has_kdk_gpu = False
for gpu in gpu_dict:
if not self.constants.custom_model:
gpu = gpu.arch
if gpu in [
device_probe.Intel.Archs.Ivy_Bridge,
device_probe.Intel.Archs.Haswell,
device_probe.Intel.Archs.Broadwell,
device_probe.Intel.Archs.Skylake,
device_probe.NVIDIA.Archs.Kepler,
]:
has_kdkless_gpu = True
# Non-Metal KDK
if gpu in [
device_probe.NVIDIA.Archs.Tesla,
device_probe.NVIDIA.Archs.Maxwell,
device_probe.NVIDIA.Archs.Pascal,
device_probe.AMD.Archs.TeraScale_1,
device_probe.AMD.Archs.TeraScale_2,
device_probe.Intel.Archs.Iron_Lake,
device_probe.Intel.Archs.Sandy_Bridge,
]:
has_kdk_gpu = True
if gpu in [
# Metal KDK (always)
device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000,
]:
has_kdk_gpu = True
if gpu in [
# Metal KDK (pre-AVX2.0)
device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi,
]:
if (
self.model == "MacBookPro13,3" or
smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value
):
# MacBookPro13,3 has AVX2.0 however the GPU has an unsupported framebuffer
has_kdk_gpu = True
if has_kdkless_gpu is True and has_kdk_gpu is False:
# KDKlessWorkaround is required for KDKless GPUs
support.build_support(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path)
return
# KDKlessWorkaround supports disabling native AMD stack on Ventura for pre-AVX2.0 CPUs
# Applicable for Polaris, Vega, Navi GPUs
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] > cpu_data.cpu_data.ivy_bridge.value:
return
for gpu in gpu_dict:
if not self.constants.custom_model:
gpu = gpu.arch
if gpu in [
device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi,
]:
support.build_support(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path)
return

View File

@@ -33,7 +33,6 @@ class build_misc:
self.debug_handling()
self.cpu_friend_handling()
self.general_oc_handling()
self.aux_kc_workaround()
def feature_unlock_handling(self):
if self.constants.fu_status is True:
@@ -184,6 +183,25 @@ class build_misc:
if self.model in model_array.Missing_USB_Map_Ventura and self.constants.serial_settings not in ["Moderate", "Advanced"]:
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0"
# Add UHCI/OHCI drivers
# All Penryn Macs lack an internal USB hub to route USB 1.1 devices to the EHCI controller
# And MacPro4,1 and MacPro5,1 are the only post-Penryn Macs that lack an internal USB hub
# - Ref: https://techcommunity.microsoft.com/t5/microsoft-usb-blog/reasons-to-avoid-companion-controllers/ba-p/270710
#
# Required downgrades:
# - IOUSBHostFamily.kext (only kext itself, not plugins)
# - AppleUSBHub.kext
# - AppleUSBEHCI.kext
if (
smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \
self.model in ["MacPro4,1", "MacPro5,1"]
):
print("- Adding UHCI/OHCI USB support")
shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True
def debug_handling(self):
# DEBUG Settings (OpenCorePkg and Kernel Space)
@@ -228,24 +246,4 @@ class build_misc:
if self.constants.vault is True and utilities.check_command_line_tools() is True:
print("- Setting Vault configuration")
self.config["Misc"]["Security"]["Vault"] = "Secure"
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("OpenShell.efi", "Misc", "Tools")["Enabled"] = False
def aux_kc_workaround(self):
gpu_dict = []
if not self.constants.custom_model:
gpu_dict = self.constants.computer.gpus
else:
if self.model in smbios_data.smbios_dictionary:
gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"]
for gpu in gpu_dict:
if not self.constants.custom_model:
gpu = gpu.arch
if gpu in [
device_probe.Intel.Archs.Ivy_Bridge,
device_probe.Intel.Archs.Haswell,
device_probe.Intel.Archs.Broadwell,
device_probe.Intel.Archs.Skylake,
device_probe.NVIDIA.Archs.Kepler,
]:
support.build_support(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path)
break
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("OpenShell.efi", "Misc", "Tools")["Enabled"] = False

View File

@@ -41,6 +41,12 @@ class build_security:
# Lets us check in sys_patch.py if config supports FileVault
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv"
# Patch KC UUID panics due to RSR installation
# - Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1019
print("- Enabling KC UUID mismatch patch")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -nokcmismatchpanic"
support.build_support(self.model, self.constants, self.config).enable_kext("RSRHelper.kext", self.constants.rsrhelper_version, self.constants.rsrhelper_path)
if self.constants.disable_cs_lv is True:
print("- Disabling Library Validation")
# In Ventura, LV patch broke. For now, add AMFI arg

View File

@@ -19,12 +19,22 @@ class build_storage:
self.ahci_handling()
self.pata_handling()
self.misc_handling()
self.pcie_handling()
self.trim_handling()
def ahci_handling(self):
# MacBookAir6,x ship with an AHCI over PCIe SSD model 'APPLE SSD TS0128F' and 'APPLE SSD TS0256F'
# This controller is not supported properly in macOS Ventura, instead populating itself as 'Media' with no partitions
# To work-around this, use Monterey's AppleAHCI driver to force
if self.model in ["MacBookAir6,1", "MacBookAir6,2"]:
# To work-around this, use Monterey's AppleAHCI driver to force support
if not self.constants.custom_model:
sata_devices = [i for i in self.computer.storage if isinstance(i, device_probe.SATAController)]
for controller in sata_devices:
# https://linux-hardware.org/?id=pci:1179-010b-1b4b-9183
if controller.vendor_id == 0x1179 and controller.device_id == 0x010b:
print("- Enabling AHCI SSD patch")
support.build_support(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path)
break
elif self.model in ["MacBookAir6,1", "MacBookAir6,2"]:
print("- Enabling AHCI SSD patch")
support.build_support(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path)
@@ -117,4 +127,10 @@ class build_storage:
# However pre-Ivy Bridge don't support this feature
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
if (self.constants.computer.sdxc_controller and not self.constants.custom_model) or (self.model.startswith("MacBookPro8") or self.model.startswith("Macmini5")):
support.build_support(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path)
support.build_support(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path)
def trim_handling(self):
if self.constants.apfs_trim_timeout is False:
print(f"- Disabling APFS TRIM timeout")
self.config["Kernel"]["Quirks"]["SetApfsTrimTimeout"] = 0

View File

@@ -1,6 +1,6 @@
# pylint: disable=multiple-statements
# Define Files
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk
# Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
from pathlib import Path
from typing import Optional
@@ -12,35 +12,35 @@ from data import os_data
class Constants:
def __init__(self):
# Patcher Versioning
self.patcher_version = "0.5.3" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version = "0.7.1" # PatcherSupportPkg
self.patcher_version = "0.6.1" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version = "0.8.2" # PatcherSupportPkg
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/"
self.discord_link = "https://discord.gg/rqdPgH8xSN"
self.guide_link = "https://dortania.github.io/OpenCore-Legacy-Patcher/"
self.repo_link = "https://github.com/dortania/OpenCore-Legacy-Patcher"
self.repo_link_latest = f"{self.repo_link}/releases/tag/{self.patcher_version}"
self.copyright_date = "Copyright © 2020-2022 Dortania"
self.copyright_date = "Copyright © 2020-2023 Dortania"
self.installer_pkg_url = f"{self.repo_link}/releases/download/{self.patcher_version}/AutoPkg-Assets.pkg"
self.installer_pkg_url_nightly = "http://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython/main/AutoPkg-Assets.pkg.zip"
# OpenCore Versioning
# https://github.com/acidanthera/OpenCorePkg
self.opencore_commit = "10fc98f - 12-06-2022"
self.opencore_version = "0.8.7"
self.opencore_commit = "a753334 - 01-02-2023"
self.opencore_version = "0.8.8"
# Kext Versioning
## Acidanthera
## https://github.com/acidanthera
self.lilu_version = "1.6.2" # Lilu
self.whatevergreen_version = "1.6.2" # WhateverGreen
self.lilu_version = "1.6.3" # Lilu
self.whatevergreen_version = "1.6.3" # WhateverGreen
self.airportbcrmfixup_version = "2.1.6" # AirPortBrcmFixup
self.nvmefix_version = "1.0.9" # NVMeFix
self.applealc_version = "1.6.3" # AppleALC
self.restrictevents_version = "1.0.9" # RestrictEvents
self.featureunlock_version = "1.1.2" # FeatureUnlock
self.debugenhancer_version = "1.0.7" # DebugEnhancer
self.cpufriend_version = "1.2.5" # CPUFriend
self.cpufriend_version = "1.2.6" # CPUFriend
self.bluetool_version = "2.6.4" # BlueToolFixup (BrcmPatchRAM)
self.cslvfixup_version = "2.6.1" # CSLVFixup
self.autopkg_version = "1.0.1" # AutoPkgInstaller
@@ -79,6 +79,7 @@ class Constants:
self.mce_version = "1.0.0" # AppleMCEReporterDisabler
self.btspoof_version = "1.0.0" # Bluetooth-Spoof
self.aspp_override_version = "1.0.1" # ACPI_SMC_PlatformPlugin Override
self.rsrhelper_version = "1.0.0" # RSRHelper
## Syncretic
## https://forums.macrumors.com/members/syncretic.1173816/
@@ -181,7 +182,8 @@ class Constants:
self.allow_ts2_accel = True # Set TeraScale 2 Acceleration support
self.force_nv_web = False # Force Nvidia Web Drivers on Tesla and Kepler
self.force_output_support = False # Force Output support for Mac Pros with PC VBIOS
self.gop_injection = False # Set GOP Injection support
self.amd_gop_injection = False # Set GOP Injection support
self.nvidia_kepler_gop_injection = False # Set Kepler GOP Injection support
## Miscellaneous
self.disallow_cpufriend = False # Disable CPUFriend
@@ -210,10 +212,12 @@ class Constants:
self.commit_info = (None, None, None)
self.set_vmm_cpuid = False # Set VMM bit inside CPUID
self.oc_timeout = 5 # Set OpenCore timeout
self.apfs_trim_timeout = True # Set APFS Trim timeout
self.legacy_accel_support = [
os_data.os_data.big_sur,
os_data.os_data.monterey,
os_data.os_data.ventura,
]
# Payload Location
@@ -257,6 +261,10 @@ class Constants:
def amd_gop_driver_path(self):
return self.payload_path / Path("Drivers/AMDGOP.efi")
@property
def nvidia_kepler_gop_driver_path(self):
return self.payload_path / Path("Drivers/NVGOP_GK.efi")
@property
def xhci_driver_path(self):
return self.payload_path / Path("Drivers/XhciDxe.efi")
@@ -442,6 +450,10 @@ class Constants:
def cryptexfixup_path(self):
return self.payload_kexts_path / Path(f"Acidanthera/CryptexFixup-v{self.cryptexfixup_version}-{self.kext_variant}.zip")
@property
def rsrhelper_path(self):
return self.payload_kexts_path / Path(f"Acidanthera/RSRHelper-v{self.rsrhelper_version}-{self.kext_variant}.zip")
@property
def innie_path(self):
return self.payload_kexts_path / Path(f"Misc/Innie-v{self.innie_version}.zip")
@@ -570,11 +582,7 @@ class Constants:
# Tools
@property
def macserial_path(self):
return self.payload_path / Path("Tools/macserial")
@property
def gfxutil_path(self):
return self.payload_path / Path("Tools/gfxutil")
return self.payload_path / Path("OpenCore/macserial")
@property
def vault_path(self):
@@ -582,12 +590,16 @@ class Constants:
@property
def ocvalidate_path(self):
return self.payload_path / Path(f"Tools/ocvalidate-{self.opencore_version}")
return self.payload_path / Path(f"OpenCore/ocvalidate")
@property
def oclp_helper_path(self):
return self.payload_path / Path("Tools/OCLP-Helper")
@property
def rsrrepair_userspace_path(self):
return self.payload_path / Path("Tools/RSRRepair")
# Icons
@property
def app_icon_path(self):

View File

@@ -16,6 +16,8 @@ class generate_defaults:
self.constants.secure_status = False
self.constants.disable_cs_lv = False
self.constants.disable_amfi = False
self.constants.fu_status = True
self.constants.fu_arguments = None
self.constants.custom_serial_number = ""
self.constants.custom_board_serial_number = ""
@@ -119,17 +121,41 @@ class generate_defaults:
def networking_probe(self):
if (
isinstance(self.constants.computer.wifi, device_probe.Broadcom) and
self.constants.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224]
) or (
isinstance(self.constants.computer.wifi, device_probe.Atheros) and
self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40
):
# 12.0: Legacy Wireless chipsets require root patching
self.constants.sip_status = False
self.constants.secure_status = False
if self.host_is_target:
if not (
(
isinstance(self.constants.computer.wifi, device_probe.Broadcom) and
self.constants.computer.wifi.chipset in [
device_probe.Broadcom.Chipsets.AirPortBrcm4331,
device_probe.Broadcom.Chipsets.AirPortBrcm43224,
]
) or (
isinstance(self.constants.computer.wifi, device_probe.Atheros) and
self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40
)
):
return
else:
if not self.model in smbios_data.smbios_dictionary:
return
if (
smbios_data.smbios_dictionary[self.model]["Wireless Model"] not in [
device_probe.Broadcom.Chipsets.AirPortBrcm4331,
device_probe.Broadcom.Chipsets.AirPortBrcm43224,
device_probe.Atheros.Chipsets.AirPortAtheros40
]
):
return
# 12.0: Legacy Wireless chipsets require root patching
self.constants.sip_status = False
self.constants.secure_status = False
# 13.0: Enabling AirPlay to Mac patches breaks Control Center on legacy chipsets
# AirPlay to Mac was unsupported regardless, so we can safely disable it
self.constants.fu_status = True
self.constants.fu_arguments = " -disable_sidecar_mac"
def misc_hardwares_probe(self):
if self.host_is_target:
@@ -226,14 +252,4 @@ class generate_defaults:
self.constants.disable_cs_lv = True
if os_data.os_data.ventura in self.constants.legacy_accel_support:
# Only disable AMFI if we officially support Ventura
self.constants.disable_amfi = True
if self.host_is_target:
self.constants.host_is_non_metal = True
# If a Mac is non-Metal based, Beta Blur is highly recommended
if self.constants.detected_os >= os_data.os_data.big_sur:
for arg in ["Moraea_BlurBeta"]:
# If user explicitly set the blur, don't override
arg_result = subprocess.run(["defaults", "read", "-g", arg], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
if arg_result not in ["true", "1", "false", "0"]:
subprocess.run(["defaults", "write", "-g", arg, "-bool", "TRUE"])
self.constants.disable_amfi = True

View File

@@ -21,8 +21,8 @@ import py_sip_xnu
from resources import constants, defaults, install, installer, utilities, run, generate_smbios, updates, integrity_verification, global_settings, kdk_handler
from resources.sys_patch import sys_patch_download, sys_patch_detect, sys_patch, sys_patch_auto
from resources.build import build
from data import model_array, os_data, smbios_data, sip_data
from gui import menu_redirect, gui_help
from data import model_array, os_data, smbios_data, sip_data, cpu_data
from resources.gui import menu_redirect, gui_help
class wx_python_gui:
@@ -1692,18 +1692,32 @@ class wx_python_gui:
# Unsupported Models include:
# - USB 1.1 machines (Penryn, MacPro3,1-5,1)
# - Non-Metal GPUs
has_legacy_usb = False
issues_list = ""
model = self.constants.custom_model or self.constants.computer.real_model
if model in model_array.LegacyGPU or model in ["MacPro3,1", "MacPro4,1", "MacPro5,1"]:
if model in ["MacPro3,1", "MacPro4,1", "MacPro5,1"]:
has_legacy_usb = True
issues_list = "- Lack of Keyboard/Mouse in macOS installer without a USB hub\n"
elif model in smbios_data.smbios_dictionary[model]:
if "CPU Generation" in smbios_data.smbios_dictionary[model]:
if smbios_data.smbios_dictionary[model]["CPU Generation"] <= cpu_data.cpu_data.penryn:
has_legacy_usb = True
if model.startswith("MacBook"):
issues_list = "- Lack of internal Keyboard/Trackpad in macOS installer\n"
elif not model.startswith("MacPro"):
issues_list = "- Lack of internal Keyboard/Mouse in macOS installer\n"
if has_legacy_usb:
try:
app_major = app_dict['Version'].split(".")[0]
if float(app_major) > self.constants.os_support:
# Throw pop up warning OCLP does not support this OS
os = os_data.os_conversion.convert_kernel_to_marketing_name(os_data.os_conversion.os_to_kernel(app_major))
dlg = wx.MessageDialog(self.frame_modal, f"OpenCore Legacy Patcher currently does not support macOS {os} on your machine ({model}).\n\nThe newest version we officially support is macOS {os_data.os_conversion.convert_kernel_to_marketing_name(os_data.os_conversion.os_to_kernel(str(self.constants.os_support)))}. For more information, see the associated Ventura Github Issue.\n\nWould you still want to continue downloading macOS {os}?", "Unsupported OS", style=wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
dlg = wx.MessageDialog(self.frame_modal, f"OpenCore Legacy Patcher may not fully support macOS {os} on your machine ({model}).\n\nThe main issues include:\n{issues_list}\nThe newest version we recommend is macOS {os_data.os_conversion.convert_kernel_to_marketing_name(os_data.os_conversion.os_to_kernel(str(self.constants.os_support)))}. For more information, see the associated Github Issue.\n\nWould you still want to continue downloading macOS {os}?", "Unsupported OS", style=wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION)
dlg.SetYesNoCancelLabels("View Github Issue", "Download Anyways", "Cancel")
result = dlg.ShowModal()
if result == wx.ID_YES:
webbrowser.open("https://github.com/dortania/OpenCore-Legacy-Patcher/issues/998")
webbrowser.open("https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021")
return
elif result == wx.ID_NO:
pass
@@ -2581,23 +2595,33 @@ class wx_python_gui:
self.timeout_spinner.Centre(wx.HORIZONTAL)
# AMD GOP Injection
self.set_gop_injection = wx.CheckBox(self.frame_modal, label="AMD GOP Injection")
self.set_gop_injection.SetPosition(wx.Point(
self.set_amd_gop_injection = wx.CheckBox(self.frame_modal, label="AMD GOP Injection")
self.set_amd_gop_injection.SetPosition(wx.Point(
30,
self.timeout_spinner.GetPosition().y + self.timeout_spinner.GetSize().height + 5))
self.set_gop_injection.SetValue(self.constants.gop_injection)
self.set_gop_injection.Bind(wx.EVT_CHECKBOX, self.gop_injection_checkbox_click)
self.set_amd_gop_injection.SetValue(self.constants.amd_gop_injection)
self.set_amd_gop_injection.Bind(wx.EVT_CHECKBOX, self.amd_gop_injection_checkbox_click)
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"]
if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models):
self.set_gop_injection.Disable()
self.set_amd_gop_injection.Disable()
# Nvidia Kepler GOP injection
self.set_nvidia_kepler_gop_injection = wx.CheckBox(self.frame_modal, label="Nvidia Kepler GOP Injection")
self.set_nvidia_kepler_gop_injection.SetPosition(wx.Point(
self.set_amd_gop_injection.GetPosition().x,
self.set_amd_gop_injection.GetPosition().y + self.set_amd_gop_injection.GetSize().height))
self.set_nvidia_kepler_gop_injection.SetValue(self.constants.nvidia_kepler_gop_injection)
self.set_nvidia_kepler_gop_injection.Bind(wx.EVT_CHECKBOX, self.nvidia_kepler_gop_injection_checkbox_click)
if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models):
self.set_nvidia_kepler_gop_injection.Disable()
# Disable Thunderbolt
self.disable_thunderbolt_checkbox = wx.CheckBox(self.frame_modal, label="Disable Thunderbolt")
self.disable_thunderbolt_checkbox.SetValue(self.constants.disable_tb)
self.disable_thunderbolt_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_tb_click)
self.disable_thunderbolt_checkbox.SetPosition(wx.Point(
self.set_gop_injection.GetPosition().x,
self.set_gop_injection.GetPosition().y + self.set_gop_injection.GetSize().height))
self.set_nvidia_kepler_gop_injection.GetPosition().x,
self.set_nvidia_kepler_gop_injection.GetPosition().y + self.set_nvidia_kepler_gop_injection.GetSize().height))
self.disable_thunderbolt_checkbox.SetToolTip(wx.ToolTip("Disables Thunderbolt support on MacBookPro11,x\nMainly applicable for systems that cannot boot with Thunderbolt enabled"))
if not self.constants.custom_model and not self.computer.real_model.startswith("MacBookPro11"):
self.disable_thunderbolt_checkbox.Disable()
@@ -2838,6 +2862,14 @@ class wx_python_gui:
print("Wake on WLAN Disabled")
self.constants.enable_wake_on_wlan = False
def apfs_trim_click(self, event=None):
if self.apfs_trim_checkbox.GetValue():
print("APFS Trim Enabled")
self.constants.apfs_trim_timeout = True
else:
print("APFS Trim Disabled")
self.constants.apfs_trim_timeout = False
def content_caching_click(self, event=None):
if self.content_caching_checkbox.GetValue():
print("Content Caching Enabled")
@@ -2846,13 +2878,21 @@ class wx_python_gui:
print("Content Caching Disabled")
self.constants.set_content_caching = False
def gop_injection_checkbox_click(self, event=None):
if self.set_gop_injection.GetValue():
print("GOP Injection Enabled")
self.constants.gop_injection = True
def amd_gop_injection_checkbox_click(self, event=None):
if self.set_amd_gop_injection.GetValue():
print("AMD GOP Injection Enabled")
self.constants.amd_gop_injection = True
else:
print("GOP Injection Disabled")
self.constants.gop_injection = False
print("AMD GOP Injection Disabled")
self.constants.amd_gop_injection = False
def nvidia_kepler_gop_injection_checkbox_click(self, event=None):
if self.set_nvidia_kepler_gop_injection.GetValue():
print("Nvidia Kepler GOP Injection Enabled")
self.constants.nvidia_kepler_gop_injection = True
else:
print("Nvidia Kepler GOP Injection Disabled")
self.constants.nvidia_kepler_gop_injection = False
def disable_tb_click(self, event=None):
if self.disable_thunderbolt_checkbox.GetValue():
@@ -3518,12 +3558,19 @@ OpenCore Legacy Patcher by default knows the most ideal
self.content_caching_checkbox.SetPosition(wx.Point(self.wake_on_wlan_checkbox.GetPosition().x, self.wake_on_wlan_checkbox.GetPosition().y + self.wake_on_wlan_checkbox.GetSize().height))
self.content_caching_checkbox.SetToolTip(wx.ToolTip("Enables content caching support in macOS"))
# APFS Trim
self.apfs_trim_checkbox = wx.CheckBox(self.frame_modal, label="APFS Trim")
self.apfs_trim_checkbox.SetValue(self.constants.apfs_trim_timeout)
self.apfs_trim_checkbox.Bind(wx.EVT_CHECKBOX, self.apfs_trim_click)
self.apfs_trim_checkbox.SetPosition(wx.Point(self.content_caching_checkbox.GetPosition().x, self.content_caching_checkbox.GetPosition().y + self.content_caching_checkbox.GetSize().height))
self.apfs_trim_checkbox.SetToolTip(wx.ToolTip("Enables APFS Trim support in macOS"))
# Button: return to main menu
self.return_to_main_menu_button = wx.Button(self.frame_modal, label="Return to Settings")
self.return_to_main_menu_button.Bind(wx.EVT_BUTTON, self.settings_menu)
self.return_to_main_menu_button.SetPosition(wx.Point(
self.content_caching_checkbox.GetPosition().x,
self.content_caching_checkbox.GetPosition().y + self.content_caching_checkbox.GetSize().height + 10))
self.apfs_trim_checkbox.GetPosition().x,
self.apfs_trim_checkbox.GetPosition().y + self.apfs_trim_checkbox.GetSize().height + 10))
self.return_to_main_menu_button.Center(wx.HORIZONTAL)
# set frame_modal size below return to main menu button
@@ -3590,11 +3637,11 @@ OpenCore Legacy Patcher by default knows the most ideal
else:
is_blur_enabled = False
is_rim_enabled = subprocess.run(["defaults", "read", "-g", "Moraea_RimBeta"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
if is_rim_enabled in ["1", "true"]:
is_rim_enabled = True
is_rim_disabled = subprocess.run(["defaults", "read", "-g", "Moraea_RimBetaDisabled"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
if is_rim_disabled in ["1", "true"]:
is_rim_disabled = True
else:
is_rim_enabled = False
is_rim_disabled = False
# Checkbox: Dark Menu Bar
self.dark_menu_bar_checkbox = wx.CheckBox(self.frame_modal, label="Dark Menu Bar")
@@ -3610,8 +3657,8 @@ OpenCore Legacy Patcher by default knows the most ideal
self.enable_beta_blur_checkbox.SetPosition(wx.Point(self.dark_menu_bar_checkbox.GetPosition().x, self.dark_menu_bar_checkbox.GetPosition().y + self.dark_menu_bar_checkbox.GetSize().height + 7))
# Checkbox: Enable Beta Rim
self.enable_beta_rim_checkbox = wx.CheckBox(self.frame_modal, label="Enable Beta Rim")
self.enable_beta_rim_checkbox.SetValue(is_rim_enabled)
self.enable_beta_rim_checkbox = wx.CheckBox(self.frame_modal, label="Disable Beta Rim")
self.enable_beta_rim_checkbox.SetValue(is_rim_disabled)
self.enable_beta_rim_checkbox.Bind(wx.EVT_CHECKBOX, self.enable_beta_rim_click)
self.enable_beta_rim_checkbox.SetPosition(wx.Point(self.enable_beta_blur_checkbox.GetPosition().x, self.enable_beta_blur_checkbox.GetPosition().y + self.enable_beta_blur_checkbox.GetSize().height + 7))
@@ -3640,7 +3687,7 @@ OpenCore Legacy Patcher by default knows the most ideal
def enable_beta_rim_click(self, event=None):
if event.IsChecked():
subprocess.run(["defaults", "write", "-g", "Moraea_RimBeta", "-bool", "true"])
subprocess.run(["defaults", "write", "-g", "Moraea_RimBetaDisabled", "-bool", "true"])
else:
subprocess.run(["defaults", "write", "-g", "Moraea_RimBeta", "-bool", "false"])
subprocess.run(["defaults", "write", "-g", "Moraea_RimBetaDisabled", "-bool", "false"])
print("Beta Rim Enabled:", event.IsChecked())

View File

@@ -25,7 +25,7 @@ class kernel_debug_kit_handler:
print("- Fetching available KDKs")
try:
results = utilities.SESSION.get(KDK_API_LINK, headers={"User-Agent": f"OCLP/{self.constants.patcher_version}"})
results = utilities.SESSION.get(KDK_API_LINK, headers={"User-Agent": f"OCLP/{self.constants.patcher_version}"}, timeout=10)
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError):
print("- Could not contact KDK API")
return None
@@ -96,6 +96,11 @@ class kernel_debug_kit_handler:
# 0: Portal is up and file is available
# 1: Portal is up but file is not available
# 2: Portal is down
# 3: Network error
if utilities.verify_network_connection("https://developerservices2.apple.com/services/download") is False:
print("- Could not connect to the network")
return 3
TOKEN_URL_BASE = "https://developerservices2.apple.com/services/download"
remote_path = urllib.parse.urlparse(link).path
@@ -196,6 +201,10 @@ class kernel_debug_kit_handler:
msg += " and could not find a backup copy online"
print(f"- {msg}")
return False, msg, ""
elif result == 3:
msg = "Failed to connect to the internet"
print(f"- {msg}")
return False, msg, ""
if "github" in download_link:
result = utilities.download_file(download_link, self.constants.kdk_download_path)

View File

@@ -19,7 +19,7 @@ class OpenCoreLegacyPatcher:
if utilities.check_cli_args() is None:
if launch_gui is True:
utilities.disable_cls()
from gui import gui_main
from resources.gui import gui_main
gui_main.wx_python_gui(self.constants).main_menu(None)
else:
self.main_menu()

View File

@@ -111,7 +111,7 @@ class PatchSysVolume:
print(result.stdout.decode().strip())
return False
def merge_kdk_with_root(self):
def merge_kdk_with_root(self, save_hid_cs=False):
if self.skip_root_kmutil_requirement is True:
return
if self.constants.detected_os < os_data.os_data.ventura:
@@ -145,6 +145,14 @@ class PatchSysVolume:
raise Exception("Unable to find Kernel Debug Kit")
self.kdk_path = kdk_path
print(f"- Found KDK at: {kdk_path}")
# Due to some IOHIDFamily oddities, we need to ensure their CodeSignature is retained
cs_path = Path(self.mount_location) / Path("System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDEventDriver.kext/Contents/_CodeSignature")
if save_hid_cs is True and cs_path.exists():
print("- Backing up IOHIDEventDriver CodeSignature")
# Note it's a folder, not a file
utilities.elevated(["cp", "-r", cs_path, f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print("- Merging KDK with Root Volume")
utilities.elevated(
# Only merge '/System/Library/Extensions'
@@ -159,6 +167,16 @@ class PatchSysVolume:
raise Exception("Failed to merge KDK with Root Volume")
print("- Successfully merged KDK with Root Volume")
# Restore IOHIDEventDriver CodeSignature
if save_hid_cs is True and Path(f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak").exists():
print("- Restoring IOHIDEventDriver CodeSignature")
if not cs_path.exists():
print(" - CodeSignature folder missing, creating")
utilities.elevated(["mkdir", "-p", cs_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
utilities.elevated(["cp", "-r", f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak", cs_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
utilities.elevated(["rm", "-rf", f"{self.constants.payload_path}/IOHIDEventDriver_CodeSignature.bak"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
def unpatch_root_vol(self):
if self.constants.detected_os > os_data.os_data.catalina and self.root_supports_snapshot is True:
print("- Reverting to last signed APFS snapshot")
@@ -277,6 +295,9 @@ class PatchSysVolume:
for file in ["KextPolicy", "KextPolicy-shm", "KextPolicy-wal"]:
self.remove_file("/private/var/db/SystemPolicyConfiguration/", file)
else:
# Install RSRHelper utility to handle desynced KCs
sys_patch_helpers.sys_patch_helpers(self.constants).install_rsr_repair_binary()
print("- Successfully built new kernel cache")
return True
@@ -339,23 +360,20 @@ class PatchSysVolume:
if self.constants.detected_os < os_data.os_data.big_sur:
return
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if not Path(oclp_path).exists():
return
print("- Cleaning Auxiliary Kernel Collection")
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
for key in oclp_plist_data:
if "Install" not in oclp_plist_data[key]:
continue
for location in oclp_plist_data[key]["Install"]:
if not location.endswith("Extensions"):
oclp_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if Path(oclp_path).exists():
oclp_plist_data = plistlib.load(Path(oclp_path).open("rb"))
for key in oclp_plist_data:
if "Install" not in oclp_plist_data[key]:
continue
for file in oclp_plist_data[key]["Install"][location]:
if not file.endswith(".kext"):
for location in oclp_plist_data[key]["Install"]:
if not location.endswith("Extensions"):
continue
self.remove_file("/Library/Extensions", file)
for file in oclp_plist_data[key]["Install"][location]:
if not file.endswith(".kext"):
continue
self.remove_file("/Library/Extensions", file)
# Handle situations where users migrated from older OSes with a lot of garbage in /L*/E*
# ex. Nvidia Web Drivers, NetUSB, dosdude1's patches, etc.
@@ -513,7 +531,7 @@ class PatchSysVolume:
else:
print(f"- Running Process:\n{process}")
utilities.process_status(subprocess.run(process, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True))
if any(x in required_patches for x in ["AMD Legacy GCN", "AMD Legacy Polaris"]):
if any(x in required_patches for x in ["AMD Legacy GCN", "AMD Legacy Polaris", "AMD Legacy Vega"]):
sys_patch_helpers.sys_patch_helpers(self.constants).disable_window_server_caching()
if any(x in required_patches for x in ["Intel Ivy Bridge", "Intel Haswell"]):
sys_patch_helpers.sys_patch_helpers(self.constants).remove_news_widgets()
@@ -544,7 +562,10 @@ class PatchSysVolume:
raise Exception(f"Failed to find {source_file}")
# Ensure KDK is properly installed
self.merge_kdk_with_root()
should_save_cs = False
if "Legacy USB 1.1" in required_patches:
should_save_cs = True
self.merge_kdk_with_root(save_hid_cs=should_save_cs)
print("- Finished Preflight, starting patching")

View File

@@ -14,7 +14,7 @@ import subprocess
import webbrowser
from resources import utilities, updates, global_settings
from resources.sys_patch import sys_patch_detect
from gui import gui_main
from resources.gui import gui_main
class AutomaticSysPatch:
@@ -24,90 +24,132 @@ class AutomaticSysPatch:
def start_auto_patch(self):
print("- Starting Automatic Patching")
if self.constants.wxpython_variant is True:
if utilities.check_seal() is True:
print("- Detected Snapshot seal intact, detecting patches")
patches = sys_patch_detect.detect_root_patch(self.constants.computer.real_model, self.constants).detect_patch_set()
if not any(not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True for patch in patches):
patches = []
if patches:
print("- Detected applicable patches, determining whether possible to patch")
if patches["Validation: Patching Possible"] is True:
print("- Determined patching is possible, checking for OCLP updates")
patch_string = ""
for patch in patches:
if patches[patch] is True and not patch.startswith("Settings") and not patch.startswith("Validation"):
patch_string += f"- {patch}\n"
# Check for updates
dict = updates.check_binary_updates(self.constants).check_binary_updates()
if not dict:
print("- No new binaries found on Github, proceeding with patching")
if self.constants.launcher_script is None:
args_string = f"'{self.constants.launcher_binary}' --gui_patch"
else:
args_string = f"{self.constants.launcher_binary} {self.constants.launcher_script} --gui_patch"
warning_str = ""
if utilities.verify_network_connection("https://api.github.com/repos/dortania/OpenCore-Legacy-Patcher/releases/latest") is False:
warning_str = f"""\n\nWARNING: We're unable to verify whether there are any new releases of OpenCore Legacy Patcher on Github. Be aware that you may be using an outdated version for this OS. If you're unsure, verify on Github that OpenCore Legacy Patcher {self.constants.patcher_version} is the latest official release"""
args = [
"osascript",
"-e",
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nmacOS wipes all root patches during OS installs and updates, so they need to be reinstalled.\n\nFollowing Patches have been detected for your system: \n{patch_string}\nWould you like to apply these patches?{warning_str}" """
f'with icon POSIX file "{self.constants.app_icon_path}"',
]
output = subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if output.returncode == 0:
args = [
"osascript",
"-e",
f'''do shell script "{args_string}"'''
f' with prompt "OpenCore Legacy Patcher would like to patch your root volume"'
" with administrator privileges"
" without altering line endings"
]
subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
else:
for key in dict:
version = dict[key]["Version"]
github_link = dict[key]["Github Link"]
print(f"- Found new version: {version}")
# launch osascript to ask user if they want to apply the update
# if yes, open the link in the default browser
# we never want to run the root patcher if there are updates available
args = [
"osascript",
"-e",
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nHowever we've detected a new version of OCLP on Github. Would you like to view this?\n\nCurrent Version: {self.constants.patcher_version}\nLatest Version: {version}\n\nNote: After downloading the latest OCLP version, open the app and run the 'Post Install Root Patcher' from the main menu." """
f'with icon POSIX file "{self.constants.app_icon_path}"',
]
output = subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if output.returncode == 0:
webbrowser.open(github_link)
else:
print("- Cannot run patching")
else:
print("- No patches detected")
self.determine_if_boot_matches()
else:
print("- Detected Snapshot seal not intact, skipping")
self.determine_if_boot_matches(self.constants)
else:
if self.constants.wxpython_variant is False:
print("- Auto Patch option is not supported on TUI, please use GUI")
return
if utilities.check_seal() is True:
print("- Detected Snapshot seal intact, detecting patches")
patches = sys_patch_detect.detect_root_patch(self.constants.computer.real_model, self.constants).detect_patch_set()
if not any(not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True for patch in patches):
patches = []
if patches:
print("- Detected applicable patches, determining whether possible to patch")
if patches["Validation: Patching Possible"] is False:
print("- Cannot run patching")
return
print("- Determined patching is possible, checking for OCLP updates")
patch_string = ""
for patch in patches:
if patches[patch] is True and not patch.startswith("Settings") and not patch.startswith("Validation"):
patch_string += f"- {patch}\n"
# Check for updates
dict = updates.check_binary_updates(self.constants).check_binary_updates()
if not dict:
print("- No new binaries found on Github, proceeding with patching")
if self.constants.launcher_script is None:
args_string = f"'{self.constants.launcher_binary}' --gui_patch"
else:
args_string = f"{self.constants.launcher_binary} {self.constants.launcher_script} --gui_patch"
warning_str = ""
if utilities.verify_network_connection("https://api.github.com/repos/dortania/OpenCore-Legacy-Patcher/releases/latest") is False:
warning_str = f"""\n\nWARNING: We're unable to verify whether there are any new releases of OpenCore Legacy Patcher on Github. Be aware that you may be using an outdated version for this OS. If you're unsure, verify on Github that OpenCore Legacy Patcher {self.constants.patcher_version} is the latest official release"""
args = [
"osascript",
"-e",
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nmacOS wipes all root patches during OS installs and updates, so they need to be reinstalled.\n\nFollowing Patches have been detected for your system: \n{patch_string}\nWould you like to apply these patches?{warning_str}" """
f'with icon POSIX file "{self.constants.app_icon_path}"',
]
output = subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if output.returncode == 0:
args = [
"osascript",
"-e",
f'''do shell script "{args_string}"'''
f' with prompt "OpenCore Legacy Patcher would like to patch your root volume"'
" with administrator privileges"
" without altering line endings"
]
subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
return
else:
for key in dict:
version = dict[key]["Version"]
github_link = dict[key]["Github Link"]
print(f"- Found new version: {version}")
# launch osascript to ask user if they want to apply the update
# if yes, open the link in the default browser
# we never want to run the root patcher if there are updates available
args = [
"osascript",
"-e",
f"""display dialog "OpenCore Legacy Patcher has detected you're running without Root Patches, and would like to install them.\n\nHowever we've detected a new version of OCLP on Github. Would you like to view this?\n\nCurrent Version: {self.constants.patcher_version}\nLatest Version: {version}\n\nNote: After downloading the latest OCLP version, open the app and run the 'Post Install Root Patcher' from the main menu." """
f'with icon POSIX file "{self.constants.app_icon_path}"',
]
output = subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if output.returncode == 0:
webbrowser.open(github_link)
return
else:
print("- No patches detected")
else:
print("- Detected Snapshot seal not intact, skipping")
if self.determine_if_versions_match() is False:
self.determine_if_boot_matches()
def determine_if_versions_match(self):
print("- Checking booted vs installed OCLP Build")
if self.constants.computer.oclp_version is None:
print("- Booted version not found")
return False
if self.constants.computer.oclp_version == self.constants.patcher_version:
print("- Versions match")
return False
# Check if installed version is newer than booted version
if updates.check_binary_updates(self.constants).check_if_build_newer(
self.constants.computer.oclp_version.split("."), self.constants.patcher_version.split(".")
) is True:
print("- Installed version is newer than booted version")
return False
args = [
"osascript",
"-e",
f"""display dialog "OpenCore Legacy Patcher has detected that you are booting an outdated OpenCore build\n- Booted: {self.constants.computer.oclp_version}\n- Installed: {self.constants.patcher_version}\n\nWould you like to update the OpenCore bootloader?" """
f'with icon POSIX file "{self.constants.app_icon_path}"',
]
output = subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if output.returncode == 0:
print("- Launching GUI's Build/Install menu")
self.constants.start_build_install = True
gui_main.wx_python_gui(self.constants).main_menu(None)
return True
def determine_if_boot_matches(self):
# Goal of this function is to determine whether the user
@@ -118,116 +160,124 @@ class AutomaticSysPatch:
# and ask if they want to install to install to disk
print("- Determining if macOS drive matches boot drive")
should_notify = global_settings.global_settings().read_property("AutoPatch_Notify_Mismatched_Disks")
if should_notify is False:
print("- Skipping due to user preference")
elif self.constants.host_is_hackintosh is True:
return
if self.constants.host_is_hackintosh is True:
print("- Skipping due to hackintosh")
else:
if self.constants.booted_oc_disk:
root_disk = self.constants.booted_oc_disk.strip("disk")
root_disk = "disk" + root_disk.split("s")[0]
return
if not self.constants.booted_oc_disk:
print("- Failed to find disk OpenCore launched from")
return
print(f" - Boot Drive: {self.constants.booted_oc_disk} ({root_disk})")
macOS_disk = utilities.get_disk_path()
print(f" - macOS Drive: {macOS_disk}")
physical_stores = utilities.find_apfs_physical_volume(macOS_disk)
print(f" - APFS Physical Stores: {physical_stores}")
root_disk = self.constants.booted_oc_disk.strip("disk")
root_disk = "disk" + root_disk.split("s")[0]
disk_match = False
for disk in physical_stores:
if root_disk in disk:
print(f"- Boot drive matches macOS drive ({disk})")
disk_match = True
break
print(f" - Boot Drive: {self.constants.booted_oc_disk} ({root_disk})")
macOS_disk = utilities.get_disk_path()
print(f" - macOS Drive: {macOS_disk}")
physical_stores = utilities.find_apfs_physical_volume(macOS_disk)
print(f" - APFS Physical Stores: {physical_stores}")
if disk_match is False:
# Check if OpenCore is on a USB drive
print("- Boot Drive does not match macOS drive, checking if OpenCore is on a USB drive")
disk_match = False
for disk in physical_stores:
if root_disk in disk:
print(f"- Boot drive matches macOS drive ({disk})")
disk_match = True
break
disk_info = plistlib.loads(subprocess.run(["diskutil", "info", "-plist", root_disk], stdout=subprocess.PIPE).stdout)
try:
if disk_info["Ejectable"] is True:
print("- Boot Disk is ejectable, prompting user to install to internal")
if disk_match is True:
return
args = [
"osascript",
"-e",
f"""display dialog "OpenCore Legacy Patcher has detected that you are booting OpenCore from an USB or External drive.\n\nIf you would like to boot your Mac normally without a USB drive plugged in, you can install OpenCore to the internal hard drive.\n\nWould you like to launch OpenCore Legacy Patcher and install to disk?" """
f'with icon POSIX file "{self.constants.app_icon_path}"',
]
output = subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if output.returncode == 0:
print("- Launching GUI's Build/Install menu")
self.constants.start_build_install = True
gui_main.wx_python_gui(self.constants).main_menu(None)
else:
print("- Boot Disk is not removable, skipping prompt")
except KeyError:
print("- Unable to determine if boot disk is removable, skipping prompt")
# Check if OpenCore is on a USB drive
print("- Boot Drive does not match macOS drive, checking if OpenCore is on a USB drive")
else:
print("- Failed to find disk OpenCore launched from")
disk_info = plistlib.loads(subprocess.run(["diskutil", "info", "-plist", root_disk], stdout=subprocess.PIPE).stdout)
try:
if disk_info["Ejectable"] is False:
print("- Boot Disk is not removable, skipping prompt")
return
print("- Boot Disk is ejectable, prompting user to install to internal")
args = [
"osascript",
"-e",
f"""display dialog "OpenCore Legacy Patcher has detected that you are booting OpenCore from an USB or External drive.\n\nIf you would like to boot your Mac normally without a USB drive plugged in, you can install OpenCore to the internal hard drive.\n\nWould you like to launch OpenCore Legacy Patcher and install to disk?" """
f'with icon POSIX file "{self.constants.app_icon_path}"',
]
output = subprocess.run(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
if output.returncode == 0:
print("- Launching GUI's Build/Install menu")
self.constants.start_build_install = True
gui_main.wx_python_gui(self.constants).main_menu(None)
except KeyError:
print("- Unable to determine if boot disk is removable, skipping prompt")
def install_auto_patcher_launch_agent(self):
# Installs the following:
# - OpenCore-Patcher.app in /Library/Application Support/Dortania/
# - com.dortania.opencore-legacy-patcher.auto-patch.plist in /Library/LaunchAgents/
if self.constants.launcher_script is None:
# Verify our binary isn't located in '/Library/Application Support/Dortania/'
# As we'd simply be duplicating ourselves
if not self.constants.launcher_binary.startswith("/Library/Application Support/Dortania/"):
print("- Installing Auto Patcher Launch Agent")
if self.constants.launcher_script is not None:
print("- Skipping Auto Patcher Launch Agent, not supported when running from source")
return
if not Path("Library/Application Support/Dortania").exists():
print("- Creating /Library/Application Support/Dortania/")
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/Application Support/Dortania"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if self.constants.launcher_binary.startswith("/Library/Application Support/Dortania/"):
print("- Skipping Auto Patcher Launch Agent, already installed")
return
print("- Copying OpenCore Patcher to /Library/Application Support/Dortania/")
if Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
print("- Deleting existing OpenCore-Patcher")
utilities.process_status(utilities.elevated(["rm", "-R", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Verify our binary isn't located in '/Library/Application Support/Dortania/'
# As we'd simply be duplicating ourselves
print("- Installing Auto Patcher Launch Agent")
# Strip everything after OpenCore-Patcher.app
path = str(self.constants.launcher_binary).split("/Contents/MacOS/OpenCore-Patcher")[0]
print(f"- Copying {path} to /Library/Application Support/Dortania/")
utilities.process_status(utilities.elevated(["ditto", path, "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("Library/Application Support/Dortania").exists():
print("- Creating /Library/Application Support/Dortania/")
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/Application Support/Dortania"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
# Sometimes the binary the user launches may have a suffix (ie. OpenCore-Patcher 3.app)
# We'll want to rename it to OpenCore-Patcher.app
path = path.split("/")[-1]
print(f"- Renaming {path} to OpenCore-Patcher.app")
utilities.process_status(utilities.elevated(["mv", f"/Library/Application Support/Dortania/{path}", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
print("- Copying OpenCore Patcher to /Library/Application Support/Dortania/")
if Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
print("- Deleting existing OpenCore-Patcher")
utilities.process_status(utilities.elevated(["rm", "-R", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
subprocess.run(["xattr", "-cr", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Strip everything after OpenCore-Patcher.app
path = str(self.constants.launcher_binary).split("/Contents/MacOS/OpenCore-Patcher")[0]
print(f"- Copying {path} to /Library/Application Support/Dortania/")
utilities.process_status(utilities.elevated(["ditto", path, "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Copy over our launch agent
print("- Copying auto-patch.plist Launch Agent to /Library/LaunchAgents/")
if Path("/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist").exists():
print("- Deleting existing auto-patch.plist")
utilities.process_status(utilities.elevated(["rm", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("/Library/LaunchAgents/").exists():
print("- Creating /Library/LaunchAgents/")
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/LaunchAgents/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["cp", self.constants.auto_patch_launch_agent_path, "/Library/LaunchAgents/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("/Library/Application Support/Dortania/OpenCore-Patcher.app").exists():
# Sometimes the binary the user launches may have a suffix (ie. OpenCore-Patcher 3.app)
# We'll want to rename it to OpenCore-Patcher.app
path = path.split("/")[-1]
print(f"- Renaming {path} to OpenCore-Patcher.app")
utilities.process_status(utilities.elevated(["mv", f"/Library/Application Support/Dortania/{path}", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Set the permissions on the com.dortania.opencore-legacy-patcher.auto-patch.plist
print("- Setting permissions on auto-patch.plist")
utilities.process_status(utilities.elevated(["chmod", "644", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["chown", "root:wheel", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
subprocess.run(["xattr", "-cr", "/Library/Application Support/Dortania/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Making app alias
# Simply an easy way for users to notice the app
# If there's already an alias or exiting app, skip
if not Path("/Applications/OpenCore-Patcher.app").exists():
print("- Making app alias")
utilities.process_status(utilities.elevated(["ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
else:
print("- Skipping Auto Patcher Launch Agent, not supported when running from source")
# Copy over our launch agent
print("- Copying auto-patch.plist Launch Agent to /Library/LaunchAgents/")
if Path("/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist").exists():
print("- Deleting existing auto-patch.plist")
utilities.process_status(utilities.elevated(["rm", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("/Library/LaunchAgents/").exists():
print("- Creating /Library/LaunchAgents/")
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/LaunchAgents/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["cp", self.constants.auto_patch_launch_agent_path, "/Library/LaunchAgents/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Set the permissions on the com.dortania.opencore-legacy-patcher.auto-patch.plist
print("- Setting permissions on auto-patch.plist")
utilities.process_status(utilities.elevated(["chmod", "644", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["chown", "root:wheel", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Making app alias
# Simply an easy way for users to notice the app
# If there's already an alias or exiting app, skip
if not Path("/Applications/OpenCore-Patcher.app").exists():
print("- Making app alias")
utilities.process_status(utilities.elevated(["ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))

View File

@@ -5,9 +5,11 @@
from resources import constants, device_probe, utilities, amfi_detect
from resources.sys_patch import sys_patch_helpers
from data import model_array, os_data, sip_data, sys_patch_dict
from data import model_array, os_data, sip_data, sys_patch_dict, smbios_data, cpu_data
import py_sip_xnu
from pathlib import Path
import plistlib
class detect_root_patch:
def __init__(self, model, versions):
@@ -29,6 +31,7 @@ class detect_root_patch:
self.skylake_gpu = False
self.legacy_gcn = False
self.legacy_polaris = False
self.legacy_vega = False
# Misc Patch Detection
self.brightness_legacy = False
@@ -36,6 +39,7 @@ class detect_root_patch:
self.legacy_wifi = False
self.legacy_gmux = False
self.legacy_keyboard_backlight = False
self.legacy_uhci_ohci = False
# Patch Requirements
self.amfi_must_disable = False
@@ -51,6 +55,7 @@ class detect_root_patch:
self.fv_enabled = False
self.dosdude_patched = False
self.missing_kdk = False
self.has_network = False
self.missing_whatever_green = False
self.missing_nv_web_nvram = False
@@ -144,6 +149,15 @@ class detect_root_patch:
self.supports_metal = True
self.requires_root_kc = True
self.amfi_must_disable = True
elif gpu.arch == device_probe.AMD.Archs.Vega:
if self.constants.detected_os > os_data.os_data.monterey:
if "AVX2" in self.constants.computer.cpu.leafs:
continue
self.legacy_vega = True
self.supports_metal = True
self.requires_root_kc = True
self.amfi_must_disable = True
elif gpu.arch == device_probe.Intel.Archs.Iron_Lake:
if self.constants.detected_os > non_metal_os:
self.iron_gpu = True
@@ -192,12 +206,13 @@ class detect_root_patch:
self.sandy_gpu = False
self.legacy_keyboard_backlight = False
if self.legacy_polaris is True and self.legacy_gcn is True:
if self.legacy_gcn is True:
# We can only support one or the other due to the nature of relying
# on portions of the native AMD stack for Polaris
# on portions of the native AMD stack for Polaris and Vega
# Thus we'll prioritize legacy GCN due to being the internal card
# ex. MacPro6,1 and MacBookPro11,5 with eGPUs
self.legacy_polaris = False
self.legacy_vega = False
if self.constants.detected_os <= os_data.os_data.monterey:
# Always assume Root KC requirement on Monterey and older
@@ -206,6 +221,55 @@ class detect_root_patch:
if self.requires_root_kc is True:
self.missing_kdk = not self.check_kdk()
self.check_networking_support()
def check_networking_support(self):
# On macOS Ventura, networking support is required to download KDKs.
# However for machines such as BCM94322, BCM94328 and Atheros chipsets,
# users may only have wifi as their only supported network interface.
# Thus we'll allow for KDK-less installs for these machines on first run.
# On subsequent runs, we'll require networking to be enabled.
if self.constants.detected_os < os_data.os_data.ventura:
return
if self.legacy_wifi is False:
return
if self.requires_root_kc is False:
return
if self.missing_kdk is False:
return
if self.has_network is True:
return
# Verify whether OCLP already installed network patches to the root volume
# If so, require networking to be enabled (user just needs to connect to wifi)
oclp_patch_path = "/System/Library/CoreServices/OpenCore-Legacy-Patcher.plist"
if Path(oclp_patch_path).exists():
oclp_plist = plistlib.load(open(oclp_patch_path, "rb"))
if "Legacy Wireless" in oclp_plist:
return
# Due to the reliance of KDKs for most older patches, we'll allow KDK-less
# installs for Legacy Wifi patches and remove others
self.missing_kdk = False
self.requires_root_kc = False
# Reset patches needing KDK
self.nvidia_tesla = False
self.nvidia_web = False
self.amd_ts1 = False
self.amd_ts2 = False
self.iron_gpu = False
self.sandy_gpu = False
self.legacy_gcn = False
self.legacy_polaris = False
self.legacy_vega = False
self.brightness_legacy = False
self.legacy_audio = False
self.legacy_gmux = False
self.legacy_keyboard_backlight = False
def check_dgpu_status(self):
dgpu = self.constants.computer.dgpu
@@ -302,8 +366,47 @@ class detect_root_patch:
sip_value = f"For Hackintoshes, please set csr-active-config to '03060000' ({sip_hex})\nFor non-OpenCore Macs, please run 'csrutil disable' in RecoveryOS"
return (sip, sip_value, sip_hex)
def check_uhci_ohci(self):
if self.constants.detected_os < os_data.os_data.ventura:
return False
for controller in self.constants.computer.usb_controllers:
if (isinstance(controller, device_probe.XHCIController)):
# Currently USB 1.1 patches are incompatible with USB 3.0 controllers
# TODO: Downgrade remaining USB stack to ensure full support
return False
# If we're on a hackintosh, check for UHCI/OHCI controllers
if self.constants.host_is_hackintosh is True:
for controller in self.constants.computer.usb_controllers:
if (
isinstance(controller, device_probe.UHCIController) or
isinstance(controller, device_probe.OHCIController)
):
return True
return False
if self.model not in smbios_data.smbios_dictionary:
return False
# If we're on a Mac, check for Penryn or older
# This is due to Apple implementing an internal USB hub on post-Penryn (excluding MacPro4,1 and MacPro5,1)
# Ref: https://techcommunity.microsoft.com/t5/microsoft-usb-blog/reasons-to-avoid-companion-controllers/ba-p/270710
if (
smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \
self.model in ["MacPro4,1", "MacPro5,1"]
):
return True
return False
def detect_patch_set(self):
self.detect_gpus()
self.has_network = utilities.verify_network_connection()
if self.check_uhci_ohci() is True:
self.legacy_uhci_ohci = True
self.requires_root_kc = True
if self.model in model_array.LegacyBrightness:
if self.constants.detected_os > os_data.os_data.catalina:
self.brightness_legacy = True
@@ -318,8 +421,11 @@ class detect_root_patch:
isinstance(self.constants.computer.wifi, device_probe.Broadcom)
and self.constants.computer.wifi.chipset in [device_probe.Broadcom.Chipsets.AirPortBrcm4331, device_probe.Broadcom.Chipsets.AirPortBrcm43224]
) or (isinstance(self.constants.computer.wifi, device_probe.Atheros) and self.constants.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40):
if os_data.os_data.ventura > self.constants.detected_os > os_data.os_data.big_sur:
if self.constants.detected_os > os_data.os_data.big_sur:
self.legacy_wifi = True
if self.constants.detected_os >= os_data.os_data.ventura:
# Due to extracted frameworks for IO80211.framework and co, check library validation
self.amfi_must_disable = True
# if self.model in ["MacBookPro5,1", "MacBookPro5,2", "MacBookPro5,3", "MacBookPro8,2", "MacBookPro8,3"]:
if self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
@@ -335,6 +441,8 @@ class detect_root_patch:
else:
self.legacy_gmux = True
self.detect_gpus()
self.root_patch_dict = {
"Graphics: Nvidia Tesla": self.nvidia_tesla,
"Graphics: Nvidia Kepler": self.kepler_gpu,
@@ -343,6 +451,7 @@ class detect_root_patch:
"Graphics: AMD TeraScale 2": self.amd_ts2,
"Graphics: AMD Legacy GCN": self.legacy_gcn,
"Graphics: AMD Legacy Polaris": self.legacy_polaris,
"Graphics: AMD Legacy Vega": self.legacy_vega,
"Graphics: Intel Ironlake": self.iron_gpu,
"Graphics: Intel Sandy Bridge": self.sandy_gpu,
"Graphics: Intel Ivy Bridge": self.ivy_gpu,
@@ -354,6 +463,7 @@ class detect_root_patch:
"Networking: Legacy Wireless": self.legacy_wifi,
"Miscellaneous: Legacy GMUX": self.legacy_gmux,
"Miscellaneous: Legacy Keyboard Backlight": self.legacy_keyboard_backlight,
"Miscellaneous: Legacy USB 1.1": self.legacy_uhci_ohci,
"Settings: Requires AMFI exemption": self.amfi_must_disable,
"Settings: Supports Auxiliary Cache": not self.requires_root_kc,
"Settings: Kernel Debug Kit missing": self.missing_kdk if self.constants.detected_os >= os_data.os_data.ventura.value else False,
@@ -368,6 +478,7 @@ class detect_root_patch:
"Validation: Force OpenGL property missing": self.missing_nv_web_opengl if self.nvidia_web is True else False,
"Validation: Force compat property missing": self.missing_nv_compat if self.nvidia_web is True else False,
"Validation: nvda_drv(_vrl) variable missing": self.missing_nv_web_nvram if self.nvidia_web is True else False,
"Validation: Network Connection Required": (not self.has_network) if (self.requires_root_kc and self.missing_kdk and self.constants.detected_os >= os_data.os_data.ventura.value) else False,
}
return self.root_patch_dict
@@ -440,6 +551,10 @@ class detect_root_patch:
print("\nCannot patch! WhateverGreen.kext missing")
print("Please ensure WhateverGreen.kext is installed")
if (not self.has_network) if (self.requires_root_kc and self.missing_kdk and self.constants.detected_os >= os_data.os_data.ventura.value) else False:
print("\nCannot patch! Network Connection Required")
print("Please ensure you have an active internet connection")
if any(
[
# General patch checks
@@ -453,6 +568,9 @@ class detect_root_patch:
self.missing_nv_web_opengl if self.nvidia_web is True else False,
self.missing_nv_compat if self.nvidia_web is True else False,
self.missing_whatever_green if self.nvidia_web is True else False,
# KDK specific
(not self.has_network) if (self.requires_root_kc and self.missing_kdk and self.constants.detected_os >= os_data.os_data.ventura.value) else False
]
):
return False
@@ -543,6 +661,13 @@ class detect_root_patch:
required_patches.update({"AMD Legacy Polaris": all_hardware_patchset["Graphics"]["AMD Legacy Polaris"]})
if "AVX2" not in self.constants.computer.cpu.leafs:
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if hardware_details["Graphics: AMD Legacy Vega"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"AMD Legacy Vega": all_hardware_patchset["Graphics"]["AMD Legacy Vega"]})
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if hardware_details["Graphics: AMD Legacy GCN"] is True:
required_patches.update({"AMD Legacy Vega Extended": all_hardware_patchset["Graphics"]["AMD Legacy Vega Extended"]})
if hardware_details["Brightness: Legacy Backlight Control"] is True:
required_patches.update({"Legacy Backlight Control": all_hardware_patchset["Brightness"]["Legacy Backlight Control"]})
if hardware_details["Audio: Legacy Realtek"] is True:
@@ -552,10 +677,13 @@ class detect_root_patch:
required_patches.update({"Legacy Non-GOP": all_hardware_patchset["Audio"]["Legacy Non-GOP"]})
if hardware_details["Networking: Legacy Wireless"] is True:
required_patches.update({"Legacy Wireless": all_hardware_patchset["Networking"]["Legacy Wireless"]})
required_patches.update({"Legacy Wireless Extended": all_hardware_patchset["Networking"]["Legacy Wireless Extended"]})
if hardware_details["Miscellaneous: Legacy GMUX"] is True:
required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]})
if hardware_details["Miscellaneous: Legacy Keyboard Backlight"] is True:
required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]})
if hardware_details["Miscellaneous: Legacy USB 1.1"] is True:
required_patches.update({"Legacy USB 1.1": all_hardware_patchset["Miscellaneous"]["Legacy USB 1.1"]})
if required_patches:
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")

View File

@@ -83,9 +83,23 @@ class sys_patch_helpers:
print(f"- Installing downloaded KDK (this may take a while)")
with tempfile.TemporaryDirectory() as mount_point:
utilities.process_status(subprocess.run(["hdiutil", "attach", self.constants.kdk_download_path, "-mountpoint", mount_point, "-nobrowse"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Install the KDK
utilities.process_status(utilities.elevated(["installer", "-pkg", f"{mount_point}/KernelDebugKit.pkg", "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
subprocess.run(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # Do not really care if this fails
# Due to a permissions bug in macOS, sometimes the OS will fail on a Read-only file system error
# We don't actually need to write inside the KDK DMG, however macOS will do whatever it wants
# Thus move the KDK to another location, and run the installer from there
kdk_dst_path = Path(f"{self.constants.payload_path}/KernelDebugKit.pkg")
if kdk_dst_path.exists():
utilities.process_status(utilities.elevated(["rm", kdk_dst_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(subprocess.run(["cp", f"{mount_point}/KernelDebugKit.pkg", self.constants.payload_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
result = utilities.elevated(["installer", "-pkg", kdk_dst_path, "-target", "/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0:
print("- Failed to install KDK:")
print(result.stdout.decode('utf-8'))
if result.stderr:
print(result.stderr.decode('utf-8'))
utilities.elevated(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
raise Exception("Failed to install KDK")
utilities.process_status(utilities.elevated(["rm", kdk_dst_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.elevated(["hdiutil", "detach", mount_point], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print("- Successfully installed KDK")
@@ -145,6 +159,9 @@ class sys_patch_helpers:
utilities.elevated(["bash", "-c", "rm -rf /private/var/folders/*/*/*/WindowServer/com.apple.WindowServer"])
# Disable writing to WindowServer folder
utilities.elevated(["bash", "-c", "chflags uchg /private/var/folders/*/*/*/WindowServer"])
# Reference:
# To reverse write lock:
# 'chflags nouchg /private/var/folders/*/*/*/WindowServer'
def remove_news_widgets(self):
@@ -183,4 +200,25 @@ class sys_patch_helpers:
if did_find:
with open(file_path, "wb") as f:
plistlib.dump(data, f, sort_keys=False)
subprocess.run(["killall", "NotificationCenter"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
subprocess.run(["killall", "NotificationCenter"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
def install_rsr_repair_binary(self):
# With macOS 13.2, Apple implemented the Rapid Security Response System
# However Apple added a half baked snapshot reversion system if seal was broken,
# which forgets to handle Preboot BootKC syncing
# Thus this application will try to re-sync the BootKC with SysKC in the event of a panic
# Reference: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1019
# This is a (hopefully) temporary work-around, however likely to stay.
# RSRRepair has the added bonus of fixing desynced KCs from 'bless', so useful in Big Sur+
# https://github.com/flagersgit/RSRRepair
if self.constants.detected_os < os_data.os_data.big_sur:
return
print("- Installing Kernel Collection syncing utility")
result = utilities.elevated([self.constants.rsrrepair_userspace_path, "--install"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0:
print(f" - Failed to install RSRRepair: {result.stdout.decode()}")

View File

@@ -40,7 +40,7 @@ def string_to_hex(input_string):
def process_status(process_result):
if process_result.returncode != 0:
print(f"Process failed with exit code {process_result.returncode}")
print(f"Please file an issue on our Github")
print(f"Please report the issue on the Discord server")
raise Exception(f"Process result: \n{process_result.stdout.decode()}")
@@ -360,7 +360,9 @@ def get_firmware_vendor(*, decode: bool = False):
value = value.strip("\0")
return value
def verify_network_connection(url):
def verify_network_connection(url=None):
if url is None:
url = "https://www.google.com"
try:
response = SESSION.head(url, timeout=5, allow_redirects=True)
return True