Clean up code

This commit is contained in:
Mykola Grymalyuk
2021-06-08 10:07:30 -06:00
parent 93aa69b0b0
commit 9d731c065e
4 changed files with 34 additions and 73 deletions

View File

@@ -5,6 +5,7 @@
- Add NVMe firmware support for older models (ie. MacPro3,1)
- OpenCore must be stored on a bootable volume (ie. USB or SATA)
- Fix Thunderbolt Ethernet support on MacBookAir4,x
- Add beta macOS Monterey Support
## 0.1.6
- Add XHCI UEFI Driver for 3rd Party USB 3.0 Controllers

View File

@@ -93,8 +93,6 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
]
menu = Utilities.TUIMenu(title, "Please select an option: ", auto_number=True, top_level=True)
options = [
# 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"Enable Verbose Mode:\t\tCurrently {self.constants.verbose_debug}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_verbose],
[f"Enable OpenCore DEBUG:\t\tCurrently {self.constants.opencore_debug}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_oc],
[f"Enable Kext DEBUG:\t\t\tCurrently {self.constants.kext_debug}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_kext],
@@ -126,7 +124,6 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
[f"DRM Preferences:\t\t\tCurrently {self.constants.drm_support}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).drm_setting],
[f"Set Generic Bootstrap:\t\tCurrently {self.constants.boot_efi}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).bootstrap_setting],
[f"Assume Legacy GPU:\t\t\tCurrently {self.constants.assume_legacy}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).force_accel_setting],
#[f"Download more RAM:\t\t\tCurrently {self.constants.download_ram}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).download_more_ram_dot_com],
[f"Disable CPU Friend:\t\t\tCurrently {self.constants.disallow_cpufriend}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).disable_cpufriend],
[f"Override SMBIOS Spoof:\t\tCurrently {self.constants.override_smbios}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).set_smbios],
[f"Set Custom name {self.constants.custom_cpu_model_value}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).custom_cpu],

View File

@@ -36,77 +36,41 @@ class BuildOpenCore:
self.constants: Constants.Constants = versions
def smbios_set(self):
if self.constants.os_patch_type == self.constants.monterey:
print("- Setting macOS Monterey Supported SMBIOS")
if self.model in ModelArray.MacBookAir61:
print("- Spoofing to MacBookAir7,1")
return "MacBookAir7,1"
elif self.model in ModelArray.MacBookAir62:
print("- Spoofing to MacBookAir7,2")
return "MacBookAir7,2"
elif self.model in ModelArray.MacBookPro111:
print("- Spoofing to MacBookPro12,1")
return "MacBookPro12,1"
elif self.model in ModelArray.MacBookPro113:
print("- Spoofing to MacBookPro11,5")
return "MacBookPro11,5"
elif self.model in ModelArray.Macmini71:
print("- Spoofing to Macmini7,1")
return "Macmini7,1"
elif self.model in ModelArray.iMacPro11:
print("- Setting macOS Monterey Supported SMBIOS")
if self.model in ModelArray.MacBookAir61:
print("- Spoofing to MacBookAir7,1")
return "MacBookAir7,1"
elif self.model in ModelArray.MacBookAir62:
print("- Spoofing to MacBookAir7,2")
return "MacBookAir7,2"
elif self.model in ModelArray.MacBookPro111:
print("- Spoofing to MacBookPro12,1")
return "MacBookPro12,1"
elif self.model in ModelArray.MacBookPro113:
print("- Spoofing to MacBookPro11,5")
return "MacBookPro11,5"
elif self.model in ModelArray.Macmini71:
print("- Spoofing to Macmini7,1")
return "Macmini7,1"
elif self.model in ModelArray.iMacPro11:
print("- Spoofing to iMacPro1,1")
return "iMacPro1,1"
elif self.model in ModelArray.iMac151:
# Check for upgraded GPUs on iMacs
if self.constants.drm_support is True:
print("- Spoofing to iMacPro1,1")
return "iMacPro1,1"
elif self.model in ModelArray.iMac151:
# Check for upgraded GPUs on iMacs
if self.constants.drm_support is True:
print("- Spoofing to iMacPro1,1")
return "iMacPro1,1"
else:
print("- Spoofing to iMac17,1")
return "iMac17,1"
elif self.model in ModelArray.iMac144:
print("- Spoofing to iMac16,1")
return "iMac16,1"
elif self.model in ModelArray.MacPro71:
print("- Spoofing to MacPro7,1")
return "MacPro7,1"
else:
return self.model
print("- Spoofing to iMac17,1")
return "iMac17,1"
elif self.model in ModelArray.iMac144:
print("- Spoofing to iMac16,1")
return "iMac16,1"
elif self.model in ModelArray.MacPro71:
print("- Spoofing to MacPro7,1")
return "MacPro7,1"
else:
if self.model in ModelArray.MacBookAir61:
print("- Spoofing to MacBookAir6,1")
return "MacBookAir6,1"
elif self.model in ModelArray.MacBookAir62:
print("- Spoofing to MacBookAir6,2")
return "MacBookAir6,2"
elif self.model in ModelArray.MacBookPro111:
print("- Spoofing to MacBookPro11,1")
return "MacBookPro11,1"
elif self.model in ModelArray.MacBookPro113:
print("- Spoofing to MacBookPro11,3")
return "MacBookPro11,3"
elif self.model in ModelArray.Macmini71:
print("- Spoofing to Macmini7,1")
return "Macmini7,1"
elif self.model in ModelArray.iMacPro11:
print("- Spoofing to iMacPro1,1")
return "iMacPro1,1"
elif self.model in ModelArray.iMac151:
# Check for upgraded GPUs on iMacs
if self.constants.drm_support is True:
print("- Spoofing to iMacPro1,1")
return "iMacPro1,1"
else:
print("- Spoofing to iMac15,1")
return "iMac15,1"
elif self.model in ModelArray.iMac144:
print("- Spoofing to iMac14,4")
return "iMac14,4"
elif self.model in ModelArray.MacPro71:
print("- Spoofing to MacPro7,1")
return "MacPro7,1"
else:
return self.model
return self.model
def fw_feature_detect(self, model):
# Values based off OpenCorePkg's Firmwarefeatures and FirmwarefeaturesMask

View File

@@ -56,9 +56,9 @@ class Constants:
self.opencore_build = "RELEASE"
self.kext_debug = False
self.verbose_debug = False
self.os_support = 11.0
self.os_support = 12.0
self.min_os_support = 11.0
self.max_os_support = 11.0
self.max_os_support = 12.0
self.metal_build = False
self.imac_vendor = "None"
self.wifi_build = False
@@ -84,7 +84,6 @@ class Constants:
self.apecid_support = False
self.firewire_boot = False
self.nvme_boot = False
self.os_patch_type = 21
# OS Versions
self.tiger = 8