mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-22 19:10:15 +10:00
Add minor kernel version detection
This commit is contained in:
@@ -17,6 +17,7 @@ class OpenCoreLegacyPatcher:
|
|||||||
self.constants.computer = device_probe.Computer.probe()
|
self.constants.computer = device_probe.Computer.probe()
|
||||||
self.computer = self.constants.computer
|
self.computer = self.constants.computer
|
||||||
self.constants.detected_os = int(platform.uname().release.partition(".")[0])
|
self.constants.detected_os = int(platform.uname().release.partition(".")[0])
|
||||||
|
self.constants.detected_os_minor = int(platform.uname().release.partition(".")[2].partition(".")[0])
|
||||||
self.set_defaults(self.computer.real_model, True)
|
self.set_defaults(self.computer.real_model, True)
|
||||||
|
|
||||||
def set_defaults(self, model, host_is_target):
|
def set_defaults(self, model, host_is_target):
|
||||||
@@ -220,6 +221,20 @@ Supported Options:
|
|||||||
2. Unpatch System Volume (Experimental)
|
2. Unpatch System Volume (Experimental)
|
||||||
B. Exit
|
B. Exit
|
||||||
"""
|
"""
|
||||||
|
mojave_catalina = """Patches Root volume to fix misc issues such as:
|
||||||
|
- Graphics Acceleration
|
||||||
|
- Nvidia: Tesla - Fermi (8000-500 series)
|
||||||
|
- Intel: Ironlake - Sandy Bridge
|
||||||
|
- AMD: TeraScale 1 and 2 (2000-6000 series)
|
||||||
|
- Audio support for iMac7,1 and iMac8,1
|
||||||
|
WARNING: Root Volume Patching is still in active development, please
|
||||||
|
have all important user data backed up. Note when the system volume
|
||||||
|
is patched, you can no longer have Delta updates or have FileVault
|
||||||
|
enabled.
|
||||||
|
Supported Options:
|
||||||
|
1. Patch System Volume
|
||||||
|
B. Exit
|
||||||
|
"""
|
||||||
|
|
||||||
default = """
|
default = """
|
||||||
This OS has no root patches available to apply, please ensure you're patching a booted
|
This OS has no root patches available to apply, please ensure you're patching a booted
|
||||||
@@ -234,13 +249,15 @@ B. Exit
|
|||||||
print(monterey)
|
print(monterey)
|
||||||
elif self.constants.detected_os == self.constants.big_sur:
|
elif self.constants.detected_os == self.constants.big_sur:
|
||||||
print(big_sur)
|
print(big_sur)
|
||||||
|
elif self.constants.detected_os in [self.constants.mojave, self.constants.catalina] and self.constants.moj_cat_accel == True:
|
||||||
|
print(mojave_catalina)
|
||||||
else:
|
else:
|
||||||
print(default)
|
print(default)
|
||||||
no_patch = True
|
no_patch = True
|
||||||
change_menu = input("Patch System Volume?: ")
|
change_menu = input("Patch System Volume?: ")
|
||||||
if no_patch is not True and change_menu == "1":
|
if no_patch is not True and change_menu == "1":
|
||||||
SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_patch()
|
SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_patch()
|
||||||
elif no_patch is not True and change_menu == "2":
|
elif no_patch is not True and change_menu == "2" and self.constants.detected_os > self.constants.catalina:
|
||||||
SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_unpatch()
|
SysPatch.PatchSysVolume(self.constants.custom_model or self.computer.real_model, self.constants).start_unpatch()
|
||||||
else:
|
else:
|
||||||
print("Returning to main menu")
|
print("Returning to main menu")
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class Constants:
|
|||||||
self.latebloom_version = "0.17"
|
self.latebloom_version = "0.17"
|
||||||
self.disk = ""
|
self.disk = ""
|
||||||
self.patch_disk = ""
|
self.patch_disk = ""
|
||||||
self.patcher_support_pkg_version = "0.0.13" # PatcherSupportPkg
|
self.patcher_support_pkg_version = "0.0.14" # PatcherSupportPkg
|
||||||
|
|
||||||
# Get resource path
|
# Get resource path
|
||||||
self.current_path = Path(__file__).parent.parent.resolve()
|
self.current_path = Path(__file__).parent.parent.resolve()
|
||||||
@@ -73,6 +73,7 @@ class Constants:
|
|||||||
self.sip_status = True
|
self.sip_status = True
|
||||||
self.secure_status = False
|
self.secure_status = False
|
||||||
self.detected_os = 0
|
self.detected_os = 0
|
||||||
|
self.detected_os_minor = 0
|
||||||
self.boot_efi = False
|
self.boot_efi = False
|
||||||
self.drm_support = False
|
self.drm_support = False
|
||||||
self.allow_oc_everywhere = False
|
self.allow_oc_everywhere = False
|
||||||
|
|||||||
@@ -290,10 +290,11 @@ set million colour before rebooting"""
|
|||||||
self.elevated(
|
self.elevated(
|
||||||
["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel}/", self.mount_private_frameworks], stdout=subprocess.PIPE
|
["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_private_frameworks_path_accel}/", self.mount_private_frameworks], stdout=subprocess.PIPE
|
||||||
).stdout.decode().strip().encode()
|
).stdout.decode().strip().encode()
|
||||||
print("- Adding IOHID-Fixup.plist")
|
if self.constants.detected_os > self.constants.catalina:
|
||||||
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_lauchd_path_accel}/", self.mount_lauchd], stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
print("- Adding IOHID-Fixup.plist")
|
||||||
self.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
self.elevated(["rsync", "-r", "-i", "-a", f"{self.constants.payload_apple_lauchd_path_accel}/", self.mount_lauchd], stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
self.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
self.elevated(["chmod", "755", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
self.elevated(["chown", "root:wheel", f"{self.mount_lauchd}/IOHID-Fixup.plist"], stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
def gpu_accel_legacy_extended_ts2(self):
|
def gpu_accel_legacy_extended_ts2(self):
|
||||||
print("- Merging TeraScale 2 legacy Frameworks")
|
print("- Merging TeraScale 2 legacy Frameworks")
|
||||||
|
|||||||
Reference in New Issue
Block a user