From a5998cb2268ee5f467612b826434663548d53267 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Sat, 24 Apr 2021 10:35:22 -0600 Subject: [PATCH] Sync changelog --- CHANGELOG.md | 1 + OCLP-CLI.command | 26 ++++++++++++++++++++------ Resources/Build.py | 3 ++- docs/CLI.md | 3 --- docs/TESTED.md | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16da131f4..0595df5ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Fix TeraScale 1 GPU detection - Enable Graphics Acceleration on legacy GPUs by default - Automatically disable AMD TeraScale 2 GPUs in MacBook Pros +- Fix incorrectly disabling SIP/SMB on Metal GPUs ## 0.1.0 - Fix crash on iMacs with Metal GPUs diff --git a/OCLP-CLI.command b/OCLP-CLI.command index a5e73d135..bee79dc98 100755 --- a/OCLP-CLI.command +++ b/OCLP-CLI.command @@ -3,6 +3,8 @@ from __future__ import print_function +import binascii +import plistlib import subprocess import sys import time @@ -28,8 +30,18 @@ class OpenCoreLegacyPatcher(): if self.current_model in ModelArray.NoAPFSsupport: self.constants.serial_settings = "Moderate" if self.current_model in ModelArray.LegacyGPU: - Build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).check_pciid(False) - if not (self.constants.dgpu_vendor == self.constants.pci_amd_ati and self.constants.dgpu_device in ModelArray.AMDMXMGPUs) or not (self.constants.dgpu_vendor == self.constants.pci_nvidia and self.constants.dgpu_device in ModelArray.NVIDIAMXMGPUs): + try: + dgpu_devices = plistlib.loads(subprocess.run("ioreg -r -n GFX0 -a".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()) + dgpu_vendor = self.hexswap(binascii.hexlify(dgpu_devices[0]["vendor-id"]).decode()[:4]) + dgpu_device = self.hexswap(binascii.hexlify(dgpu_devices[0]["device-id"]).decode()[:4]) + except ValueError: + dgpu_vendor = "" + dgpu_device = "" + + if (dgpu_vendor == self.constants.pci_amd_ati and dgpu_device in ModelArray.AMDMXMGPUs) or (dgpu_vendor == self.constants.pci_nvidia and dgpu_device in ModelArray.NVIDIAMXMGPUs): + self.constants.sip_status = True + self.constants.secure_status = True + else: self.constants.sip_status = False self.constants.secure_status = False @@ -68,7 +80,6 @@ class OpenCoreLegacyPatcher(): # 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('--custom_repo', action='store', help='Set SMBIOS patching mode', required=False) args = parser.parse_args() @@ -139,14 +150,17 @@ class OpenCoreLegacyPatcher(): self.build_opencore() if args.patch_sys_vol: print("- Set System Volume patching") - if args.custom_repo: - self.constants.url_apple_binaries = args.custom_repo - print(f"- Custom set repo to: {self.constants.url_apple_binaries}") self.patch_vol() elif args.unpatch_sys_vol: print("- Set System Volume unpatching") self.unpatch_vol() + def hexswap(self, input_hex: str): + hex_pairs = [input_hex[i:i + 2] for i in range(0, len(input_hex), 2)] + hex_rev = hex_pairs[::-1] + hex_str = "".join(["".join(x) for x in hex_rev]) + return hex_str.upper() + def patch_vol(self): SysPatch.PatchSysVolume(self.constants.custom_model or self.current_model, self.constants).start_patch() diff --git a/Resources/Build.py b/Resources/Build.py index e672b3a1c..43057e62f 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -70,6 +70,7 @@ class BuildOpenCore: def build_efi(self): Utilities.cls() + print(f"Building Configuration for model: {self.model}") if not Path(self.constants.build_path).exists(): Path(self.constants.build_path).mkdir() print("Created build folder") @@ -585,7 +586,7 @@ class BuildOpenCore: self.cleanup() self.sign_files() print("") - print("Your OpenCore EFI has been built at:") + print(f"Your OpenCore EFI for {self.model} has been built at:") print(f" {self.constants.opencore_release_folder}") print("") if self.constants.gui_mode is False: diff --git a/docs/CLI.md b/docs/CLI.md index a24249cda..beacc3690 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -31,9 +31,6 @@ Note, when building OpenCore the output folder will be next to the OCLP binary a ### Patch System Arguments * **--patch_sys_vol**: patches root volume with detected hardware - * **--custom_repo xxxx**: Sets custom repo for volume patches, defaults to Apple-Binaries-OCLP when no arg provided - * ex. **--custom_repo https://github.com/dortania/Apple-Binaries-OCLP/archive/refs/heads/main.zip** - Example usage: diff --git a/docs/TESTED.md b/docs/TESTED.md index 51a9dadd9..92faa4717 100644 --- a/docs/TESTED.md +++ b/docs/TESTED.md @@ -111,7 +111,7 @@ To aid users in troubleshooting, we've compiled a list of users who've reported | ^^ | ^^ | AlexSakha67 | - Upgraded R9 280
- Patcher version 0.0.20 | | ^^ | ^^ | nekton1 | - Upgraded GTX 680
- Patcher version 0.0.20 | | ^^ | ^^ | Pri-est | - Patcher version 0.0.9 | -| ^^ | ^^ | vinaypundith | - Patcher version 0.0.6 | +| ^^ | ^^ | vinaypundith | - Upgraded GTX 680
- Upgraded BCM94360CD
- Patcher version 0.0.6 | | MacPro4,1 | ^^ | ^^ | - Patcher version 0.0.9 | | MacPro5,1 | ^^ | woefi | - Upgraded with RX 580
- Patcher version 0.0.21 | | ^^ | ^^ | Mabrouk Oscar | - Patcher version 0.0.21 |