Adjust for GUI

This commit is contained in:
Mykola Grymalyuk
2021-07-05 10:09:50 -06:00
parent a1981ab56d
commit 9e98121e45
8 changed files with 15 additions and 34 deletions

View File

@@ -5,7 +5,7 @@
- Fix more IORegistry issues
- Implement OpenCore GUI
- Ensure symlinks are preserved
- Enable TeraScale 2 patches by default on desktops
- Enable TeraScale 2 patches by default on all models
- Fix NightShift support for macOS Monterey
- Add UniversalControl support
- Currently not enabled by Apple in macOS Monterey Beta 2/iOS 15 Beta 2

View File

@@ -52,13 +52,14 @@ class OpenCoreLegacyPatcher:
# Building args requiring value values
parser.add_argument("--model", action="store", help="Set custom model", required=False)
parser.add_argument("--disk", action="store", help="Specifies disk to patch", required=False)
parser.add_argument("--disk", action="store", help="Specifies disk to install to", required=False)
parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False)
# SysPatch args
parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False)
parser.add_argument("--unpatch_sys_vol", help="Unpatches root volume, EXPERIMENTAL", action="store_true", required=False)
parser.add_argument("--terascale_2", help="Enable TeraScale 2 Acceleration", action="store_true", required=False)
#parser.add_argument("--patch_disk", action="store", help="Specifies disk to root patch", required=False)
args = parser.parse_args()
@@ -72,8 +73,11 @@ class OpenCoreLegacyPatcher:
print("- Using default payloads location")
if args.disk:
print(f"- Disk set: {args.disk}")
print(f"- Install Disk set: {args.disk}")
self.constants.disk = args.disk
if args.patch_disk:
print(f"- Patch Disk set: {args.patch_disk}")
self.constants.patch_disk = args.patch_disk
if args.verbose:
print("- Set verbose configuration")
self.constants.verbose_debug = True
@@ -185,16 +189,6 @@ If you plan to create the USB for another machine, please select the "Change Mod
if model == "MacBook8,1" and host_is_target:
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
self.constants.serial_settings == "Moderate"
if ((
host_is_target
and model not in ["MacBookPro8,2", "MacBookPro8,3"]
and self.computer.dgpu
and self.computer.dgpu.arch == device_probe.AMD.Archs.TeraScale_2)
or model in ["Macmini5,2", "iMac12,1", "iMac12,2"]
):
self.constants.terascale_2_patch = True
else:
self.constants.terascale_2_patch = False
def patch_vol(self):
SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch()

View File

@@ -71,16 +71,6 @@ class OpenCoreLegacyPatcher:
if model == "MacBook8,1":
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
self.constants.serial_settings == "Moderate"
if ((
host_is_target
and model not in ["MacBookPro8,2", "MacBookPro8,3"]
and self.computer.dgpu
and self.computer.dgpu.arch == device_probe.AMD.Archs.TeraScale_2)
or model in ["Macmini5,2", "iMac12,1", "iMac12,2"]
):
self.constants.terascale_2_patch = True
else:
self.constants.terascale_2_patch = False
def build_opencore(self):
Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
@@ -125,10 +115,6 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
[f"Set Vault Mode:\t\t\tCurrently {self.constants.vault}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_vault],
[f"Allow FireWire Boot:\t\tCurrently {self.constants.firewire_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_firewire],
[f"Allow NVMe Boot:\t\t\tCurrently {self.constants.nvme_boot}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).allow_nvme],
[
f"Enable TeraScale 2 Acceleration:\tCurrently {self.constants.terascale_2_patch}",
CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).enable_terascale,
],
[f"Disable AMFI:\t\t\tCurrently {self.constants.disable_amfi}", CliMenu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).set_amfi],
[
f"Set SIP and SecureBootModel:\tSIP: {self.constants.sip_status} SBM: {self.constants.secure_status}",

View File

@@ -43,6 +43,7 @@ class Constants:
self.innie_version = "1.3.0"
self.fw_kext = "1.0.0"
self.disk = ""
self.patch_disk = ""
self.patcher_support_pkg_version = "0.0.11" # PatcherSupportPkg
# Get resource path
@@ -302,7 +303,7 @@ class Constants:
@property
def opencore_release_folder(self):
return self.build_path / Path(f"OpenCore-{self.opencore_build}")
return self.build_path / Path(f"OpenCore-Build")
@property
def opencore_zip_copied(self):

View File

@@ -379,7 +379,7 @@ class PatchSysVolume:
# TODO: Enable TS2 support
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_2:
# Requires manual permission from user to avoid medical issues
if self.constants.detected_os > self.constants.catalina and self.constants.terascale_2_patch is True:
if self.constants.detected_os > self.constants.catalina:
self.amd_ts2 = True
self.amfi_must_disable = True
if igpu and igpu.class_code != 0xFFFFFF:

Binary file not shown.

View File

@@ -46,6 +46,7 @@ bad_tools = [
"ResetSystem.efi",
"RtcRw.efi",
"CsrUtil.efi",
"TpmInfo.efi",
]
for version in build_types:
@@ -67,9 +68,8 @@ for version in build_types:
subprocess.run(f"rm ./OpenCore-{version}/EFI/OC/Tools/{delete_tools}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
else:
print(f"- Unable to find {delete_tools}, skipping")
print("Renaming folder to OpenCore-Build and zipping")
subprocess.run(f"mv ./OpenCore-{version} ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(f"zip -r ./OpenCore-{version}.zip ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
subprocess.run(f"rm -rf ./OpenCore-Build".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()