mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 22:20:53 +10:00
Adjust for GUI
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
- Fix more IORegistry issues
|
- Fix more IORegistry issues
|
||||||
- Implement OpenCore GUI
|
- Implement OpenCore GUI
|
||||||
- Ensure symlinks are preserved
|
- 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
|
- Fix NightShift support for macOS Monterey
|
||||||
- Add UniversalControl support
|
- Add UniversalControl support
|
||||||
- Currently not enabled by Apple in macOS Monterey Beta 2/iOS 15 Beta 2
|
- Currently not enabled by Apple in macOS Monterey Beta 2/iOS 15 Beta 2
|
||||||
|
|||||||
+6
-12
@@ -52,13 +52,14 @@ class OpenCoreLegacyPatcher:
|
|||||||
|
|
||||||
# Building args requiring value values
|
# Building args requiring value values
|
||||||
parser.add_argument("--model", action="store", help="Set custom model", required=False)
|
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)
|
parser.add_argument("--smbios_spoof", action="store", help="Set SMBIOS patching mode", required=False)
|
||||||
|
|
||||||
# SysPatch args
|
# SysPatch args
|
||||||
parser.add_argument("--patch_sys_vol", help="Patches root volume", action="store_true", required=False)
|
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("--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("--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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -72,8 +73,11 @@ class OpenCoreLegacyPatcher:
|
|||||||
print("- Using default payloads location")
|
print("- Using default payloads location")
|
||||||
|
|
||||||
if args.disk:
|
if args.disk:
|
||||||
print(f"- Disk set: {args.disk}")
|
print(f"- Install Disk set: {args.disk}")
|
||||||
self.constants.disk = 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:
|
if args.verbose:
|
||||||
print("- Set verbose configuration")
|
print("- Set verbose configuration")
|
||||||
self.constants.verbose_debug = True
|
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:
|
if model == "MacBook8,1" and host_is_target:
|
||||||
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
|
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
|
||||||
self.constants.serial_settings == "Moderate"
|
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):
|
def patch_vol(self):
|
||||||
SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch()
|
SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch()
|
||||||
|
|||||||
@@ -71,16 +71,6 @@ class OpenCoreLegacyPatcher:
|
|||||||
if model == "MacBook8,1":
|
if model == "MacBook8,1":
|
||||||
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
|
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
|
||||||
self.constants.serial_settings == "Moderate"
|
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):
|
def build_opencore(self):
|
||||||
Build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
|
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"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 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"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"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}",
|
f"Set SIP and SecureBootModel:\tSIP: {self.constants.sip_status} SBM: {self.constants.secure_status}",
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class Constants:
|
|||||||
self.innie_version = "1.3.0"
|
self.innie_version = "1.3.0"
|
||||||
self.fw_kext = "1.0.0"
|
self.fw_kext = "1.0.0"
|
||||||
self.disk = ""
|
self.disk = ""
|
||||||
|
self.patch_disk = ""
|
||||||
self.patcher_support_pkg_version = "0.0.11" # PatcherSupportPkg
|
self.patcher_support_pkg_version = "0.0.11" # PatcherSupportPkg
|
||||||
|
|
||||||
# Get resource path
|
# Get resource path
|
||||||
@@ -302,7 +303,7 @@ class Constants:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def opencore_release_folder(self):
|
def opencore_release_folder(self):
|
||||||
return self.build_path / Path(f"OpenCore-{self.opencore_build}")
|
return self.build_path / Path(f"OpenCore-Build")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def opencore_zip_copied(self):
|
def opencore_zip_copied(self):
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ class PatchSysVolume:
|
|||||||
# TODO: Enable TS2 support
|
# TODO: Enable TS2 support
|
||||||
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_2:
|
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_2:
|
||||||
# Requires manual permission from user to avoid medical issues
|
# 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.amd_ts2 = True
|
||||||
self.amfi_must_disable = True
|
self.amfi_must_disable = True
|
||||||
if igpu and igpu.class_code != 0xFFFFFF:
|
if igpu and igpu.class_code != 0xFFFFFF:
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -46,6 +46,7 @@ bad_tools = [
|
|||||||
"ResetSystem.efi",
|
"ResetSystem.efi",
|
||||||
"RtcRw.efi",
|
"RtcRw.efi",
|
||||||
"CsrUtil.efi",
|
"CsrUtil.efi",
|
||||||
|
"TpmInfo.efi",
|
||||||
]
|
]
|
||||||
|
|
||||||
for version in build_types:
|
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()
|
subprocess.run(f"rm ./OpenCore-{version}/EFI/OC/Tools/{delete_tools}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
else:
|
else:
|
||||||
print(f"- Unable to find {delete_tools}, skipping")
|
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()
|
||||||
Reference in New Issue
Block a user