mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 14:40:52 +10:00
Fix misc root patching issues
This commit is contained in:
@@ -128,7 +128,6 @@ EthernetNvidia = [
|
|||||||
"MacBookPro5,3",
|
"MacBookPro5,3",
|
||||||
"MacBookPro5,4",
|
"MacBookPro5,4",
|
||||||
"MacBookPro5,5",
|
"MacBookPro5,5",
|
||||||
"MacBookPro7,1",
|
|
||||||
"Macmini3,1",
|
"Macmini3,1",
|
||||||
"Macmini4,1",
|
"Macmini4,1",
|
||||||
"iMac9,1",
|
"iMac9,1",
|
||||||
@@ -144,6 +143,7 @@ EthernetMarvell = [
|
|||||||
EthernetBroadcom = [
|
EthernetBroadcom = [
|
||||||
"MacBookPro6,1",
|
"MacBookPro6,1",
|
||||||
"MacBookPro6,2",
|
"MacBookPro6,2",
|
||||||
|
"MacBookPro7,1",
|
||||||
"MacBookPro8,1",
|
"MacBookPro8,1",
|
||||||
"MacBookPro8,2",
|
"MacBookPro8,2",
|
||||||
"MacBookPro8,3",
|
"MacBookPro8,3",
|
||||||
|
|||||||
+22
-30
@@ -82,19 +82,10 @@ class PatchSysVolume:
|
|||||||
subprocess.run(f"sudo rm -R {self.mount_extensions}/IOGPUFamily.kext".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo rm -R {self.mount_extensions}/IOGPUFamily.kext".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo rm -R {self.mount_extensions}/IOSurface.kext".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo rm -R {self.mount_extensions}/IOSurface.kext".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
# Frameworks
|
# Now add our patches
|
||||||
subprocess.run(f"sudo rm -R {self.mount_frameworks}/CoreDisplay.framework".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
subprocess.run(f"sudo rm -R {self.mount_frameworks}/IOSurface.framework".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
subprocess.run(f"sudo rm -R {self.mount_frameworks}/OpenGL.framework".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
|
|
||||||
# Private Framworks
|
|
||||||
subprocess.run(f"sudo rm -R {self.mount_private_frameworks}/GPUSupport.framework".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
subprocess.run(f"sudo rm -R {self.mount_private_frameworks}/SkyLight.framework".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
|
|
||||||
|
|
||||||
# Now add our trash
|
|
||||||
# Kexts
|
# Kexts
|
||||||
print("- Adding supported Binaries")
|
print("- Adding supported Binaries for GPU Accleration")
|
||||||
|
print("- Adding legacy Nvidia Kexts and Bundles")
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforcega_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo cp -R {self.constants.geforcega_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforcetesla_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo cp -R {self.constants.geforcetesla_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforceteslagl_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo cp -R {self.constants.geforceteslagl_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
@@ -102,23 +93,20 @@ class PatchSysVolume:
|
|||||||
subprocess.run(f"sudo cp -R {self.constants.iosurface_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo cp -R {self.constants.iosurface_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo cp -R {self.constants.nvdanv50haltesla_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo cp -R {self.constants.nvdanv50haltesla_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo cp -R {self.constants.nvdaresmantesla_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo cp -R {self.constants.nvdaresmantesla_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforcega_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforcega_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforcega_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforcega_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
subprocess.run(f"sudo cp -R {self.constants.geforcega_path} {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
|
|
||||||
# Frameworks
|
# Frameworks
|
||||||
subprocess.run(f"sudo cp -R {self.constants.coredisplay_path} {self.mount_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
print("- Merging legacy Frameworks")
|
||||||
subprocess.run(f"sudo cp -R {self.constants.iosurface_f_path} {self.mount_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo ditto {self.constants.payload_apple_frameworks_path} {self.mount_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo cp -R {self.constants.opengl_path} {self.mount_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
|
||||||
|
|
||||||
# LaunchDaemons
|
# LaunchDaemons
|
||||||
subprocess.run(f"sudo cp -R {self.constants.hiddhack_path} {self.mount_lauchd}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
print("- Adding HiddHack.plist")
|
||||||
|
subprocess.run(f"sudo ditto {self.constants.payload_apple_lauchd_path} {self.mount_lauchd}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
subprocess.run(f"sudo chmod 755 {self.mount_lauchd}/HiddHack.plist".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
subprocess.run(f"sudo chown root:wheel {self.mount_lauchd}/HiddHack.plist".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
# PrivateFrameworks
|
# PrivateFrameworks
|
||||||
subprocess.run(f"sudo cp -R {self.constants.gpusupport_path} {self.mount_private_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
print("- Merging legacy PrivateFrameworks")
|
||||||
subprocess.run(f"sudo cp -R {self.constants.skylight_path} {self.mount_private_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo ditto {self.constants.payload_apple_private_frameworks_path} {self.mount_private_frameworks}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
print("- Disabling NSDefenestratorModeEnabled")
|
print("- Disabling NSDefenestratorModeEnabled")
|
||||||
subprocess.run("defaults write -g NSDefenestratorModeEnabled -bool false".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run("defaults write -g NSDefenestratorModeEnabled -bool false".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
@@ -126,7 +114,7 @@ class PatchSysVolume:
|
|||||||
|
|
||||||
def patch_root_vol(self):
|
def patch_root_vol(self):
|
||||||
print(f"- Detecting patches for {self.model}")
|
print(f"- Detecting patches for {self.model}")
|
||||||
print("- Creating backup snapshot")
|
print("- Creating backup snapshot (This may take some time)")
|
||||||
subprocess.run("tmutil snapshot".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run("tmutil snapshot".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
# Start Patch engine
|
# Start Patch engine
|
||||||
@@ -142,11 +130,10 @@ class PatchSysVolume:
|
|||||||
subprocess.run(f"sudo cp -R {self.constants.applebcm_path} {self.mount_extensions}/IONetworkingFamily.kext/Contents/PlugIns/".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo cp -R {self.constants.applebcm_path} {self.mount_extensions}/IONetworkingFamily.kext/Contents/PlugIns/".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
rebuild_required = True
|
rebuild_required = True
|
||||||
|
|
||||||
#if self.model in ModelArray.LegacyGPU:
|
if (self.model in ModelArray.LegacyGPU) and (Path(self.constants.hiddhack_path).exists()):
|
||||||
#print("- Attemping Legacy GPU Patches")
|
print("- Attemping Legacy GPU Patches")
|
||||||
#TODO: Re-enable when GPU patches are public
|
self.gpu_accel_patches()
|
||||||
#self.gpu_accel_patches()
|
rebuild_required = True
|
||||||
#rebuild_required = True
|
|
||||||
|
|
||||||
if rebuild_required is True:
|
if rebuild_required is True:
|
||||||
self.rebuild_snapshot()
|
self.rebuild_snapshot()
|
||||||
@@ -158,6 +145,10 @@ class PatchSysVolume:
|
|||||||
print("- Creating new APFS snapshot")
|
print("- Creating new APFS snapshot")
|
||||||
subprocess.run(f"sudo bless --folder {self.mount_location}/System/Library/CoreServices --bootefi --create-snapshot".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo bless --folder {self.mount_location}/System/Library/CoreServices --bootefi --create-snapshot".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
|
def unmount_drive(self):
|
||||||
|
print("- Unmounting Root Volume")
|
||||||
|
subprocess.run(f"sudo diskutil unmount {self.root_mount_path}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
def start_patch(self):
|
def start_patch(self):
|
||||||
# Check SIP
|
# Check SIP
|
||||||
if self.constants.custom_model != None:
|
if self.constants.custom_model != None:
|
||||||
@@ -187,9 +178,10 @@ class PatchSysVolume:
|
|||||||
smb_status = "Disabled"
|
smb_status = "Disabled"
|
||||||
|
|
||||||
if (sip_status == b'\xef\x0f\x00\x00') and (smb_status == "Disabled"):
|
if (sip_status == b'\xef\x0f\x00\x00') and (smb_status == "Disabled"):
|
||||||
print("- Detected SIP is disabled, continuing")
|
print("- Detected SIP and SecureBootModel are disabled, continuing")
|
||||||
input("\nPress [ENTER] to continue")
|
input("\nPress [ENTER] to continue")
|
||||||
self.find_mount_root_vol()
|
self.find_mount_root_vol()
|
||||||
|
self.unmount_drive()
|
||||||
print("- Patching complete")
|
print("- Patching complete")
|
||||||
print("\nPlease reboot the machine for patches to take effect")
|
print("\nPlease reboot the machine for patches to take effect")
|
||||||
else:
|
else:
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ Once finished, you'll find in your `~/macOS-Installer/` folder a DMG containing
|
|||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Now we'll be formatting the USB to prep for both the macOS installer and OpenCore. We'll want to use macOS Extended (HFS+) with a GUID partition map(Using GUID is important for the patcher). This will create two partitions: the main `MyVolume` and a second called `EFI` which is used as a boot partition where your Mac's firmware will check for boot files.
|
Now we'll be formatting the USB to prep for both the macOS installer and OpenCore. We'll want to use macOS Extended (HFS+) with a GUID partition map(Using GUID is important for the patcher). This will create two partitions: the main `MyVolume` and a second called `EFI` which is used as a boot partition where your Mac's firmware will check for boot files. `EFI` partitions will be hidden by default, so don't worry if you don't immediately see them.
|
||||||
|
|
||||||
* Note: By default, Disk Utility only shows partitions – press Cmd/Win+2 to show all devices (alternatively you can press the View button)
|
* Note: By default, Disk Utility only shows partitions – press Cmd/Win+2 to show all devices (alternatively you can press the View button)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user