diff --git a/payloads/OpenCore/clean.py b/payloads/OpenCore/clean.py index 4eb307e19..1f0fb80a5 100755 --- a/payloads/OpenCore/clean.py +++ b/payloads/OpenCore/clean.py @@ -9,7 +9,6 @@ # - Zip folders # TODO: # - Download latest builds from dortania.github.io -from __future__ import print_function import subprocess from pathlib import Path diff --git a/resources/build.py b/resources/build.py index 3eab32745..36370d971 100644 --- a/resources/build.py +++ b/resources/build.py @@ -1,6 +1,5 @@ # Commands for building the EFI and SMBIOS # Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk -from __future__ import print_function import binascii import copy @@ -1003,6 +1002,11 @@ class BuildOpenCore: # Ensure this is done at the end so all previous RestrictEvents patches are applied # RestrictEvents and EFICheckDisabler will confilict if both are injected self.enable_kext("EFICheckDisabler.kext", self.constants.restrictevents_version, self.constants.efi_disabler_path) + if self.constants.set_vmm_cpuid is True: + # Should be unneeded with our sysctl VMM patch, however for reference purposes we'll leave it here + # Ref: https://forums.macrumors.com/threads/opencore-on-the-mac-pro.2207814/ + self.config["Kernel"]["Emulate"]["Cpuid1Data"] = binascii.unhexlify("00000000000000000000008000000000") + self.config["Kernel"]["Emulate"]["Cpuid1Mask"] = binascii.unhexlify("00000000000000000000008000000000") def set_smbios(self): spoofed_model = self.model diff --git a/resources/cli_menu.py b/resources/cli_menu.py index 88024251b..6885fce5a 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -1,7 +1,6 @@ # Handle misc CLI menu options # Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk import sys -import subprocess from resources import constants, install, utilities, defaults, sys_patch, installer, tui_helpers, global_settings from data import cpu_data, smbios_data, model_array, os_data, mirror_data diff --git a/resources/constants.py b/resources/constants.py index f8b217135..4060d1b82 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -2,8 +2,6 @@ # Define Files # Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk -from __future__ import print_function - from pathlib import Path from typing import Optional @@ -194,6 +192,7 @@ class Constants: self.needs_to_open_preferences = False # Determine if preferences need to be opened self.host_is_hackintosh = False # Determine if host is Hackintosh self.commit_info = (None, None, None) + self.set_vmm_cpuid = False # Set VMM bit inside CPUID self.legacy_accel_support = [ os_data.os_data.big_sur, diff --git a/resources/device_probe.py b/resources/device_probe.py index 7ec42dd7c..b7f443374 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -1,8 +1,6 @@ # Hardware probing # Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk -from __future__ import annotations - import binascii import enum import itertools diff --git a/resources/ioreg.py b/resources/ioreg.py index d378d145d..fbdc42093 100644 --- a/resources/ioreg.py +++ b/resources/ioreg.py @@ -1,8 +1,6 @@ # PyObjc Handling for IOKit # Copyright (C) 2020-2022, Dhinak G -from __future__ import annotations - from typing import NewType, Union import objc diff --git a/resources/main.py b/resources/main.py index 8ffe8512c..7020ebb6a 100644 --- a/resources/main.py +++ b/resources/main.py @@ -1,7 +1,5 @@ # Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk -from __future__ import print_function - import subprocess import sys from pathlib import Path diff --git a/resources/sys_patch.py b/resources/sys_patch.py index ea3650096..8bf2194c9 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -8,11 +8,15 @@ # We perform our required edits, then create a new snapshot for the system boot # The manual process is as follows: -# 1. Mount the APFS volume as a read/write volume +# 1. Find the Root Volume +# 'diskutil info / | grep "Device Node:"' +# 2. Convert Snapshot Device Node to Root Volume Device Node +# /dev/disk3s1s1 -> /dev/disk3s1 (strip last 's1') +# 3. Mount the APFS volume as a read/write volume # 'sudo mount -o nobrowse -t apfs /dev/disk5s5 /System/Volumes/Update/mnt1' -# 2. Perform edits to the system (ie. create new KernelCollection) +# 4. Perform edits to the system (ie. create new KernelCollection) # 'sudo kmutil install --volume-root /System/Volumes/Update/mnt1/ --update-all' -# 3. Create a new snapshot for the system boot +# 5. Create a new snapshot for the system boot # 'sudo bless --folder /System/Volumes/Update/mnt1/System/Library/CoreServices --bootefi --create-snapshot' # Additionally Apple's APFS snapshot system supports system rollbacks: diff --git a/resources/sys_patch_download.py b/resources/sys_patch_download.py index b0bdf753e..91f0b7fa0 100644 --- a/resources/sys_patch_download.py +++ b/resources/sys_patch_download.py @@ -1,7 +1,6 @@ # Download PatcherSupportPkg for usage with Root Patching # Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk -from data import os_data from resources import utilities from pathlib import Path import shutil diff --git a/resources/updates.py b/resources/updates.py index 17158593b..382ad052e 100644 --- a/resources/updates.py +++ b/resources/updates.py @@ -3,7 +3,6 @@ # Call check_binary_updates() to determine if any updates are available # Returns dict with Link and Version of the latest binary update if available import requests -from pathlib import Path class check_binary_updates: diff --git a/resources/utilities.py b/resources/utilities.py index 70aef85e4..f81a73a76 100644 --- a/resources/utilities.py +++ b/resources/utilities.py @@ -1,5 +1,4 @@ # Copyright (C) 2020-2022, Dhinak G, Mykola Grymaluk -from __future__ import print_function import hashlib import math