mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 20:10:14 +10:00
Format py files
This commit is contained in:
@@ -41,14 +41,14 @@ class OpenCoreLegacyPatcher():
|
|||||||
self.current_model = true_model
|
self.current_model = true_model
|
||||||
|
|
||||||
def build_opencore(self):
|
def build_opencore(self):
|
||||||
build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).build_opencore()
|
Build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).build_opencore()
|
||||||
|
|
||||||
def install_opencore(self):
|
def install_opencore(self):
|
||||||
build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).copy_efi()
|
Build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).copy_efi()
|
||||||
|
|
||||||
def change_model(self):
|
def change_model(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Select Different Model"])
|
Utilities.header(["Select Different Model"])
|
||||||
print("""
|
print("""
|
||||||
Tip: Run the following command on the target machine to find the model identifier:
|
Tip: Run the following command on the target machine to find the model identifier:
|
||||||
|
|
||||||
@@ -66,15 +66,13 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
|
|||||||
if self.constants.custom_model in ModelArray.NoAPFSsupport:
|
if self.constants.custom_model in ModelArray.NoAPFSsupport:
|
||||||
self.constants.serial_settings = "Moderate"
|
self.constants.serial_settings = "Moderate"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def patcher_settings(self):
|
def patcher_settings(self):
|
||||||
response = None
|
response = None
|
||||||
while not (response and response == -1):
|
while not (response and response == -1):
|
||||||
title = [
|
title = [
|
||||||
"Adjust Patcher Settings"
|
"Adjust Patcher Settings"
|
||||||
]
|
]
|
||||||
menu = utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
|
menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
|
||||||
options = [
|
options = [
|
||||||
# TODO: Enable setting OS target when more OSes become supported by the patcher
|
# TODO: Enable setting OS target when more OSes become supported by the patcher
|
||||||
#[f"Change OS version:\t\t\tCurrently macOS {self.constants.os_support}", self.change_os],
|
#[f"Change OS version:\t\t\tCurrently macOS {self.constants.os_support}", self.change_os],
|
||||||
@@ -97,7 +95,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
|
|||||||
response = menu.start()
|
response = menu.start()
|
||||||
|
|
||||||
def credits(self):
|
def credits(self):
|
||||||
utilities.TUIOnlyPrint(["Credits"], "Press [Enter] to go back.\n",
|
Utilities.TUIOnlyPrint(["Credits"], "Press [Enter] to go back.\n",
|
||||||
["""Many thanks to the following:
|
["""Many thanks to the following:
|
||||||
|
|
||||||
- Acidanthera:\tOpenCore, kexts and other tools
|
- Acidanthera:\tOpenCore, kexts and other tools
|
||||||
@@ -109,8 +107,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
|
|||||||
- cdf:\t\tNightShiftEnabler"""]).start()
|
- cdf:\t\tNightShiftEnabler"""]).start()
|
||||||
|
|
||||||
def PatchVolume(self):
|
def PatchVolume(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Patching System Volume"])
|
Utilities.header(["Patching System Volume"])
|
||||||
print("""Patches Root volume to fix misc issues such as:
|
print("""Patches Root volume to fix misc issues such as:
|
||||||
|
|
||||||
- Brightness control for non-Metal GPUs
|
- Brightness control for non-Metal GPUs
|
||||||
@@ -134,7 +132,6 @@ B. Exit
|
|||||||
else:
|
else:
|
||||||
print("Returning to main menu")
|
print("Returning to main menu")
|
||||||
|
|
||||||
|
|
||||||
def main_menu(self):
|
def main_menu(self):
|
||||||
response = None
|
response = None
|
||||||
ModelArray.SupportedSMBIOS = ModelArray.SupportedSMBIOS11
|
ModelArray.SupportedSMBIOS = ModelArray.SupportedSMBIOS11
|
||||||
@@ -165,7 +162,7 @@ B. Exit
|
|||||||
else:
|
else:
|
||||||
in_between = ["This model is supported"]
|
in_between = ["This model is supported"]
|
||||||
|
|
||||||
menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True)
|
menu = Utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True)
|
||||||
|
|
||||||
options = (
|
options = (
|
||||||
[["Build OpenCore", self.build_opencore]] if ((self.constants.custom_model or self.current_model) in ModelArray.SupportedSMBIOS) else []) + [
|
[["Build OpenCore", self.build_opencore]] if ((self.constants.custom_model or self.current_model) in ModelArray.SupportedSMBIOS) else []) + [
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class BuildOpenCore:
|
|||||||
return hex_str.upper()
|
return hex_str.upper()
|
||||||
|
|
||||||
def build_efi(self):
|
def build_efi(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
if not Path(self.constants.build_path).exists():
|
if not Path(self.constants.build_path).exists():
|
||||||
Path(self.constants.build_path).mkdir()
|
Path(self.constants.build_path).mkdir()
|
||||||
print("Created build folder")
|
print("Created build folder")
|
||||||
@@ -264,7 +264,6 @@ class BuildOpenCore:
|
|||||||
print("- Disabling unsupported iGPU")
|
print("- Disabling unsupported iGPU")
|
||||||
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"name": binascii.unhexlify("23646973706C6179"), "IOName": "#display", "class-code": binascii.unhexlify("FFFFFFFF")}
|
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"name": binascii.unhexlify("23646973706C6179"), "IOName": "#display", "class-code": binascii.unhexlify("FFFFFFFF")}
|
||||||
|
|
||||||
|
|
||||||
# Check GPU Vendor
|
# Check GPU Vendor
|
||||||
if self.constants.metal_build is True:
|
if self.constants.metal_build is True:
|
||||||
print("- Adding Metal GPU patches on request")
|
print("- Adding Metal GPU patches on request")
|
||||||
@@ -287,7 +286,6 @@ class BuildOpenCore:
|
|||||||
print("- Adding Mac Pro, Xserve DRM patches")
|
print("- Adding Mac Pro, Xserve DRM patches")
|
||||||
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree"
|
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree"
|
||||||
|
|
||||||
|
|
||||||
# Add OpenCanopy
|
# Add OpenCanopy
|
||||||
print("- Adding OpenCanopy GUI")
|
print("- Adding OpenCanopy GUI")
|
||||||
shutil.rmtree(self.constants.resources_path, onerror=rmtree_handler)
|
shutil.rmtree(self.constants.resources_path, onerror=rmtree_handler)
|
||||||
@@ -403,12 +401,14 @@ class BuildOpenCore:
|
|||||||
self.config["PlatformInfo"]["PlatformNVRAM"]["BID"] = self.spoofed_board
|
self.config["PlatformInfo"]["PlatformNVRAM"]["BID"] = self.spoofed_board
|
||||||
self.config["PlatformInfo"]["SMBIOS"]["BoardProduct"] = self.spoofed_board
|
self.config["PlatformInfo"]["SMBIOS"]["BoardProduct"] = self.spoofed_board
|
||||||
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
||||||
|
|
||||||
def moderate_serial_patch(self):
|
def moderate_serial_patch(self):
|
||||||
self.config["PlatformInfo"]["Automatic"] = True
|
self.config["PlatformInfo"]["Automatic"] = True
|
||||||
self.config["PlatformInfo"]["UpdateDataHub"] = True
|
self.config["PlatformInfo"]["UpdateDataHub"] = True
|
||||||
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
self.config["PlatformInfo"]["UpdateNVRAM"] = True
|
||||||
self.config["UEFI"]["ProtocolOverrides"]["DataHub"] = True
|
self.config["UEFI"]["ProtocolOverrides"]["DataHub"] = True
|
||||||
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model
|
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model
|
||||||
|
|
||||||
def adanced_serial_patch(self):
|
def adanced_serial_patch(self):
|
||||||
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
macserial_output = macserial_output.stdout.decode().strip().split(" | ")
|
macserial_output = macserial_output.stdout.decode().strip().split(" | ")
|
||||||
@@ -534,11 +534,11 @@ class BuildOpenCore:
|
|||||||
input("Press [Enter] to go back.\n")
|
input("Press [Enter] to go back.\n")
|
||||||
|
|
||||||
def copy_efi(self):
|
def copy_efi(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Installing OpenCore to Drive"])
|
Utilities.header(["Installing OpenCore to Drive"])
|
||||||
|
|
||||||
if not self.constants.opencore_release_folder.exists():
|
if not self.constants.opencore_release_folder.exists():
|
||||||
utilities.TUIOnlyPrint(
|
Utilities.TUIOnlyPrint(
|
||||||
["Installing OpenCore to Drive"],
|
["Installing OpenCore to Drive"],
|
||||||
"Press [Enter] to go back.\n",
|
"Press [Enter] to go back.\n",
|
||||||
[
|
[
|
||||||
@@ -574,7 +574,7 @@ Please build OpenCore first!"""
|
|||||||
# Avoid crashing with CDs installed
|
# Avoid crashing with CDs installed
|
||||||
continue
|
continue
|
||||||
# TODO: Advanced mode
|
# TODO: Advanced mode
|
||||||
menu = utilities.TUIMenu(
|
menu = Utilities.TUIMenu(
|
||||||
["Select Disk"],
|
["Select Disk"],
|
||||||
"Please select the disk you would like to install OpenCore to: ",
|
"Please select the disk you would like to install OpenCore to: ",
|
||||||
in_between=["Missing disks? Ensure they have an EFI or FAT32 partition."],
|
in_between=["Missing disks? Ensure they have an EFI or FAT32 partition."],
|
||||||
@@ -594,7 +594,7 @@ Please build OpenCore first!"""
|
|||||||
disk_identifier = "disk" + response
|
disk_identifier = "disk" + response
|
||||||
selected_disk = all_disks[disk_identifier]
|
selected_disk = all_disks[disk_identifier]
|
||||||
|
|
||||||
menu = utilities.TUIMenu(
|
menu = Utilities.TUIMenu(
|
||||||
["Select Partition"],
|
["Select Partition"],
|
||||||
"Please select the partition you would like to install OpenCore to: ",
|
"Please select the partition you would like to install OpenCore to: ",
|
||||||
return_number_instead_of_direct_call=True,
|
return_number_instead_of_direct_call=True,
|
||||||
@@ -651,8 +651,8 @@ Please build OpenCore first!"""
|
|||||||
ssd_type = False
|
ssd_type = False
|
||||||
mount_path = Path(partition_info["MountPoint"])
|
mount_path = Path(partition_info["MountPoint"])
|
||||||
disk_type = partition_info["BusProtocol"]
|
disk_type = partition_info["BusProtocol"]
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Copying OpenCore"])
|
Utilities.header(["Copying OpenCore"])
|
||||||
|
|
||||||
if mount_path.exists():
|
if mount_path.exists():
|
||||||
if (mount_path / Path("EFI/OC")).exists():
|
if (mount_path / Path("EFI/OC")).exists():
|
||||||
|
|||||||
@@ -2,18 +2,22 @@
|
|||||||
# Copyright (C) 2020-2021, Dhinak G, Mykola Grymalyuk
|
# Copyright (C) 2020-2021, Dhinak G, Mykola Grymalyuk
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import subprocess, sys, time, platform
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import platform
|
||||||
|
|
||||||
from Resources import Build, ModelArray, Constants, SysPatch, Utilities
|
from Resources import Build, ModelArray, Constants, SysPatch, Utilities
|
||||||
|
|
||||||
|
|
||||||
class MenuOptions:
|
class MenuOptions:
|
||||||
def __init__(self, model, versions):
|
def __init__(self, model, versions):
|
||||||
self.model = model
|
self.model = model
|
||||||
self.constants: Constants.Constants = versions
|
self.constants: Constants.Constants = versions
|
||||||
|
|
||||||
def change_os(self):
|
def change_os(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Select Patcher's Target OS"])
|
Utilities.header(["Select Patcher's Target OS"])
|
||||||
print(f"""
|
print(f"""
|
||||||
Minimum Target:\t{self.constants.min_os_support}
|
Minimum Target:\t{self.constants.min_os_support}
|
||||||
Maximum Target:\t{self.constants.max_os_support}
|
Maximum Target:\t{self.constants.max_os_support}
|
||||||
@@ -30,8 +34,8 @@ Current target:\t{self.constants.os_support}
|
|||||||
ModelArray.SupportedSMBIOS = ModelArray.SupportedSMBIOS12
|
ModelArray.SupportedSMBIOS = ModelArray.SupportedSMBIOS12
|
||||||
|
|
||||||
def change_verbose(self):
|
def change_verbose(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set Verbose mode"])
|
Utilities.header(["Set Verbose mode"])
|
||||||
change_menu = input("Enable Verbose mode(y/n): ")
|
change_menu = input("Enable Verbose mode(y/n): ")
|
||||||
if change_menu in {"y", "Y", "yes", "Yes"}:
|
if change_menu in {"y", "Y", "yes", "Yes"}:
|
||||||
self.constants.verbose_debug = True
|
self.constants.verbose_debug = True
|
||||||
@@ -41,8 +45,8 @@ Current target:\t{self.constants.os_support}
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_oc(self):
|
def change_oc(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set OpenCore DEBUG mode"])
|
Utilities.header(["Set OpenCore DEBUG mode"])
|
||||||
change_menu = input("Enable OpenCore DEBUG mode(y/n): ")
|
change_menu = input("Enable OpenCore DEBUG mode(y/n): ")
|
||||||
if change_menu in {"y", "Y", "yes", "Yes"}:
|
if change_menu in {"y", "Y", "yes", "Yes"}:
|
||||||
self.constants.opencore_debug = True
|
self.constants.opencore_debug = True
|
||||||
@@ -52,9 +56,10 @@ Current target:\t{self.constants.os_support}
|
|||||||
self.constants.opencore_build = "RELEASE"
|
self.constants.opencore_build = "RELEASE"
|
||||||
else:
|
else:
|
||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_kext(self):
|
def change_kext(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set Kext DEBUG mode"])
|
Utilities.header(["Set Kext DEBUG mode"])
|
||||||
change_menu = input("Enable Kext DEBUG mode(y/n): ")
|
change_menu = input("Enable Kext DEBUG mode(y/n): ")
|
||||||
if change_menu in {"y", "Y", "yes", "Yes"}:
|
if change_menu in {"y", "Y", "yes", "Yes"}:
|
||||||
self.constants.kext_debug = True
|
self.constants.kext_debug = True
|
||||||
@@ -64,8 +69,8 @@ Current target:\t{self.constants.os_support}
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_metal(self):
|
def change_metal(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Assume Metal GPU Always in iMac"])
|
Utilities.header(["Assume Metal GPU Always in iMac"])
|
||||||
print("""This is for iMacs that have upgraded Metal GPUs, otherwise
|
print("""This is for iMacs that have upgraded Metal GPUs, otherwise
|
||||||
Patcher assumes based on stock configuration (ie. iMac10,x-12,x)
|
Patcher assumes based on stock configuration (ie. iMac10,x-12,x)
|
||||||
|
|
||||||
@@ -92,8 +97,8 @@ option is for those patching on a different machine or OCLP cannot detect.
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_wifi(self):
|
def change_wifi(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Assume Upgraded Wifi Always"])
|
Utilities.header(["Assume Upgraded Wifi Always"])
|
||||||
print("""This is for Macs with upgraded wifi cards(ie. BCM94360/2)
|
print("""This is for Macs with upgraded wifi cards(ie. BCM94360/2)
|
||||||
|
|
||||||
Note: Patcher will detect whether hardware has been upgraded regardless, this
|
Note: Patcher will detect whether hardware has been upgraded regardless, this
|
||||||
@@ -108,8 +113,8 @@ option is for those patching on a different machine or cannot detect.
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_serial(self):
|
def change_serial(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set SMBIOS Mode"])
|
Utilities.header(["Set SMBIOS Mode"])
|
||||||
print("""This section is for setting how OpenCore generates the SMBIOS
|
print("""This section is for setting how OpenCore generates the SMBIOS
|
||||||
Recommended for adanced users who want control how serials are handled
|
Recommended for adanced users who want control how serials are handled
|
||||||
|
|
||||||
@@ -130,9 +135,10 @@ Note: For new users we recommend leaving as default(1. Minimal)
|
|||||||
self.constants.serial_settings = "Advanced"
|
self.constants.serial_settings = "Advanced"
|
||||||
else:
|
else:
|
||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_showpicker(self):
|
def change_showpicker(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set OpenCore Picker mode"])
|
Utilities.header(["Set OpenCore Picker mode"])
|
||||||
print("""By default, OpenCore will show its boot picker each time on boot up,
|
print("""By default, OpenCore will show its boot picker each time on boot up,
|
||||||
however this can be disabled by default and be shown on command by repeatedly
|
however this can be disabled by default and be shown on command by repeatedly
|
||||||
pressing the "Esc" key
|
pressing the "Esc" key
|
||||||
@@ -146,8 +152,8 @@ pressing the "Esc" key
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_vault(self):
|
def change_vault(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set OpenCore Vaulting"])
|
Utilities.header(["Set OpenCore Vaulting"])
|
||||||
print("""By default, this patcher will sign all your files and ensure none of the
|
print("""By default, this patcher will sign all your files and ensure none of the
|
||||||
contents can be tampered with. However for more advanced users, you may
|
contents can be tampered with. However for more advanced users, you may
|
||||||
want to be able to freely edit the config.plist and files.
|
want to be able to freely edit the config.plist and files.
|
||||||
@@ -164,8 +170,8 @@ Note: For secuirty reasons, OpenShell will be disabled when Vault is set.
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_sip(self):
|
def change_sip(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set SIP and SecureBootModel"])
|
Utilities.header(["Set SIP and SecureBootModel"])
|
||||||
print("""SIP and SecureBootModel are used to ensure proper OTA functionality,
|
print("""SIP and SecureBootModel are used to ensure proper OTA functionality,
|
||||||
however to patch the root volume both of these must be disabled.
|
however to patch the root volume both of these must be disabled.
|
||||||
Only disable is absolutely necessary. SIP value = 0xFEF
|
Only disable is absolutely necessary. SIP value = 0xFEF
|
||||||
@@ -199,8 +205,8 @@ Valid options:
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def change_imac_nvidia(self):
|
def change_imac_nvidia(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Force iMac Nvidia Patches"])
|
Utilities.header(["Force iMac Nvidia Patches"])
|
||||||
print("""Specifically for iMac10,x-12,x with Metal Nvidia GPU upgrades
|
print("""Specifically for iMac10,x-12,x with Metal Nvidia GPU upgrades
|
||||||
By default the patcher will try to detect what hardware is
|
By default the patcher will try to detect what hardware is
|
||||||
running, however this will enforce iMac Nvidia Build Patches.
|
running, however this will enforce iMac Nvidia Build Patches.
|
||||||
@@ -214,8 +220,8 @@ running, however this will enforce iMac Nvidia Build Patches.
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def custom_repo(self):
|
def custom_repo(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set custom patch repo"])
|
Utilities.header(["Set custom patch repo"])
|
||||||
print(f"""For users participating in OpenCore Patcher betas, this is
|
print(f"""For users participating in OpenCore Patcher betas, this is
|
||||||
where you can add custom repos such as Google Drive links.
|
where you can add custom repos such as Google Drive links.
|
||||||
|
|
||||||
@@ -239,8 +245,8 @@ Current repo:
|
|||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def bootstrap_setting(self):
|
def bootstrap_setting(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
utilities.header(["Set Bootstrap method"])
|
Utilities.header(["Set Bootstrap method"])
|
||||||
print("""Sets OpenCore's bootstrap method, currently the patcher supports the
|
print("""Sets OpenCore's bootstrap method, currently the patcher supports the
|
||||||
following options.
|
following options.
|
||||||
|
|
||||||
|
|||||||
@@ -240,8 +240,8 @@ class Constants:
|
|||||||
@property
|
@property
|
||||||
def applehda_path(self): return self.payload_apple_kexts_path / Path("Audio/AppleHDA.kext")
|
def applehda_path(self): return self.payload_apple_kexts_path / Path("Audio/AppleHDA.kext")
|
||||||
|
|
||||||
|
|
||||||
# GPU Kexts and Bundles
|
# GPU Kexts and Bundles
|
||||||
|
|
||||||
@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
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ SupportedSMBIOS12 = [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
## CPU patches
|
# CPU patches
|
||||||
|
|
||||||
MissingSSE42 = [
|
MissingSSE42 = [
|
||||||
"MacBook4,1",
|
"MacBook4,1",
|
||||||
@@ -127,7 +127,7 @@ pciSSDT = [
|
|||||||
"Dortania1,1"
|
"Dortania1,1"
|
||||||
]
|
]
|
||||||
|
|
||||||
## Ethernet patches
|
# Ethernet patches
|
||||||
|
|
||||||
EthernetNvidia = [
|
EthernetNvidia = [
|
||||||
"MacBook5,1",
|
"MacBook5,1",
|
||||||
@@ -170,7 +170,7 @@ EthernetBroadcom = [
|
|||||||
"Dortania1,1"
|
"Dortania1,1"
|
||||||
]
|
]
|
||||||
|
|
||||||
## Wifi patches
|
# Wifi patches
|
||||||
|
|
||||||
WifiAtheros = [
|
WifiAtheros = [
|
||||||
"iMac10,1",
|
"iMac10,1",
|
||||||
@@ -238,7 +238,7 @@ WifiBCM94331 = [
|
|||||||
"Dortania1,1"
|
"Dortania1,1"
|
||||||
]
|
]
|
||||||
|
|
||||||
## Audio
|
# Audio
|
||||||
|
|
||||||
LegacyAudio = [
|
LegacyAudio = [
|
||||||
"MacBook4,1",
|
"MacBook4,1",
|
||||||
@@ -301,7 +301,7 @@ nvidiaHDEF = [
|
|||||||
"iMac10,1"
|
"iMac10,1"
|
||||||
]
|
]
|
||||||
|
|
||||||
## GPU
|
# GPU
|
||||||
|
|
||||||
LegacyGPU = [
|
LegacyGPU = [
|
||||||
"MacBook4,1", # GMA X3100
|
"MacBook4,1", # GMA X3100
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ class PatchSysVolume:
|
|||||||
print("- Enabling NSDefenestratorModeEnabled")
|
print("- Enabling NSDefenestratorModeEnabled")
|
||||||
subprocess.run("defaults write -g NSDefenestratorModeEnabled -bool true".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run("defaults write -g NSDefenestratorModeEnabled -bool true".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
|
|
||||||
def patch_root_vol(self):
|
def patch_root_vol(self):
|
||||||
print(f"- Detecting patches for {self.model}")
|
print(f"- Detecting patches for {self.model}")
|
||||||
rebuild_required = False
|
rebuild_required = False
|
||||||
@@ -282,7 +281,7 @@ class PatchSysVolume:
|
|||||||
self.download_files()
|
self.download_files()
|
||||||
|
|
||||||
def download_files(self):
|
def download_files(self):
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
print("- Downloading Apple binaries")
|
print("- Downloading Apple binaries")
|
||||||
popen_oclp = subprocess.Popen(f"curl -S -L {self.constants.url_apple_binaries} --output {self.constants.payload_apple_root_path_zip}".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
popen_oclp = subprocess.Popen(f"curl -S -L {self.constants.url_apple_binaries} --output {self.constants.payload_apple_root_path_zip}".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
||||||
for stdout_line in iter(popen_oclp.stdout.readline, ""):
|
for stdout_line in iter(popen_oclp.stdout.readline, ""):
|
||||||
@@ -317,7 +316,7 @@ class PatchSysVolume:
|
|||||||
print(f"Cannot run on this OS, requires macOS 11!")
|
print(f"Cannot run on this OS, requires macOS 11!")
|
||||||
else:
|
else:
|
||||||
self.check_status()
|
self.check_status()
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
if (self.sip_patch_status is False) and (self.smb_status is False):
|
if (self.sip_patch_status is False) and (self.smb_status is False):
|
||||||
print("- Detected SIP and SecureBootModel are disabled, continuing")
|
print("- Detected SIP and SecureBootModel are disabled, continuing")
|
||||||
input("\nPress [ENTER] to continue")
|
input("\nPress [ENTER] to continue")
|
||||||
@@ -341,6 +340,7 @@ class PatchSysVolume:
|
|||||||
print("Please disable FileVault in System Preferences")
|
print("Please disable FileVault in System Preferences")
|
||||||
print("")
|
print("")
|
||||||
input("Press [Enter] to go exit.")
|
input("Press [Enter] to go exit.")
|
||||||
|
|
||||||
def start_unpatch(self):
|
def start_unpatch(self):
|
||||||
if self.constants.custom_model is not None:
|
if self.constants.custom_model is not None:
|
||||||
print("Unpatching must be done on target machine!")
|
print("Unpatching must be done on target machine!")
|
||||||
@@ -348,7 +348,7 @@ class PatchSysVolume:
|
|||||||
print(f"Cannot run on this OS, requires macOS 11!")
|
print(f"Cannot run on this OS, requires macOS 11!")
|
||||||
else:
|
else:
|
||||||
self.check_status()
|
self.check_status()
|
||||||
utilities.cls()
|
Utilities.cls()
|
||||||
if (self.sip_patch_status is False) and (self.smb_status is False):
|
if (self.sip_patch_status is False) and (self.smb_status is False):
|
||||||
print("- Detected SIP and SecureBootModel are disabled, continuing")
|
print("- Detected SIP and SecureBootModel are disabled, continuing")
|
||||||
input("\nPress [ENTER] to continue")
|
input("\nPress [ENTER] to continue")
|
||||||
@@ -370,4 +370,3 @@ class PatchSysVolume:
|
|||||||
print("Please disable FileVault in System Preferences")
|
print("Please disable FileVault in System Preferences")
|
||||||
print("")
|
print("")
|
||||||
input("Press [Enter] to go exit.")
|
input("Press [Enter] to go exit.")
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ Main hardware we'd appreciate:
|
|||||||
* Any Mac you own
|
* Any Mac you own
|
||||||
* Does require SSE4,1 CPU to test on Sierra and newer however
|
* Does require SSE4,1 CPU to test on Sierra and newer however
|
||||||
|
|
||||||
|
Additionally, hardware info dumps are greatly beneficial for us to determine what patches a machine might need:
|
||||||
|
|
||||||
|
* [IORegistryExplorer](https://github.com/khronokernel/IORegistryClone/blob/master/ioreg-210.zip?raw=true)
|
||||||
|
* `File -> SaveAs` and open an issue on Github
|
||||||
|
* Note: We want IOReg dumps of hardware not running on OpenCore, instead running a clean, supported OS
|
||||||
|
|
||||||
If you have any legacy hardware you're willing to donate, please contact us at the following email:
|
If you have any legacy hardware you're willing to donate, please contact us at the following email:
|
||||||
|
|
||||||
* khronokernel@icloud.com
|
* khronokernel@icloud.com
|
||||||
|
|||||||
Reference in New Issue
Block a user