mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 03:50:14 +10:00
Fix DeviceProperty and Root Volume detection
This commit is contained in:
@@ -287,6 +287,8 @@ class Constants:
|
|||||||
@property
|
@property
|
||||||
def payload_apple_frameworks_path_accel(self): return self.payload_apple_frameworks_path / Path("Graphics-Acceleration")
|
def payload_apple_frameworks_path_accel(self): return self.payload_apple_frameworks_path / Path("Graphics-Acceleration")
|
||||||
@property
|
@property
|
||||||
|
def payload_apple_frameworks_path_accel_ts2(self): return self.payload_apple_frameworks_path / Path("Graphics-Acceleration-TS2")
|
||||||
|
@property
|
||||||
def payload_apple_lauchd_path(self): return self.payload_apple_root_path / Path("LaunchDaemons")
|
def payload_apple_lauchd_path(self): return self.payload_apple_root_path / Path("LaunchDaemons")
|
||||||
@property
|
@property
|
||||||
def payload_apple_lauchd_path_accel(self): return self.payload_apple_lauchd_path / Path("Graphics-Acceleration")
|
def payload_apple_lauchd_path_accel(self): return self.payload_apple_lauchd_path / Path("Graphics-Acceleration")
|
||||||
@@ -295,6 +297,8 @@ class Constants:
|
|||||||
@property
|
@property
|
||||||
def payload_apple_private_frameworks_path_accel(self): return self.payload_apple_private_frameworks_path / Path("Graphics-Acceleration")
|
def payload_apple_private_frameworks_path_accel(self): return self.payload_apple_private_frameworks_path / Path("Graphics-Acceleration")
|
||||||
@property
|
@property
|
||||||
|
def payload_apple_private_frameworks_path_accel_ts2(self): return self.payload_apple_private_frameworks_path / Path("Graphics-Acceleration-TS2")
|
||||||
|
@property
|
||||||
def payload_apple_private_frameworks_path_brightness(self): return self.payload_apple_private_frameworks_path / Path("Brightness-Control")
|
def payload_apple_private_frameworks_path_brightness(self): return self.payload_apple_private_frameworks_path / Path("Brightness-Control")
|
||||||
|
|
||||||
# Apple Extensions
|
# Apple Extensions
|
||||||
@@ -306,12 +310,16 @@ class Constants:
|
|||||||
@property
|
@property
|
||||||
def legacy_graphics(self): return self.payload_apple_kexts_path / Path("Graphics-Acceleration")
|
def legacy_graphics(self): return self.payload_apple_kexts_path / Path("Graphics-Acceleration")
|
||||||
@property
|
@property
|
||||||
|
def legacy_graphics_ts2(self): return self.payload_apple_kexts_path / Path("Graphics-Acceleration-TS2")
|
||||||
|
@property
|
||||||
def legacy_nvidia_path(self): return self.legacy_graphics / Path("Nvidia-Tesla-Fermi")
|
def legacy_nvidia_path(self): return self.legacy_graphics / Path("Nvidia-Tesla-Fermi")
|
||||||
@property
|
@property
|
||||||
def legacy_nvidia_kepler_path(self): return self.legacy_graphics / Path("Nvidia-Kepler")
|
def legacy_nvidia_kepler_path(self): return self.legacy_graphics / Path("Nvidia-Kepler")
|
||||||
@property
|
@property
|
||||||
def legacy_amd_path(self): return self.legacy_graphics / Path("AMD-ATI")
|
def legacy_amd_path(self): return self.legacy_graphics / Path("AMD-ATI")
|
||||||
@property
|
@property
|
||||||
|
def legacy_amd_path_ts2(self): return self.legacy_graphics / Path("ATI-TS2")
|
||||||
|
@property
|
||||||
def legacy_intel_gen1_path(self): return self.legacy_graphics / Path("Intel-Gen5-Ironlake")
|
def legacy_intel_gen1_path(self): return self.legacy_graphics / Path("Intel-Gen5-Ironlake")
|
||||||
@property
|
@property
|
||||||
def legacy_intel_gen2_path(self): return self.legacy_graphics / Path("Intel-Gen6-SandyBridge")
|
def legacy_intel_gen2_path(self): return self.legacy_graphics / Path("Intel-Gen6-SandyBridge")
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ class pci_probe:
|
|||||||
# IOACPIPlane:/_SB/PCI0@0/P0P2@10000 -> /PCI0@0/P0P2@1
|
# IOACPIPlane:/_SB/PCI0@0/P0P2@10000 -> /PCI0@0/P0P2@1
|
||||||
acpi_path = acpi_path_full.replace("IOACPIPlane:/_SB", "")
|
acpi_path = acpi_path_full.replace("IOACPIPlane:/_SB", "")
|
||||||
acpi_path = acpi_path.replace("0000", "")
|
acpi_path = acpi_path.replace("0000", "")
|
||||||
acpi_path = acpi_path.replace("0001", "")
|
for entry in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]:
|
||||||
|
acpi_path = acpi_path.replace(f"000{entry}", f",{entry}")
|
||||||
acpi_path = acpi_path.replace("ffff", "0")
|
acpi_path = acpi_path.replace("ffff", "0")
|
||||||
acpi_path = acpi_path.upper()
|
acpi_path = acpi_path.upper()
|
||||||
return acpi_path
|
return acpi_path
|
||||||
|
|||||||
@@ -981,6 +981,10 @@ DeleteAMDAccel11 = [
|
|||||||
"IOGPUFamily.kext",
|
"IOGPUFamily.kext",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
DeleteAMDAccel11TS2 = [
|
||||||
|
"AppleCameraInterface.kext",
|
||||||
|
]
|
||||||
|
|
||||||
AddNvidiaAccel11 = [
|
AddNvidiaAccel11 = [
|
||||||
"GeForceGA.bundle",
|
"GeForceGA.bundle",
|
||||||
"GeForceTesla.kext",
|
"GeForceTesla.kext",
|
||||||
@@ -1017,7 +1021,7 @@ AddAMDAccel11 = [
|
|||||||
"AMDLegacySupport.kext",
|
"AMDLegacySupport.kext",
|
||||||
"AMDRadeonVADriver.bundle",
|
"AMDRadeonVADriver.bundle",
|
||||||
"AMDRadeonVADriver2.bundle",
|
"AMDRadeonVADriver2.bundle",
|
||||||
#"AMDRadeonX3000.kext",
|
"AMDRadeonX3000.kext",
|
||||||
"AMDRadeonX3000GLDriver.bundle",
|
"AMDRadeonX3000GLDriver.bundle",
|
||||||
"AMDShared.bundle",
|
"AMDShared.bundle",
|
||||||
"AMDSupport.kext",
|
"AMDSupport.kext",
|
||||||
@@ -1027,6 +1031,10 @@ AddAMDAccel11 = [
|
|||||||
"ATIRadeonX2000VADriver.bundle",
|
"ATIRadeonX2000VADriver.bundle",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
AddAMDAccel11TS2 = [
|
||||||
|
"IOSurface.kext",
|
||||||
|
]
|
||||||
|
|
||||||
AddIntelGen1Accel = [
|
AddIntelGen1Accel = [
|
||||||
"AppleIntelHDGraphics.kext",
|
"AppleIntelHDGraphics.kext",
|
||||||
"AppleIntelHDGraphicsFB.kext",
|
"AppleIntelHDGraphicsFB.kext",
|
||||||
|
|||||||
@@ -160,12 +160,10 @@ class PatchSysVolume:
|
|||||||
print("- Creating mnt1 folder")
|
print("- Creating mnt1 folder")
|
||||||
Path(self.constants.payload_mnt1_path).mkdir()
|
Path(self.constants.payload_mnt1_path).mkdir()
|
||||||
else:
|
else:
|
||||||
root_partition_info = plistlib.loads(subprocess.run("diskutil info -plist /".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
root_partition_info = plistlib.loads(subprocess.run("diskutil info -plist /System/Volumes/Update/mnt1".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode())
|
||||||
self.root_mount_path = root_partition_info["DeviceIdentifier"]
|
self.root_mount_path = root_partition_info["DeviceIdentifier"]
|
||||||
|
|
||||||
if self.root_mount_path.startswith("disk"):
|
if self.root_mount_path.startswith("disk"):
|
||||||
if self.constants.recovery_status is False:
|
|
||||||
self.root_mount_path = self.root_mount_path[:-2] if self.root_mount_path.count("s") > 1 else self.root_mount_path
|
|
||||||
print(f"- Found Root Volume at: {self.root_mount_path}")
|
print(f"- Found Root Volume at: {self.root_mount_path}")
|
||||||
if Path(self.mount_extensions).exists():
|
if Path(self.mount_extensions).exists():
|
||||||
print("- Root Volume is already mounted")
|
print("- Root Volume is already mounted")
|
||||||
@@ -196,8 +194,11 @@ class PatchSysVolume:
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print("- Failed to mount the Root Volume")
|
print("- Failed to mount the Root Volume")
|
||||||
|
print("- Recommend rebooting the machine and trying to patch again")
|
||||||
|
input("- Press [ENTER] to exit")
|
||||||
else:
|
else:
|
||||||
print("- Could not find root volume")
|
print("- Could not find root volume")
|
||||||
|
input("- Press [ENTER] to exit")
|
||||||
|
|
||||||
def delete_old_binaries(self, vendor_patch):
|
def delete_old_binaries(self, vendor_patch):
|
||||||
for delete_current_kext in vendor_patch:
|
for delete_current_kext in vendor_patch:
|
||||||
|
|||||||
Reference in New Issue
Block a user