mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-15 13:18:56 +10:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
113156c94c | ||
|
|
e1cb78fa0b | ||
|
|
6109d8c92f | ||
|
|
b473d189dd | ||
|
|
3b89fc2950 | ||
|
|
1b4fd73673 | ||
|
|
ca2fd695b3 | ||
|
|
9669196a07 | ||
|
|
88696c7047 | ||
|
|
8706959f65 | ||
|
|
a63d1953b4 | ||
|
|
6d129505ea | ||
|
|
6bc36c737c | ||
|
|
5f07e9ffd9 | ||
|
|
0ff6a18e83 | ||
|
|
a153b500b9 | ||
|
|
db617db1fd | ||
|
|
69e50aeb6d | ||
|
|
eaa686e045 | ||
|
|
68d25d30b4 | ||
|
|
16a666e836 | ||
|
|
5e91ea181b | ||
|
|
f4e487c648 | ||
|
|
d1fbeba50f | ||
|
|
8c138658e2 | ||
|
|
729feba2ba | ||
|
|
978d2fda26 | ||
|
|
5e0354531a | ||
|
|
19ed65968d | ||
|
|
5aee1aa60f | ||
|
|
ab22a225c4 |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
||||
# OpenCore Legacy Patcher changelog
|
||||
|
||||
## 0.3.1
|
||||
- Allow for setting custom SIP values via TUI
|
||||
- Drop `CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE` requirement for root patching
|
||||
- Lowers default SIP Disabled value to 0xA03
|
||||
- Update Legacy GMUX patchset to latest Sierra Secuirty Update
|
||||
- [Source](https://github.com/HackintoshHD/mbp5x-instant-gpu-switching)
|
||||
- Fix non-Metal acceleration crashing on 12.0.1
|
||||
- Yes Apple adding a notch broke our accel patches
|
||||
- Fix non-Metal Control Center crashing on 12.0 Beta 10+
|
||||
- Increment Binaries:
|
||||
- PatcherSupportPkg 0.1.12
|
||||
|
||||
## 0.3.0
|
||||
- Fix Nvidia Tesla Acceleration in Monterey Beta 7+
|
||||
- Add missing NVDAStartup
|
||||
|
||||
@@ -19,4 +19,5 @@ class cpu_data(enum.IntEnum):
|
||||
|
||||
apple_dtk = 112 # A12
|
||||
apple_m1 = 114 # A14
|
||||
apple_m2 = 115 # A15
|
||||
apple_m1_pro = 115
|
||||
apple_m1_max = 116
|
||||
|
||||
@@ -22,14 +22,17 @@ class system_integrity_protection:
|
||||
"CSR_ALLOW_UNTRUSTED_KEXTS", # 0x1
|
||||
"CSR_ALLOW_UNRESTRICTED_FS", # 0x2
|
||||
"CSR_ALLOW_UNAPPROVED_KEXTS", # 0x200
|
||||
"CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE", # 0x400
|
||||
]
|
||||
|
||||
root_patch_sip_big_sur = [
|
||||
# Variables required to root patch in Big Sur and Monterey
|
||||
"CSR_ALLOW_UNTRUSTED_KEXTS", # 0x1
|
||||
"CSR_ALLOW_UNRESTRICTED_FS", # 0x2
|
||||
"CSR_ALLOW_UNRESTRICTED_FS", # 0x2 - Required to mount and edit root volume, as well as load modded platform binaries
|
||||
"CSR_ALLOW_UNAPPROVED_KEXTS", # 0x200
|
||||
"CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE", # 0x400
|
||||
"CSR_ALLOW_UNAUTHENTICATED_ROOT", # 0x800
|
||||
"CSR_ALLOW_UNAUTHENTICATED_ROOT", # 0x800 - Required to avoid KC mismatch kernel panic
|
||||
]
|
||||
|
||||
# CSR_ALLOW_EXECUTABLE_POLICY_OVERRIDE (introduced with Mojave):
|
||||
# This bit is quite strange and was originally assumed to be required for modded platform binaries
|
||||
# However after extensive testing, this doesn't seem true. In addition, this bit is never flipped via
|
||||
# 'csrutil disable'. Usage within the kernel is not present.
|
||||
@@ -1171,6 +1171,55 @@ smbios_dictionary = {
|
||||
"Max OS Supported": os_data.os_data.max_os,
|
||||
"Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe,
|
||||
"Bluetooth Model": bluetooth_data.bluetooth_data.PCIe,
|
||||
"Screen Size": 13,
|
||||
"Ethernet Chipset": None,
|
||||
"Stock GPUs": [],
|
||||
},
|
||||
"MacBookPro18,1": {
|
||||
"Board ID": None,
|
||||
"FirmwareFeatures": None,
|
||||
"SecureBootModel": "j316s",
|
||||
"CPU Generation": cpu_data.cpu_data.apple_m1_pro.value,
|
||||
"Max OS Supported": os_data.os_data.max_os,
|
||||
"Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe,
|
||||
"Bluetooth Model": bluetooth_data.bluetooth_data.PCIe,
|
||||
"Screen Size": 16,
|
||||
"Ethernet Chipset": None,
|
||||
"Stock GPUs": [],
|
||||
},
|
||||
"MacBookPro18,2": {
|
||||
"Board ID": None,
|
||||
"FirmwareFeatures": None,
|
||||
"SecureBootModel": "j316c",
|
||||
"CPU Generation": cpu_data.cpu_data.apple_m1_max.value,
|
||||
"Max OS Supported": os_data.os_data.max_os,
|
||||
"Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe,
|
||||
"Bluetooth Model": bluetooth_data.bluetooth_data.PCIe,
|
||||
"Screen Size": 16,
|
||||
"Ethernet Chipset": None,
|
||||
"Stock GPUs": [],
|
||||
},
|
||||
"MacBookPro18,3": {
|
||||
"Board ID": None,
|
||||
"FirmwareFeatures": None,
|
||||
"SecureBootModel": "j314s",
|
||||
"CPU Generation": cpu_data.cpu_data.apple_m1_pro.value,
|
||||
"Max OS Supported": os_data.os_data.max_os,
|
||||
"Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe,
|
||||
"Bluetooth Model": bluetooth_data.bluetooth_data.PCIe,
|
||||
"Screen Size": 14,
|
||||
"Ethernet Chipset": None,
|
||||
"Stock GPUs": [],
|
||||
},
|
||||
"MacBookPro18,4": {
|
||||
"Board ID": None,
|
||||
"FirmwareFeatures": None,
|
||||
"SecureBootModel": "j314c",
|
||||
"CPU Generation": cpu_data.cpu_data.apple_m1_max.value,
|
||||
"Max OS Supported": os_data.os_data.max_os,
|
||||
"Wireless Model": device_probe.Broadcom.Chipsets.AppleBCMWLANBusInterfacePCIe,
|
||||
"Bluetooth Model": bluetooth_data.bluetooth_data.PCIe,
|
||||
"Screen Size": 14,
|
||||
"Ethernet Chipset": None,
|
||||
"Stock GPUs": [],
|
||||
},
|
||||
@@ -2128,6 +2177,18 @@ smbios_dictionary = {
|
||||
device_probe.NVIDIA.Archs.Tesla
|
||||
],
|
||||
},
|
||||
"ADP2,1": {
|
||||
"Board ID": None,
|
||||
"FirmwareFeatures": None,
|
||||
"SecureBootModel": None,
|
||||
"CPU Generation": cpu_data.cpu_data.pentium_4.value,
|
||||
"Max OS Supported": os_data.os_data.leopard,
|
||||
"Wireless Model": None,
|
||||
"Bluetooth Model": bluetooth_data.bluetooth_data.NonApplicable,
|
||||
"Stock GPUs": [
|
||||
device_probe.Intel.Archs.GMA_950
|
||||
],
|
||||
},
|
||||
"ADP3,2": {
|
||||
"Board ID": None,
|
||||
"FirmwareFeatures": None,
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
* [Wake from sleep heavily distorted on AMD/ATI in macOS 11.3 and newer](#wake-from-sleep-heavily-distorted-on-amd-ati-in-macos-11-3-and-newer)
|
||||
* [Unable to switch GPUs on 2011 15" and 17" MacBook Pros](#unable-to-switch-gpus-on-2011-15-and-17-macbook-pros)
|
||||
* [Erratic Colours on ATI TeraScale 2 GPUs (HD5000/HD6000)](#erratic-colours-on-ati-terascale-2-gpus-hd5000-hd6000)
|
||||
* [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)
|
||||
|
||||
The below page is for users experiencing issues with their overall usage of macOS Big Sur and the Legacy Graphics Acceleration patches. Note that the following GPUs currently do not have acceleration support in Big Sur:
|
||||
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:
|
||||
|
||||
* Intel 3rd and 4th Gen - GMA series
|
||||
|
||||
@@ -33,22 +35,6 @@ For those unfamiliar with what is considered a non-Metal GPU, see below chart:
|
||||
|
||||
:::
|
||||
|
||||
Additionally we currently do not have macOS Monterey acceleration patches for non-Metal Macs. We recommend users either upgrade their Macs with a Metal GPU or remain on Big Sur until further development
|
||||
|
||||
::: details Why there's no non-Metal patches for Monterey
|
||||
|
||||
With macOS Monterey, please understand our current legacy acceleration patch sets are no longer functional. As of right now, only basic framebuffer and brightness control may be achieved, however proper animations and hardware acceleration is not available.
|
||||
|
||||
This is due to numerous changes with Skylight and other macOS frameworks relying more and more on Metal functions and thus making it even more difficult to re-add legacy OpenGL support.
|
||||
|
||||
> When can we expect acceleration support
|
||||
|
||||
For the time being, please understand we cannot predict when there will be patch sets ready. Note that it took over 300 days from Big Sur's unveiling to achieve public acceleration for non-Metal GPUs. And with TeraScale 2 acceleration, this took almost 3 years to achieve public acceleration.
|
||||
|
||||
So please be patient as developers are hard at work, however please expect no acceleration support in Monterey until next year at the minimum if not even later.
|
||||
|
||||
:::
|
||||
|
||||
## Downloading older non-Metal Apps
|
||||
|
||||
Many Apple apps now have direct reliance on Metal for proper functioning, however legacy builds of these apps still do work in Big Sur. See below for archive of many apps such as Pages, iMovie, GarageBand.
|
||||
@@ -106,6 +92,8 @@ Due to the Metal Backend, the enhanced color output of these apps seems to heavi
|
||||
|
||||
To work around this, simply press Tab to hover over and press spacebar to simulate a click.
|
||||
|
||||
Note: This work-around doesn't seem to work in macOS 11.3 and newer
|
||||
|
||||
## Wake from sleep heavily distorted on AMD/ATI in macOS 11.3 and newer
|
||||
|
||||
Unfortunately a very well known issue the community is investigating, current known solution is to simply downgrade to 11.2.3 or older until a proper fix can be found. Additionally logging out and logging in can resolve the issue without requiring a reboot
|
||||
@@ -135,4 +123,33 @@ Due to an odd bug with ATI's TeraScale 2 GPUs, many users will experience errati
|
||||
Applications that can set color depth are:
|
||||
|
||||
* [SwitchResX](https://www.madrau.com)
|
||||
* [ResXtreme](https://macdownload.informer.com/resxtreme/)
|
||||
* [ResXtreme](https://macdownload.informer.com/resxtreme/)
|
||||
|
||||
## Unable to allow Safari Extensions
|
||||
|
||||
Due to an bug on the legacy acceleration patches, users won't be able to enable Safari Extensions
|
||||
|
||||
This tool can be used to work-around this issue:
|
||||
|
||||
* [Non-Metal Safari Extensions](https://github.com/moosethegoose2213/Non-Metal-Safari-Extensions/)
|
||||
|
||||
## Cannot Login on 2011 15" and 17" MacBook Pros
|
||||
|
||||
By default OpenCore Legacy Patcher will assume MacBookPro8,2/3 have a faulty dGPU and disable acceleration. This is the safest option for most users as enabling dGPU acceleration on faulty Macs will result in failed booting.
|
||||
|
||||
However if your machine does not have the dGPU disabled via NVRAM, you'll expereince a login loop. To work around this is quite simple:
|
||||
|
||||
1. Boot macOS in Single User Mode
|
||||
* Press Cmd+S in OpenCore's menu when you turn the Mac on
|
||||
2. When command line prompt appears, enter the dGPU disabler argument (at the bottom)
|
||||
3. Reboot and patched macOS should work normally
|
||||
4. If you still want to use the dGPU, run OCLP's TUI app and enable TS2 Acceleration. Then root patch your Mac again
|
||||
* `Patcher Settings -> Misc Settings -> TeraScale 2 Accel`
|
||||
5. Either Reset NVRAM or set `gpu-power-prefs` to zeros to re-enable the dGPU
|
||||
|
||||
```sh
|
||||
# Forces GMUX to use iGPU only (ie. disable dGPU)
|
||||
nvram FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs=%01%00%00%00
|
||||
# To reset, simply write zeros or NVRAM Reset your Mac
|
||||
nvram FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs=%00%00%00%00
|
||||
```
|
||||
@@ -11,7 +11,7 @@ With OpenCore Legacy Patcher we recommend users go through the below table to un
|
||||
| System Integrity Protection | <span style="color:#30BCD5">Fully enabled on Metal GPUs</span> | <span style="color:red">Disabled for early 2013 and older during the patching process and first boot afterwards, otherwise enabled</span> |
|
||||
| APFS Snapshots | <span style="color:#30BCD5">Fully enabled</span> | <span style="color:red">Disabled</span> |
|
||||
| User facing | <span style="color:red">TUI interface</span> | <span style="color:#30BCD5">SwiftUI interface, more user friendly</span> |
|
||||
| Supported OSes | <span style="color:#30BCD5">10.7-11</span> | <span style="color:red">10.15-11</span> |
|
||||
| Supported OSes | <span style="color:#30BCD5">10.7-12</span> | <span style="color:red">10.15-11</span> |
|
||||
| Firmware Patching | <span style="color:#30BCD5">None required</span> | <span style="color:red">Required for models without native APFS support</span> |
|
||||
| BootCamp Switching | <span style="color:red">Requires EFI Conversion for Start Disk support, otherwise still supported</span> | <span style="color:#30BCD5">Native</span> |
|
||||
| Non-Metal GPU Acceleration | <span style="color:#30BCD5">In active development</span>, see Acceleration Progress Tracker: [Link](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/108) | <span style="color:red">Currently not researching</span> |
|
||||
|
||||
@@ -20,10 +20,10 @@ Regarding OS support, see below:
|
||||
|
||||
| Support Entry | Supported OSes | Description | Comment |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| HostOS | macOS 10.9 - macOS 11 | Refers to OSes where running OpenCore-Patcher.app are supported | Supports 10.7+ if [Python 3.9 or higher](https://www.python.org/downloads/) is manually installed, simply run the `OpenCore-Patcher.command` located in the repo |
|
||||
| TargetOS | macOS 11 | Refers to OSes that can be patched to run with OpenCore | May support 10.4 and newer (in a potentially broken state). No support provided. |
|
||||
| HostOS | macOS 10.9 - macOS 12 | Refers to OSes where running OpenCore-Patcher.app are supported | Supports 10.7+ if [Python 3.9 or higher](https://www.python.org/downloads/) is manually installed, simply run the `OpenCore-Patcher.command` located in the repo |
|
||||
| TargetOS | macOS 11 - macOS 12 | Refers to OSes that can be patched to run with OpenCore | May support 10.4 and newer (in a potentially broken state). No support provided. |
|
||||
|
||||
* macOS Monterey support is currently in beta and is not recommended for everyday users. The below page is meant to represent macOS Big Sur support and may not correctly reflect Monterey's support on each model
|
||||
* macOS Monterey support is currently in beta and is not recommended for everyday users.
|
||||
* Recommend looking at the [macOS Monterey Support page](./MONTEREY-DROP.md) for a better idea of Monterey's current status
|
||||
|
||||
### MacBook
|
||||
|
||||
@@ -58,7 +58,7 @@ To aid users in troubleshooting, we've compiled a list of users who've reported
|
||||
| ^^ | ^^ | vinaypundith | - Patcher version 0.0.7 |
|
||||
| MacBookPro10,1 | ^^ | traviswparker | - Stock model <br/>- Patcher version 0.0.14 |
|
||||
| ^^ | ^^ | il-rollino | - Upgraded BCM94360CSAX <br/>- Patcher version 0.0.21 |
|
||||
| MacBookPro10,2 | No reports | N/A | N/A |
|
||||
| MacBookPro10,2 | ^^ | akidone | - Upgraded BCM94360CSAX <br/>- Patcher version 0.3.0 |
|
||||
|
||||
### Mac mini
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ Here are some common errors users may experience while using this patcher:
|
||||
* [How to Boot Big Sur Recovery](#how-to-boot-big-sur-recovery)
|
||||
* [Stuck on "Your Mac needs a firmware update"](#stuck-on-your-mac-needs-a-firmware-update)
|
||||
* [No Brightness Control](#no-brightness-control)
|
||||
* [Cannot connect Wi-Fi on Monterey with legacy cards](#cannot-connect-Wi-Fi-on-Monterey-with-legacy-cards)
|
||||
|
||||
## Stuck on `This version of Mac OS X is not supported on this platform`
|
||||
|
||||
@@ -68,3 +69,9 @@ With OCLP v0.0.22, we've added support for brightness control on many models. Ho
|
||||
To work-around, we recommend user try out the below app:
|
||||
|
||||
* [Brightness Slider](https://actproductions.net/free-apps/brightness-slider/)
|
||||
|
||||
## Cannot connect Wi-Fi on Monterey with legacy cards
|
||||
|
||||
With OCLP v0.2.5, we've added support for legacy Wi-Fi on Monterey. However some users may have noticed that they can't connect to wireless networks.
|
||||
|
||||
To work-around, we recommend users to manually connect using the "other" option on the Wi-Fi menu bar or manually adding the network on the "Network" preference pane.
|
||||
|
||||
@@ -359,8 +359,6 @@ class BuildOpenCore:
|
||||
Path(self.constants.amc_contents_folder).mkdir()
|
||||
shutil.copy(amc_map_path, self.constants.amc_contents_folder)
|
||||
self.get_kext_by_bundle_path("AMC-Override.kext")["Enabled"] = True
|
||||
elif self.model == "MacBookPro10,1":
|
||||
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = {"agdpmod": "vit9696"}
|
||||
|
||||
if self.model not in model_array.NoAGPMSupport:
|
||||
print("- Adding AppleGraphicsPowerManagement Override")
|
||||
@@ -449,6 +447,7 @@ class BuildOpenCore:
|
||||
self.enable_kext("IOFireWireSBP2.kext", self.constants.fw_kext, self.constants.fw_sbp2_path)
|
||||
self.enable_kext("IOFireWireSerialBusProtocolTransport.kext", self.constants.fw_kext, self.constants.fw_bus_path)
|
||||
self.get_kext_by_bundle_path("IOFireWireFamily.kext/Contents/PlugIns/AppleFWOHCI.kext")["Enabled"] = True
|
||||
|
||||
|
||||
def backlight_path_detection(self):
|
||||
if not self.constants.custom_model and self.computer.dgpu and self.computer.dgpu.pci_path:
|
||||
@@ -524,13 +523,13 @@ class BuildOpenCore:
|
||||
if self.computer and self.computer.dgpu:
|
||||
if self.computer.dgpu.arch == device_probe.AMD.Archs.Legacy_GCN_7000:
|
||||
# Add Power Gate Patches
|
||||
self.config["DeviceProperties"]["Add"][backlight_path] += {
|
||||
self.config["DeviceProperties"]["Add"][backlight_path].update({
|
||||
"rebuild-device-tree": 1,
|
||||
"CAIL,CAIL_DisableDrmdmaPowerGating": 1,
|
||||
"CAIL,CAIL_DisableGfxCGPowerGating": 1,
|
||||
"CAIL,CAIL_DisableUVDPowerGating": 1,
|
||||
"CAIL,CAIL_DisableVCEPowerGating": 1,
|
||||
}
|
||||
})
|
||||
|
||||
# Check GPU Vendor
|
||||
if self.constants.metal_build is True:
|
||||
@@ -694,9 +693,12 @@ class BuildOpenCore:
|
||||
print("- Setting Vault configuration")
|
||||
self.config["Misc"]["Security"]["Vault"] = "Secure"
|
||||
self.get_efi_binary_by_path("OpenShell.efi", "Misc", "Tools")["Enabled"] = False
|
||||
if self.constants.sip_status is False:
|
||||
if self.constants.custom_sip_value:
|
||||
print(f"- Setting SIP value to: {self.constants.custom_sip_value}")
|
||||
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = utilities.string_to_hex(self.constants.custom_sip_value.lstrip("0x"))
|
||||
elif self.constants.sip_status is False:
|
||||
print("- Disabling SIP")
|
||||
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = binascii.unhexlify("030E0000")
|
||||
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = binascii.unhexlify("030A0000")
|
||||
# if self.constants.amfi_status is False:
|
||||
# print("- Disabling AMFI")
|
||||
# self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " amfi_get_out_of_my_way=1"
|
||||
@@ -1004,8 +1006,15 @@ class BuildOpenCore:
|
||||
|
||||
def sign_files(self):
|
||||
if self.constants.vault is True:
|
||||
print("- Vaulting EFI")
|
||||
subprocess.run([str(self.constants.vault_path), f"{self.constants.oc_folder}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
if utilities.check_command_line_tools() is True:
|
||||
# sign.command checks for the existance of '/usr/bin/strings' however does not verify whether it's executable
|
||||
# sign.command will continue to run and create an unbootable OpenCore.efi due to the missing strings binary
|
||||
# macOS has dummy binaries that just reroute to the actual binaries after you install Xcode's Command Line Tools
|
||||
print("- Vaulting EFI")
|
||||
subprocess.run([str(self.constants.vault_path), f"{self.constants.oc_folder}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
else:
|
||||
print("- Missing Command Line tools, skipping Vault for saftey reasons")
|
||||
print("- Install via 'xcode-select --install' and rerun OCLP if you wish to vault this config")
|
||||
|
||||
def build_opencore(self):
|
||||
self.build_efi()
|
||||
|
||||
@@ -160,14 +160,15 @@ Note: For security reasons, OpenShell will be disabled when Vault is set.
|
||||
utilities.cls()
|
||||
utilities.header(["Set System Integrity protection"])
|
||||
print(
|
||||
"""SIP is used to ensure proper secuirty measures are set,
|
||||
f"""SIP is used to ensure proper secuirty measures are set,
|
||||
however to patch the root volume this must be disabled.
|
||||
Only disable is absolutely necessary. SIP value = 0xE03
|
||||
Only disable is absolutely necessary. SIP value = 0xA03
|
||||
|
||||
Valid options:
|
||||
|
||||
1. Enable SIP
|
||||
2. Disable SIP
|
||||
3. Set Custom SIP value {self.constants.custom_sip_value}
|
||||
Q. Return to previous menu
|
||||
|
||||
"""
|
||||
@@ -177,6 +178,8 @@ Q. Return to previous menu
|
||||
self.constants.sip_status = True
|
||||
elif change_menu == "2":
|
||||
self.constants.sip_status = False
|
||||
elif change_menu == "3":
|
||||
self.set_custom_sip_value()
|
||||
elif change_menu in {"q", "Q", "Quit", "quit"}:
|
||||
print("Returning to previous menu")
|
||||
else:
|
||||
@@ -763,6 +766,29 @@ the event there's issues.
|
||||
print("Returning to previous menu")
|
||||
else:
|
||||
self.set_surplus()
|
||||
|
||||
def set_custom_sip_value(self):
|
||||
utilities.cls()
|
||||
utilities.header(["Set Custom SIP Value"])
|
||||
print(
|
||||
"""
|
||||
By default OCLP will use the SIP value of 0x00 as the enabled and
|
||||
0xA03 for machines that require root patching. For users who wish
|
||||
to flip additional bits in SIP may use this option.
|
||||
|
||||
To disable SIP outright, set it to 0xFEF
|
||||
"""
|
||||
)
|
||||
change_menu = input("Set Custom SIP Value (0xFEF): ")
|
||||
try:
|
||||
# Verify whether input is a valid hex value
|
||||
int(change_menu, 16)
|
||||
# Convert to binary hex
|
||||
self.constants.custom_sip_value = change_menu
|
||||
except ValueError:
|
||||
print("Invalid input, returning to previous menu")
|
||||
self.set_custom_sip_value()
|
||||
|
||||
|
||||
def credits(self):
|
||||
utilities.TUIOnlyPrint(
|
||||
@@ -911,7 +937,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
|
||||
# MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_amfi,
|
||||
# ],
|
||||
[
|
||||
f"Set System Integrity Protection (SIP):\tCurrently {self.constants.sip_status}",
|
||||
f"Set System Integrity Protection (SIP):\tCurrently {self.constants.custom_sip_value or self.constants.sip_status}",
|
||||
MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).change_sip,
|
||||
],
|
||||
[
|
||||
|
||||
@@ -13,8 +13,8 @@ from resources import device_probe
|
||||
class Constants:
|
||||
def __init__(self):
|
||||
# Patcher Versioning
|
||||
self.patcher_version = "0.3.0" # OpenCore-Legacy-Patcher
|
||||
self.patcher_support_pkg_version = "0.1.7" # PatcherSupportPkg
|
||||
self.patcher_version = "0.3.1" # OpenCore-Legacy-Patcher
|
||||
self.patcher_support_pkg_version = "0.1.12" # 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/"
|
||||
|
||||
@@ -157,6 +157,7 @@ class Constants:
|
||||
self.force_latest_psp = False # Force latest PatcherSupportPkg
|
||||
self.disable_msr_power_ctl = False # Disable MSR Power Control (missing battery throttling)
|
||||
self.software_demux = False # Enable Software Demux patch set
|
||||
self.custom_sip_value = None # Set custom SIP value
|
||||
|
||||
# OS Versions
|
||||
## Based off Major Kernel Version
|
||||
|
||||
@@ -760,9 +760,12 @@ set million colour before rebooting"""
|
||||
if self.constants.detected_os > self.constants.big_sur:
|
||||
self.legacy_wifi = True
|
||||
|
||||
if self.model in ["MacBookPro5,1", "MacBookPro5,2", "MacBookPro5,3", "MacBookPro8,2", "MacBookPro8,3"]:
|
||||
# if self.model in ["MacBookPro5,1", "MacBookPro5,2", "MacBookPro5,3", "MacBookPro8,2", "MacBookPro8,3"]:
|
||||
if self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
|
||||
# Sierra uses a legacy GMUX control method needed for dGPU switching on MacBookPro5,x
|
||||
# Same method is also used for demuxed machines
|
||||
# Note that MacBookPro5,x machines are extremely unstable with this patch set, so disabled until investigated further
|
||||
# Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/files/7360909/KP-b10-030.txt
|
||||
if self.constants.detected_os > self.constants.high_sierra:
|
||||
if self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
|
||||
# Ref: https://doslabelectronics.com/Demux.html
|
||||
@@ -818,7 +821,7 @@ set million colour before rebooting"""
|
||||
sip_value = "For Hackintoshes, please set csr-active-config to '03060000' (0x603)\nFor non-OpenCore Macs, please run 'csrutil disable' in RecoveryOS"
|
||||
else:
|
||||
sip_value = (
|
||||
"For Hackintoshes, please set csr-active-config to '030E0000' (0xE03)\nFor non-OpenCore Macs, please run 'csrutil disable' and \n'csrutil authenticated-root disable' in RecoveryOS"
|
||||
"For Hackintoshes, please set csr-active-config to '030A0000' (0xA03)\nFor non-OpenCore Macs, please run 'csrutil disable' and \n'csrutil authenticated-root disable' in RecoveryOS"
|
||||
)
|
||||
self.sip_enabled, self.sbm_enabled, self.amfi_enabled, self.fv_enabled, self.dosdude_patched = utilities.patching_status(sip, self.constants.detected_os)
|
||||
if self.sip_enabled is True:
|
||||
|
||||
@@ -196,10 +196,10 @@ def patching_status(os_sip, os):
|
||||
# Catalina and older supports individually disabling Library Validation
|
||||
amfi_enabled = False
|
||||
|
||||
if (
|
||||
get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False)
|
||||
and get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False) not in constants.Constants().sbm_values
|
||||
):
|
||||
if get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False):
|
||||
if get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False) not in constants.Constants().sbm_values:
|
||||
sbm_enabled = False
|
||||
else:
|
||||
sbm_enabled = False
|
||||
|
||||
if get_nvram("csr-active-config", decode=False) and csr_decode(get_nvram("csr-active-config", decode=False), os_sip) is False:
|
||||
@@ -238,6 +238,14 @@ def cls():
|
||||
else:
|
||||
print("\u001Bc")
|
||||
|
||||
def check_command_line_tools():
|
||||
# Determine whether Command Line Tools exist
|
||||
# xcode-select -p
|
||||
xcode_select = subprocess.run("xcode-select -p".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
if xcode_select.returncode == 0:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def get_nvram(variable: str, uuid: str = None, *, decode: bool = False):
|
||||
# TODO: Properly fix for El Capitan, which does not print the XML representation even though we say to
|
||||
|
||||
Reference in New Issue
Block a user