Compare commits

...

97 Commits
0.6.2 ... 0.6.5

Author SHA1 Message Date
Mykola Grymalyuk
3040c621a7 Sync PatcherSupportPkg 2023-05-03 19:43:26 -06:00
Mykola Grymalyuk
2f49a36ccc macos_installer_handler.py: Fix default OS 2023-05-03 15:40:32 -06:00
Mykola Grymalyuk
d551df34ed sys_patch_auto.py: Add RSR work around 2023-05-03 15:39:16 -06:00
Mykola Grymalyuk
2fadae2e3d utilities.py: Add Preboot UUID parsing 2023-05-03 14:51:59 -06:00
Mykola Grymalyuk
2e3ae755ea gui_main.py: Fix spacing 2023-05-03 14:51:27 -06:00
Mykola Grymalyuk
067206b536 macos_installer_handler.py: Add wider OS support for SUCatalog parsing
Preperationg for macOS 14 SUCatalog
2023-05-03 14:47:43 -06:00
Mykola Grymalyuk
96b126588d macos_installer_handler.py: Export min_required as int 2023-04-28 14:52:52 -06:00
Mykola Grymalyuk
a70039abb5 os_data.py: Add docstring 2023-04-28 14:51:09 -06:00
Mykola Grymalyuk
6fca3339fc macos_installer_handler.py: Add min OS check
Ventura’s installer requires an El Cap host to run
2023-04-28 14:50:59 -06:00
Mykola Grymalyuk
c668ac0004 gui_main.py: Fix smbios_data parsing 2023-04-27 07:28:36 -06:00
Mykola Grymalyuk
88d6fc29f0 Sync CHANGELOG 2023-04-25 15:48:29 -06:00
Mykola Grymalyuk
e556b0227a Merge pull request #1061 from dortania/ci-upgrade
CI Upgrade: Convert to Monterey host
2023-04-25 15:46:12 -06:00
Mykola Grymalyuk
d7b8f91223 CI: Switch to upgraded server 2023-04-25 15:31:19 -06:00
Mykola Grymalyuk
f2cddcae7c CI: Don’t hold for submission status 2023-04-22 17:40:24 -06:00
Mykola Grymalyuk
c9304bdbba CI: Add Team ID argument 2023-04-22 17:05:04 -06:00
Mykola Grymalyuk
117e7fa6ff CI: Comment out cert handling
Action can only be used once on self-hosted runners
2023-04-22 16:40:43 -06:00
Mykola Grymalyuk
6bec4ca2d2 CI: Switch to notarytool 2023-04-22 16:34:30 -06:00
Mykola Grymalyuk
1b8dcd1c1b CI: adjust formatting 2023-04-22 16:27:10 -06:00
Mykola Grymalyuk
f2f81f5239 CI: Import cert 2023-04-22 16:09:41 -06:00
Mykola Grymalyuk
7d7c94cd91 Spin up test runner 2023-04-22 08:17:57 -06:00
Dhinak G
dde6a3d805 Merge pull request #1058 from TechEnthusiasm/main 2023-04-20 17:39:36 -04:00
TechEnthusiasm
71dbb512a6 Update UPDATE.md 2023-04-20 15:36:13 +01:00
Mykola Grymalyuk
b7ddeb3b50 Merge pull request #1057 from IronApple0915/main
IronApple's doc updates to PATCHEXPLAIN.md
2023-04-19 20:19:04 -06:00
Alex
175cb3d3f4 Update PATCHEXPLAIN.md 2023-04-19 21:41:36 -04:00
neon ball
73508835c8 Fix typo second try 2023-04-20 03:26:45 +03:00
neon ball
336c6b43fb Fix typo 2023-04-20 03:26:15 +03:00
Alex
bfed55318c Update PATCHEXPLAIN.md 2023-04-19 19:51:36 -04:00
Alex
a3e80a6378 Update PATCHEXPLAIN.md 2023-04-19 19:46:39 -04:00
Alex
92b78a893d Update PATCHEXPLAIN.md 2023-04-19 19:45:33 -04:00
Alex
758fdb9854 Update PATCHEXPLAIN.md 2023-04-19 19:16:41 -04:00
educovas
44f8f64935 Merge pull request #1056 from educovas/main
Fix non-Metal Safari 16.4 canvas rendering
2023-04-18 19:51:14 -03:00
educovas
8f0a74df6b Fix non-Metal Safari 16.4 canvas rendering 2023-04-18 19:37:53 -03:00
Mykola Grymalyuk
0efe4c4365 Merge pull request #1055 from Jazzzny/enable-xhci
Enhancement - Enable USB 3 expansion card support on Legacy USB 1.1 machines
2023-04-18 15:26:03 -06:00
Jazzzny
04337059e4 Remove commented code 2023-04-18 17:24:45 -04:00
Jazzzny
af0663317b Enable USB 3 support on USB 1.1 machines 2023-04-18 16:39:27 -04:00
Mykola Grymalyuk
e4d0e471d9 sys_patch_dict.py: Treat mid cycle as float
Adds more legibility to patchset
2023-04-18 09:23:46 -06:00
Mykola Grymalyuk
cb45138c5f Sync changelog 2023-04-17 18:37:19 -06:00
Mykola Grymalyuk
917631181a Merge pull request #1053 from Jazzzny/webdriver-opencl
Enhancement - Enable OpenCL on NVIDIA WebDriver cards
2023-04-17 18:28:59 -06:00
Jazzzny
9ac58e605d Fix interpretation 2023-04-17 19:41:52 -04:00
Jazzzny
6d21b1a8fe Clarify 2023-04-17 18:37:44 -04:00
Jazzzny
ae7fa3bbb9 Add OpenCL support for WebDriver cards 2023-04-17 18:37:44 -04:00
Dhinak G
2895136eab Merge pull request #1052 from sladwig/patch-1 2023-04-17 16:17:07 -04:00
Mykola Grymalyuk
7b83c8d2cc Sync PatcherSupportPkg 2023-04-17 10:37:36 -06:00
Mykola Grymalyuk
43cc83edf4 Increment build 2023-04-16 19:36:44 -06:00
Stefan Ladwig
a33af67494 docs: fix typo 2023-04-16 09:50:32 +02:00
Mykola Grymalyuk
eec8f3e797 Resolve F16C reporting errors 2023-04-13 11:16:53 -06:00
Mykola Grymalyuk
5011b2c3f1 Avoid 3.10 type hinting 2023-04-13 07:54:44 -06:00
Mykola Grymalyuk
980142c6ad Merge branch 'main' of https://github.com/dortania/OpenCore-Legacy-Patcher 2023-04-13 07:25:54 -06:00
Mykola Grymalyuk
1fe710f4a3 device_probe.py: Extra error handling 2023-04-13 07:25:45 -06:00
Mykola Grymalyuk
472c494fd4 Merge pull request #1047 from dortania/post-analytics
Implement back-end for Crash and Analytics Reporting
2023-04-12 16:43:27 -06:00
Mykola Grymalyuk
ccbb5dafe5 Add PRIVACY.md 2023-04-12 16:31:04 -06:00
Mykola Grymalyuk
939d3a36a4 Adjust wording 2023-04-11 19:58:25 -06:00
Mykola Grymalyuk
4c19f51a04 Analytics: allow opt-out 2023-04-11 19:08:52 -06:00
Mykola Grymalyuk
b34eaccd35 main.py: move threading 2023-04-11 13:54:45 -06:00
Mykola Grymalyuk
52211def51 Test build of analytics 2023-04-11 13:28:33 -06:00
Mykola Grymalyuk
62f619da99 network_handler.py: Add post wrapping 2023-04-11 08:42:21 -06:00
Mykola Grymalyuk
2496fa9245 Increment build 2023-04-11 08:40:19 -06:00
Mykola Grymalyuk
7a07a16be8 defaults.py Don’t set new menubar as default 2023-04-10 21:50:28 -06:00
Mykola Grymalyuk
2e4517a3c0 sys_patch_helpers.py: Fix src pathing 2023-04-07 13:33:02 -06:00
Mykola Grymalyuk
1ce6f79240 sys_patch_helpers.py: Add Metal libary patching
Resolves many 3rd party apps crashing on 13.3 when trying to invoke Metal directly
2023-04-07 12:59:18 -06:00
Mykola Grymalyuk
96e96464f2 sys_patch.py: Add docstrings and typing suggestions 2023-04-07 12:57:05 -06:00
Mykola Grymalyuk
fcd0c7cd21 build: Add additional Navi patches 2023-04-06 11:58:35 -06:00
Mykola Grymalyuk
a93fbf7122 misc.py: Rework RE arg handling 2023-04-03 14:57:59 -06:00
Mykola Grymalyuk
c0825ed24e misc.py: Set f16c argument 2023-04-03 13:51:00 -06:00
Mykola Grymalyuk
0f95d6a1bb defaults.py: Don’t grab RE’s CPU name 2023-04-03 13:48:16 -06:00
Mykola Grymalyuk
9439c39437 Sync binaries 2023-04-03 11:06:13 -06:00
Mykola Grymalyuk
38025d7f2a Remove unneeded init.py 2023-04-03 10:48:24 -06:00
Mykola Grymalyuk
23f2291bfa integrity_verification.py: rework into OOP 2023-04-02 11:39:55 -06:00
Mykola Grymalyuk
b0c05b914b sys_patch: Modularize patch set generation
Move generate_patchset() to dedicated module
2023-04-02 10:22:27 -06:00
Mykola Grymalyuk
b83cd8191b network_handler.py: Implement get() wrapper 2023-03-31 21:22:13 -06:00
Mykola Grymalyuk
8512aad33d Merge pull request #1043 from dortania/rework-build-libary
build module: Enhance readability
2023-03-31 20:53:52 -06:00
Mykola Grymalyuk
c04c313b2c misc.py: Removed unneeded rmtree invocation 2023-03-30 12:10:34 -06:00
Mykola Grymalyuk
841bcb72c3 build: Add docstrings for classes 2023-03-30 11:46:44 -06:00
Mykola Grymalyuk
6aba47bcfb Resolve Docs building 2023-03-30 11:24:08 -06:00
Mykola Grymalyuk
81495ee192 Merge pull request #1030 from ThatStella7922/main
README grammar and wording tweaks, add hw donation
2023-03-30 08:01:56 -06:00
Mykola Grymalyuk
1bf3e0e2a4 Merge branch 'main' into rework-build-libary 2023-03-29 15:46:47 -06:00
Mykola Grymalyuk
bb6ef48e95 misc.py: Fix CPUFriend handling 2023-03-28 21:03:42 -06:00
Mykola Grymalyuk
06350355ff build: Add docstrings to functions 2023-03-28 20:57:17 -06:00
Mykola Grymalyuk
9677c52c1c Sync CHANGELOG 2023-03-28 20:15:07 -06:00
Mykola Grymalyuk
bc4cc33f2f Merge pull request #1042 from Jazzzny/main
Enhancement - Replace hardcoded WxPython GUI font with .AppleSystemUIFont
2023-03-28 20:04:53 -06:00
Jazzzny
b2f1a6375a Update gui_main.py 2023-03-28 21:11:42 -04:00
Jazzzny
3c7f496bc8 Update gui_help.py 2023-03-28 21:11:06 -04:00
Mykola Grymalyuk
9b984e68af build: Implement pythonic formatting 2023-03-28 16:34:51 -06:00
Mykola Grymalyuk
54c661751a Sync changelog 2023-03-28 14:18:33 -06:00
Mykola Grymalyuk
2c0d67ce61 kdk_handler.py: Remove redundant str comparison 2023-03-28 14:17:19 -06:00
Mykola Grymalyuk
d153747b58 Merge pull request #1035 from Ausdauersportler/main
iMac9,1 MXM3 AMD GCN support
2023-03-28 14:16:37 -06:00
Mykola Grymalyuk
74fc3a7890 Merge branch 'main' into main 2023-03-28 14:15:56 -06:00
Mykola Grymalyuk
c6ce71d589 defaults: enable beta menubar 2023-03-28 09:33:08 -06:00
Mykola Grymalyuk
513f20bbb1 kdk_handler.py: Fix cleanup logic 2023-03-28 09:25:52 -06:00
Mykola Grymalyuk
afae4f8eda Sync PatcherSupportPkg 2023-03-28 09:06:40 -06:00
Mykola Grymalyuk
af4d063f6e Increment Build 2023-03-27 12:19:34 -06:00
ThatStella7922
f0ebd235a9 Update documentation
Based off DhinakG's suggestions
2023-03-15 11:09:51 -06:00
ThatStella7922
93c1d3c4aa Updated Windows.md by Jazzny 2023-03-15 10:59:19 -06:00
Ausdauersportler
8661fa339c iMac9,1 MXM3 AMD GCN support 2023-03-15 00:42:20 +01:00
ThatStella7922
8db8e0b5da docs grammar/wording pass, update WINDOWS.md by @Jazzzny 2023-02-26 14:20:47 -07:00
ThatStella7922
954d3b9166 SOURCE grammar and wording tweaks 2023-02-26 12:53:11 -07:00
ThatStella7922
672129dbfc README grammar and wording tweaks, add hw donation 2023-02-26 12:32:59 -07:00
92 changed files with 2757 additions and 1174 deletions

View File

@@ -9,24 +9,49 @@ on:
jobs: jobs:
build: build:
name: Build wxPython name: Build wxPython
runs-on: x86_64_mojave runs-on: x86_64_monterey
if: github.repository_owner == 'dortania' if: github.repository_owner == 'dortania'
env: env:
branch: ${{ github.ref }} branch: ${{ github.ref }}
commiturl: ${{ github.event.head_commit.url }}${{ github.event.release.html_url }} commiturl: ${{ github.event.head_commit.url }}${{ github.event.release.html_url }}
commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }} commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }}
MAC_CODESIGN_IDENTITY: ${{ secrets.MAC_CODESIGN_IDENTITY }}
MAC_CODESIGN_CERT: ${{ secrets.MAC_CODESIGN_CERT }}
MAC_NOTARIZATION_USERNAME: ${{ secrets.MAC_NOTARIZATION_USERNAME }} MAC_NOTARIZATION_USERNAME: ${{ secrets.MAC_NOTARIZATION_USERNAME }}
MAC_NOTARIZATION_PASSWORD: ${{ secrets.MAC_NOTARIZATION_PASSWORD }} MAC_NOTARIZATION_PASSWORD: ${{ secrets.MAC_NOTARIZATION_PASSWORD }}
MAC_NOTARIZATION_TEAM_ID: ${{ secrets.MAC_NOTARIZATION_TEAM_ID }}
ANALYTICS_KEY: ${{ secrets.ANALYTICS_KEY }}
ANALYTICS_SITE: ${{ secrets.ANALYTICS_SITE }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 Build-Binary.command --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}"
- run: 'codesign -s "Developer ID Application: Mykola Grymalyuk (S74BDJXQMD)" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"' - name: Build Binary
- run: cd dist; ditto -c -k --sequesterRsrc --keepParent OpenCore-Patcher.app ../OpenCore-Patcher-wxPython.app.zip run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 Build-Binary.command --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}" --key "${{ env.ANALYTICS_KEY }}" --site "${{ env.ANALYTICS_SITE }}"
- run: xcrun altool --notarize-app --primary-bundle-id "com.dortania.opencore-legacy-patcher" --username "${{ env.MAC_NOTARIZATION_USERNAME }}" --password "${{ env.MAC_NOTARIZATION_PASSWORD }}" --file OpenCore-Patcher-wxPython.app.zip
- run: packagesbuild ./payloads/InstallPackage/AutoPkg-Assets-Setup.pkgproj # Uncomment when using Github Runners or first run on self-hosted
- run: mv ./OpenCore-Patcher-wxPython.app.zip ./OpenCore-Patcher-GUI.app.zip # - name: Import Certificate
# uses: apple-actions/import-codesign-certs@v1
# with:
# p12-file-base64: ${{ secrets.MAC_CODESIGN_CERT }}
# p12-password: ${{ secrets.MAC_NOTARIZATION_PASSWORD }}
- name: Codesign Binary
run: 'codesign -s "${{ env.MAC_CODESIGN_IDENTITY }}" -v --force --deep --timestamp --entitlements ./payloads/entitlements.plist -o runtime "dist/OpenCore-Patcher.app"'
- name: Package Binary
run: cd dist; ditto -c -k --sequesterRsrc --keepParent OpenCore-Patcher.app ../OpenCore-Patcher-wxPython.app.zip
- name: Notarize Binary
run: xcrun notarytool submit OpenCore-Patcher-wxPython.app.zip --apple-id "${{ env.MAC_NOTARIZATION_USERNAME }}" --password "${{ env.MAC_NOTARIZATION_PASSWORD }}" --team-id "${{ env.MAC_NOTARIZATION_TEAM_ID }}"
- name: Generate support package
run: packagesbuild ./payloads/InstallPackage/AutoPkg-Assets-Setup.pkgproj
- name: Prepare App for Upload
run: mv ./OpenCore-Patcher-wxPython.app.zip ./OpenCore-Patcher-GUI.app.zip
- name: Upload App to Artifacts - name: Upload App to Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@@ -9,7 +9,7 @@ on:
jobs: jobs:
build: build:
name: Validate name: Validate
runs-on: x86_64_mojave runs-on: x86_64_monterey
if: github.repository_owner == 'dortania' if: github.repository_owner == 'dortania'
env: env:
branch: ${{ github.ref }} branch: ${{ github.ref }}
@@ -17,4 +17,5 @@ jobs:
commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }} commitdate: ${{ github.event.head_commit.timestamp }}${{ github.event.release.published_at }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 OpenCore-Patcher-GUI.command --validate - name: Validate
run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 OpenCore-Patcher-GUI.command --validate

View File

@@ -61,6 +61,8 @@ class CreateBinary:
parser.add_argument('--commit', type=str, help='Git commit URL') parser.add_argument('--commit', type=str, help='Git commit URL')
parser.add_argument('--commit_date', type=str, help='Git commit date') parser.add_argument('--commit_date', type=str, help='Git commit date')
parser.add_argument('--reset_binaries', action='store_true', help='Force redownload and imaging of payloads') parser.add_argument('--reset_binaries', action='store_true', help='Force redownload and imaging of payloads')
parser.add_argument('--key', type=str, help='Developer key for signing')
parser.add_argument('--site', type=str, help='Path to server')
args = parser.parse_args() args = parser.parse_args()
return args return args
@@ -132,17 +134,85 @@ class CreateBinary:
print(rm_output.stderr.decode('utf-8')) print(rm_output.stderr.decode('utf-8'))
raise Exception("Remove failed") raise Exception("Remove failed")
self._embed_key()
print("- Building GUI binary...") print("- Building GUI binary...")
build_args = [self.pyinstaller_path, "./OpenCore-Patcher-GUI.spec", "--noconfirm"] build_args = [self.pyinstaller_path, "./OpenCore-Patcher-GUI.spec", "--noconfirm"]
build_result = subprocess.run(build_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) build_result = subprocess.run(build_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
self._strip_key()
if build_result.returncode != 0: if build_result.returncode != 0:
print("- Build failed") print("- Build failed")
print(build_result.stderr.decode('utf-8')) print(build_result.stderr.decode('utf-8'))
raise Exception("Build failed") raise Exception("Build failed")
def _embed_key(self):
"""
Embed developer key into binary
"""
if not self.args.key:
print("- No developer key provided, skipping...")
return
if not self.args.site:
print("- No site provided, skipping...")
return
print("- Embedding developer key...")
if not Path("./resources/analytics_handler.py").exists():
print("- analytics_handler.py not found")
return
lines = []
with open("./resources/analytics_handler.py", "r") as f:
lines = f.readlines()
for i, line in enumerate(lines):
if line.startswith("SITE_KEY: str = "):
lines[i] = f"SITE_KEY: str = \"{self.args.key}\"\n"
elif line.startswith("ANALYTICS_SERVER: str = "):
lines[i] = f"ANALYTICS_SERVER: str = \"{self.args.site}\"\n"
with open("./resources/analytics_handler.py", "w") as f:
f.writelines(lines)
def _strip_key(self):
"""
Strip developer key from binary
"""
if not self.args.key:
print("- No developer key provided, skipping...")
return
if not self.args.site:
print("- No site provided, skipping...")
return
print("- Stripping developer key...")
if not Path("./resources/analytics_handler.py").exists():
print("- analytics_handler.py not found")
return
lines = []
with open("./resources/analytics_handler.py", "r") as f:
lines = f.readlines()
for i, line in enumerate(lines):
if line.startswith("SITE_KEY: str = "):
lines[i] = f"SITE_KEY: str = \"\"\n"
elif line.startswith("ANALYTICS_SERVER: str = "):
lines[i] = f"ANALYTICS_SERVER: str = \"\"\n"
with open("./resources/analytics_handler.py", "w") as f:
f.writelines(lines)
def _delete_extra_binaries(self): def _delete_extra_binaries(self):
""" """
Delete extra binaries from payloads directory Delete extra binaries from payloads directory
@@ -161,6 +231,7 @@ class CreateBinary:
whitelist_files = [ whitelist_files = [
"com.dortania.opencore-legacy-patcher.auto-patch.plist", "com.dortania.opencore-legacy-patcher.auto-patch.plist",
"com.dortania.opencore-legacy-patcher.rsr-monitor.plist",
"entitlements.plist", "entitlements.plist",
"launcher.sh", "launcher.sh",
"OC-Patcher-TUI.icns", "OC-Patcher-TUI.icns",

View File

@@ -1,5 +1,80 @@
# OpenCore Legacy Patcher changelog # OpenCore Legacy Patcher changelog
## 0.6.5
- Update 3802 Patchset Binaries:
- Resolves additional 3rd party app crashes on Metal with macOS 13.3+
- ex: PowerPoint's "Presentation Mode"
- Update non-Metal Binaries:
- Resolves Safari 16.4 frozen canvas rendering
- ex: Google Docs
- Allow for coexistence of USB 3.0 controllers and USB 1.1 patches on macOS 13+
- Restores USB 3.0 expansion card support on USB 1.1 machines such as MacPro5,1
- Resolve OpenCL rendering on Nvidia Web Drivers
- thanks [@jazzzny](https://github.com/Jazzzny)
- Resolve UI unable to download macOS installers on unknown models
- ex. M2 Macs and Hackintoshes
- Implement minimum OS check for installer creation
- Prevents vague errors when creating Ventura installers on Yosemite
- Resolve WindowServer crashing with Rapid Security Response (RSR) installation
- Primarily applicable for Haswell iGPUs on 13.3.1 (a)
- Update legacy Wireless binaries
- Resolve wifi crashing on 13.4 with BCM94322, BCM943224 and Atheros chipsets
- Backend changes:
- macos_installer_handler.py:
- Expand OS support for IA parsing in SUCatalog
- gui_main.py:
- Fix spacing regression introduced with `.AppleSystemUIFont` implementation
- Increment Binaries:
- PatcherSupportPkg 0.9.7 - release
- Build Server Changes:
- Upgrade CI Host to macOS Monterey
- Upgrade Xcode to 14.2
- Switch from `altool` to `notarytool` for notarization
## 0.6.4
- Backend changes:
- Implement new analytics_handler.py module
- Adds support for anonymous analytics including host info (and crash reports in the future)
- Can be disabled via GUI or `defaults write com.dortania.opencore-legacy-patcher DisableCrashAndAnalyticsReporting -bool true`
- Resolve Safari rendering error on Ivy Bridge in macOS 13.3+
- Increment Binaries:
- RestrictEvents 1.1.1 - rolling (495f4d5)
## 0.6.3
- Update non-Metal Binaries:
- Resolves Safari 16.4 rendering issue
- Resolves left side menubar selections
- Implements automatic menubar text color
- New experimental Menubar implementation can be enabled via `defaults write -g Amy.MenuBar2Beta -bool true`
- Note: If you experience issues with the new implementation, you can revert back to the old implementation by running `defaults delete -g Amy.MenuBar2Beta`
- Implement full IOUSBHostFamily downgrade for UHCI/OHCI
- Resolves panics on certain iMac models
- Resolve unused KDKs not being properly cleaned up
- Implement MXM graphics handling for iMac9,1
- Credit to [@Ausdauersportler](https://github.com/Ausdauersportler) for implementation
- Resolve CoreGraphics.framework crashing on Ivy Bridge CPUs in macOS 13.3+
- Disables f16c sysctl reporting
- Resolve accidental CPU renaming with RestrictEvents
- Resolve backlight and internal display support for AMD Navi MXM GPUs
- Credit to [@Ausdauersportler](https://github.com/Ausdauersportler) for bug fix
- Resolve 3rd Party Apps erroring on Metal with macOS 13.3
- Applicable Software: Applications directly using Metal (ex. Blender, Parallels Desktop)
- Applicable Hardware: 3802-based GPUs (ie. Intel Ivy Bridge and Haswell iGPUs, Nvidia Kepler dGPUs)
- Backend changes:
- Use `.AppleSystemUIFont` for wxPython text rendering (thanks [@jazzzny](https://github.com/Jazzzny))
- Add extra error handling for network errors:
- Handles `RemoteDisconnected('Remote end closed connection without response')` exceptions
- Move root volume patch set generation to dedicated sys_patch_generate.py module
- Refactored integrity_verification.py:
- Implemented Object-Oriented design
- Reduced disk I/O and main thread monopolization
- Increment Binaries:
- PatcherSupportPkg 0.9.3 - release
- OpenCorePkg 0.9.1 - release
- AirPortBrcmFixup 2.1.7 - release
- RestrictEvents 1.1.0 - release
- BrcmPatchRAM 2.6.5 - release
## 0.6.2 ## 0.6.2
- Work around Black Box rendering issues on certain Display Color Profiles - Work around Black Box rendering issues on certain Display Color Profiles
- Limited to Ventura currently due to limitations with other color profiles - Limited to Ventura currently due to limitations with other color profiles

25
PRIVACY.md Normal file
View File

@@ -0,0 +1,25 @@
# Privacy Policy
OpenCore Legacy Patcher may collect pseudo-anonymized data about the host system and the OpenCore Legacy Patcher application. This data is used to improve the project and to help diagnose issues. The data collected is as follows:
* System's UUID as a SHA1 hash
* This is used to identify the system and to prevent duplicate reports
* Cannot be used to identify the system without the user providing the UUID
* Application name and version
* System's OS version
* System's model name, GPUs present and firmware vendor
* May include more hardware information in the future (ex. CPU, WiFi, etc)
* General country code of system's reported region
* ex. `US`, `CA`, etc
Identifiable data such as IP addresses, MAC addresses, serial numbers, etc. are not collected.
In the future, crash logs may also be collected to help with diagnosing issues.
----------
Users who wish to opt-out can do so either via the application's preferences or via the following command:
```
defaults write com.dortania.opencore-legacy-patcher DisableCrashAndAnalyticsReporting -bool true
```
To have your data removed, please contact us via our [Discord server](https://discord.gg/rqdPgH8xSN) and provide the UUID of your system.

View File

@@ -5,7 +5,7 @@
A Python-based project revolving around [Acidanthera's OpenCorePkg](https://github.com/acidanthera/OpenCorePkg) and [Lilu](https://github.com/acidanthera/Lilu) for both running and unlocking features in macOS on supported and unsupported Macs. A Python-based project revolving around [Acidanthera's OpenCorePkg](https://github.com/acidanthera/OpenCorePkg) and [Lilu](https://github.com/acidanthera/Lilu) for both running and unlocking features in macOS on supported and unsupported Macs.
Our project's main goal is to breath new life to Macs no longer supported by Apple, allowing for the installation and usage of macOS Big Sur and newer on machines as old as 2007. Our project's main goal is to breathe new life into Macs no longer supported by Apple, allowing for the installation and usage of macOS Big Sur and newer on machines as old as 2007.
---------- ----------
@@ -16,23 +16,23 @@ Our project's main goal is to breath new life to Macs no longer supported by App
Noteworthy features of OpenCore Legacy Patcher: Noteworthy features of OpenCore Legacy Patcher:
* Support for macOS Big Sur, Monterey and Ventura * Support for macOS Big Sur, Monterey and Ventura
* Native Over the Air(OTA) System Updates * Native Over the Air (OTA) System Updates
* Supports Penryn and newer Macs * Supports Penryn and newer Macs
* Full support for WPA Wifi and Personal Hotspot on BCM943224 and newer chipsets * Full support for WPA Wi-Fi and Personal Hotspot on BCM943224 and newer wireless chipsets
* System Integrity Protection, FileVault 2, .im4m Secure Boot and Vaulting * System Integrity Protection, FileVault 2, .im4m Secure Boot and Vaulting
* Recovery OS, Safe Mode and Single-user Mode booting on non-native OSes * Recovery OS, Safe Mode and Single-user Mode booting on non-native OSes
* Unlocks features such as Sidecar and AirPlay to Mac even on native Macs * Unlocks features such as Sidecar and AirPlay to Mac even on native Macs
* Enable enhanced SATA and NVMe power management on non-stock hardware * Enables enhanced SATA and NVMe power management on non-Apple storage devices
* Zero firmware patching required (ie. APFS ROM patching) * Zero firmware patching required (ie. APFS ROM patching)
* Graphics acceleration for both Metal and non-Metal GPUs * Graphics acceleration for both Metal and non-Metal GPUs
---------- ----------
Note: Only clean-installs and upgrades are supported, macOS Big Sur installs already patched with other patchers, such as [Patched Sur](https://github.com/BenSova/Patched-Sur) or [bigmac](https://github.com/StarPlayrX/bigmac), cannot be used due to broken file integrity with APFS snapshots and SIP. Note: Only clean-installs and upgrades are supported. macOS Big Sur installs already patched with other patchers, such as [Patched Sur](https://github.com/BenSova/Patched-Sur) or [bigmac](https://github.com/StarPlayrX/bigmac), cannot be used due to broken file integrity with APFS snapshots and SIP.
* You can however reinstall macOS with this patcher and retain your original data * You can, however, reinstall macOS with this patcher and retain your original data
Note 2: Currently OpenCore Legacy Patcher officially supports patching to run macOS Big Sur through Ventura installs. For older OSes, OpenCore may function however support is currently not provided from Dortania. Note 2: Currently, OpenCore Legacy Patcher officially supports patching to run macOS Big Sur through Ventura installs. For older OSes, OpenCore may function; however, support is currently not provided from Dortania.
* For macOS Mojave and Catalina support, we recommend the use of [dosdude1's patchers](http://dosdude1.com) * For macOS Mojave and Catalina support, we recommend the use of [dosdude1's patchers](http://dosdude1.com)
@@ -47,7 +47,7 @@ To start using the project, please see our in-depth guide:
This project is offered on an AS-IS basis, we do not guarantee support for any issues that may arise. However, there is a community server with other passionate users and developers that can aid you: This project is offered on an AS-IS basis, we do not guarantee support for any issues that may arise. However, there is a community server with other passionate users and developers that can aid you:
* [OpenCore Patcher Paradise Discord Server](https://discord.gg/rqdPgH8xSN) * [OpenCore Patcher Paradise Discord Server](https://discord.gg/rqdPgH8xSN)
* Keep in mind that the Discord is maintained by the community, so we ask everyone to be respectful. * Keep in mind that the Discord server is maintained by the community, so we ask everyone to be respectful.
* Please review our docs on [how to debug with OpenCore](https://dortania.github.io/OpenCore-Legacy-Patcher/DEBUG.html) to gather important information to help others with troubleshooting. * Please review our docs on [how to debug with OpenCore](https://dortania.github.io/OpenCore-Legacy-Patcher/DEBUG.html) to gather important information to help others with troubleshooting.
## Running from source ## Running from source
@@ -57,14 +57,14 @@ To run the project from source, see here: [Build and run from source](./SOURCE.m
## Credits ## Credits
* [Acidanthera](https://github.com/Acidanthera) * [Acidanthera](https://github.com/Acidanthera)
* OpenCorePkg as well as many of the core kexts and tools * OpenCorePkg, as well as many of the core kexts and tools
* [DhinakG](https://github.com/DhinakG) * [DhinakG](https://github.com/DhinakG)
* Main co-author * Main co-author
* [Khronokernel](https://github.com/Khronokernel) * [Khronokernel](https://github.com/Khronokernel)
* Main co-author * Main co-author
* [Ausdauersportler](https://github.com/Ausdauersportler) * [Ausdauersportler](https://github.com/Ausdauersportler)
* iMacs Metal GPUs Upgrade Patch set and documentation * iMacs Metal GPUs Upgrade Patch set and documentation
* Great amounts of help debugging and code suggestions * Great amounts of help with debugging, and code suggestions
* [vit9696](https://github.com/vit9696) * [vit9696](https://github.com/vit9696)
* Endless amount of help troubleshooting, determining fixes and writing patches * Endless amount of help troubleshooting, determining fixes and writing patches
* [ASentientBot](https://github.com/ASentientBot), [EduCovas](https://github.com/educovas) and [ASentientHedgehog](https://github.com/moosethegoose2213) * [ASentientBot](https://github.com/ASentientBot), [EduCovas](https://github.com/educovas) and [ASentientHedgehog](https://github.com/moosethegoose2213)
@@ -75,7 +75,7 @@ To run the project from source, see here: [Build and run from source](./SOURCE.m
* [Syncretic](https://forums.macrumors.com/members/syncretic.1173816/) * [Syncretic](https://forums.macrumors.com/members/syncretic.1173816/)
* [AAAMouSSE](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/), [telemetrap](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/post-28447707) and [SurPlus](https://github.com/reenigneorcim/SurPlus) * [AAAMouSSE](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/), [telemetrap](https://forums.macrumors.com/threads/mp3-1-others-sse-4-2-emulation-to-enable-amd-metal-driver.2206682/post-28447707) and [SurPlus](https://github.com/reenigneorcim/SurPlus)
* [dosdude1](https://github.com/dosdude1) * [dosdude1](https://github.com/dosdude1)
* Main author of [original GUI](https://github.com/dortania/OCLP-GUI) * Main author of the [original GUI](https://github.com/dortania/OCLP-GUI)
* Development of previous patchers, laying out much of what needs to be patched * Development of previous patchers, laying out much of what needs to be patched
* [parrotgeek1](https://github.com/parrotgeek1) * [parrotgeek1](https://github.com/parrotgeek1)
* [VMM Patch Set](https://github.com/dortania/OpenCore-Legacy-Patcher/blob/4a8f61a01da72b38a4b2250386cc4b497a31a839/payloads/Config/config.plist#L1222-L1281) * [VMM Patch Set](https://github.com/dortania/OpenCore-Legacy-Patcher/blob/4a8f61a01da72b38a4b2250386cc4b497a31a839/payloads/Config/config.plist#L1222-L1281)
@@ -96,10 +96,11 @@ To run the project from source, see here: [Build and run from source](./SOURCE.m
* [SpiGAndromeda](https://github.com/SpiGAndromeda) - AMD Vega 64 * [SpiGAndromeda](https://github.com/SpiGAndromeda) - AMD Vega 64
* [turbomacs](https://github.com/turbomacs) - 2014 5k iMac * [turbomacs](https://github.com/turbomacs) - 2014 5k iMac
* [vinaypundith](https://forums.macrumors.com/members/vinaypundith.1212357/) - MacBook7,1 * [vinaypundith](https://forums.macrumors.com/members/vinaypundith.1212357/) - MacBook7,1
* [ThatStella7922](https://github.com/ThatStella7922) - 2017 13" MacBook Pro (A1708)
* zephar - 2008 Mac Pro * zephar - 2008 Mac Pro
* jazo97 - 2011 15" MacBook Pro * jazo97 - 2011 15" MacBook Pro
* And others (reach out if we forgot you!) * And others (reach out if we forgot you!)
* MacRumors and Unsupported Mac Communities * MacRumors and Unsupported Mac Communities
* Endless testing, reporting issues * Endless testing and reporting issues
* Apple * Apple
* for macOS and many of the kexts, frameworks and other binaries we reimplemented into newer OSes * for macOS and many of the kexts, frameworks and other binaries we reimplemented into newer OSes

View File

@@ -1,20 +1,20 @@
# Build and run from source # Build and run from source
OpenCore Legacy Patcher at its core is a python-based GUI/CLI based application. This means that to run the project from source, you simply need to invoke the OpenCore-Patcher-GUI.command file via Python. OpenCore Legacy Patcher at its core is a Python-based GUI/CLI-based application. In turn, to run the project from source, you simply need to invoke the OpenCore-Patcher-GUI.command file via Python.
For developers wishing to validate mainline changes, you may use these nightly links: For developers wishing to validate mainline changes, you may use these nightly links:
* [GUI (Graphical Based App)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython/main/OpenCore-Patcher.app%20%28GUI%29.zip) * [GUI (Graphical Based App)](https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython/main/OpenCore-Patcher.app%20%28GUI%29.zip)
**Warning**: These binaries should not be used without first consulting the [CHANGELOG](./CHANGELOG.md). Do not distribute these links in forums, instead direct to this file. **Warning**: These binaries should not be used without first consulting the [CHANGELOG](./CHANGELOG.md). Do not distribute these links in forums, please link to this document instead.
* Users running new builds of the project without understanding what has changed are at higher of bricking their installation as they do not read any warnings provided in the CHANGELOG. We wish to minimize these situations as much as possible. * Users running new builds of the project without understanding what has changed are at a higher risk of bricking their installation as they do not read any warnings provided in the CHANGELOG. We wish to minimize these situations as much as possible.
## Getting Started ## Getting Started
To start, ensure you have python 3.6 or newer installed. Additionally ensure that they were downloaded from the Official source, [python.org](https://www.python.org/downloads/macos/). To start, ensure you have Python 3.6 or newer installed. Additionally, ensure that it was downloaded from the official source, [python.org](https://www.python.org/downloads/macos/).
* Python installations either preinstalled or provided with Xcode/Xcode Tools are unsupported due to reliablility issues * Python installations either preinstalled or provided with Xcode or the Xcode Command Line Tools are unsupported due to reliability issues.
Once Python is installed, open Terminal and run the following: Once Python is installed, open Terminal and run the following:
@@ -29,10 +29,10 @@ cd ./OpenCore-Legacy-Patcher
pip3 install -r requirements.txt pip3 install -r requirements.txt
``` ```
If you have installation error, see following troubleshooting options: If you have any installation errors, see the following troubleshooting options:
* Use Python 3.10 * Use Python 3.10
* Currently our build server uses py3.10 for generating binaries used in releases * Our build server currently uses Python 3.10 for generating binaries used in releases
* Use .whl snapshots for installing additional dependencies * Use .whl snapshots for installing additional dependencies
## Running OpenCore Legacy Patcher ## Running OpenCore Legacy Patcher
@@ -51,14 +51,14 @@ Note that the OpenCore-Patcher-GUI.command file can be run as both a GUI and a C
python3 OpenCore-Patcher-GUI.command --build --model iMac12,2 --verbose python3 OpenCore-Patcher-GUI.command --build --model iMac12,2 --verbose
``` ```
See `-h`/`--help` for more information on supported CLI arguments. Pass `-h` or `--help` for more information on supported CLI arguments.
## Generating prebuilt binaries ## Generating prebuilt binaries
The main goal of generating prebuilt binaries is to strip the requirement of a local python installation for users. For developers, there's very little benefit besides enabling dark mode support in the GUI. For development, simply use the OpenCore-Patcher-GUI.command file with a python3 installation. The main goal of generating prebuilt binaries is to strip the requirement of a local Python installation for users. For developers, there's very little benefit besides enabling dark mode support in the GUI. For development, simply use the OpenCore-Patcher-GUI.command file with a Python 3 installation.
* Note that due to PyInstaller's linking mechanism, binaries generated on Catalina and newer are not compatible with High Sierra and older * Note that due to PyInstaller's linking mechanism, binaries generated on Catalina and newer are not compatible with High Sierra and older
* To ensure the largest compatibility, generate binaries on macOS Mojave. These binaries will be compatible with macOS 10.9 to macOS 12. * To ensure the best compatibility, generate binaries on macOS Mojave. These binaries will be compatible with macOS 10.9 to macOS 12.
* Currently our build system is a [Macmini8,1 provided by MacStadium](https://www.macstadium.com/opensource) running macOS Mojave (10.14.6). * Currently our build system is a [Macmini8,1 provided by MacStadium](https://www.macstadium.com/opensource) running macOS Mojave (10.14.6).
```sh ```sh

View File

@@ -28,22 +28,51 @@ class os_data(enum.IntEnum):
class os_conversion: class os_conversion:
def os_to_kernel(os): def os_to_kernel(os: str) -> int:
# Convert OS version to major XNU version """
Convert OS version to major XNU version
Parameters:
os (str): OS version
Returns:
int: Major XNU version
"""
if os.startswith("10."): if os.startswith("10."):
return (int(os.split(".")[1]) + 4) return (int(os.split(".")[1]) + 4)
else: else:
return (int(os.split(".")[0]) + 9) return (int(os.split(".")[0]) + 9)
def kernel_to_os(kernel):
# Convert major XNU version to OS version def kernel_to_os(kernel: int) -> str:
"""
Convert major XNU version to OS version
Parameters:
kernel (int): Major XNU version
Returns:
str: OS version
"""
if kernel >= os_data.big_sur: if kernel >= os_data.big_sur:
return str((kernel - 9)) return str((kernel - 9))
else: else:
return str((f"10.{kernel - 4}")) return str((f"10.{kernel - 4}"))
def is_os_newer(source_major, source_minor, target_major, target_minor):
# Check if OS version 1 is newer than OS version 2 def is_os_newer(source_major: int, source_minor: int, target_major: int, target_minor: int) -> bool:
"""
Check if OS version 1 is newer than OS version 2
Parameters:
source_major (int): Major XNU version of OS version 1
source_minor (int): Minor XNU version of OS version 1
target_major (int): Major XNU version of OS version 2
target_minor (int): Minor XNU version of OS version 2
Returns:
bool: True if OS version 1 is newer than OS version 2
"""
if source_major < target_major: if source_major < target_major:
return True return True
elif source_major == target_major: elif source_major == target_major:
@@ -52,8 +81,17 @@ class os_conversion:
else: else:
return False return False
def convert_kernel_to_marketing_name(kernel):
# Convert major XNU version to Marketing Name def convert_kernel_to_marketing_name(kernel: int) -> str:
"""
Convert major XNU version to Marketing name
Parameters:
kernel (int): Major XNU version
Returns:
str: Marketing name of OS
"""
try: try:
# Find os_data enum name # Find os_data enum name
os_name = os_data(kernel).name os_name = os_data(kernel).name
@@ -70,8 +108,17 @@ class os_conversion:
return os_name return os_name
def convert_marketing_name_to_kernel(marketing_name):
# Convert Marketing Name to major XNU version def convert_marketing_name_to_kernel(marketing_name: str) -> int:
"""
Convert Marketing Name to major XNU version
Parameters:
marketing_name (str): Marketing Name of OS
Returns:
int: Major XNU version
"""
try: try:
# Find os_data enum value # Find os_data enum value
os_kernel = os_data[marketing_name.lower().replace(" ", "_")] os_kernel = os_data[marketing_name.lower().replace(" ", "_")]
@@ -81,16 +128,18 @@ class os_conversion:
return int(os_kernel) return int(os_kernel)
def find_largest_build(build_array): def find_largest_build(build_array: list) -> str:
# Find the newest version within an array of versions """
# These builds will have both numbers and letters in the version Find the newest version within an array of versions
# ex: These builds will have both numbers and letters in the version
# [ ex:
# "22A5295i", [
# "22A5266r", "22A5295i",
# "22A5286j", "22A5266r",
# "22A5295h", "22A5286j",
# ] "22A5295h",
]
"""
max_length = 0 # Length of the longest build max_length = 0 # Length of the longest build
build_array_split = [] # 'build_array', converted into individual array of elements build_array_split = [] # 'build_array', converted into individual array of elements

View File

@@ -1872,8 +1872,10 @@ smbios_dictionary = {
"Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046, "Bluetooth Model": bluetooth_data.bluetooth_data.BRCM2046,
"Ethernet Chipset": "Nvidia", "Ethernet Chipset": "Nvidia",
"nForce Chipset": True, "nForce Chipset": True,
"Socketed GPUs": "MXM",
"Stock GPUs": [ "Stock GPUs": [
device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Tesla,
device_probe.AMD.Archs.TeraScale_1,
], ],
"Stock Storage": [ "Stock Storage": [
"SATA 3.5", "SATA 3.5",
@@ -1943,7 +1945,7 @@ smbios_dictionary = {
"nForce Chipset": True, "nForce Chipset": True,
"Socketed GPUs": "MXM", "Socketed GPUs": "MXM",
"Stock GPUs": [ "Stock GPUs": [
device_probe.NVIDIA.Archs.Tesla, device_probe.AMD.Archs.TeraScale_1,
], ],
"Stock Storage": [ "Stock Storage": [
"SATA 3.5", "SATA 3.5",
@@ -1961,7 +1963,7 @@ smbios_dictionary = {
"nForce Chipset": True, "nForce Chipset": True,
"Socketed GPUs": "MXM", "Socketed GPUs": "MXM",
"Stock GPUs": [ "Stock GPUs": [
device_probe.NVIDIA.Archs.Tesla, device_probe.AMD.Archs.TeraScale_1,
], ],
"Stock Storage": [ "Stock Storage": [
"SATA 3.5", "SATA 3.5",
@@ -1979,7 +1981,7 @@ smbios_dictionary = {
"nForce Chipset": True, "nForce Chipset": True,
"Socketed GPUs": "MXM", "Socketed GPUs": "MXM",
"Stock GPUs": [ "Stock GPUs": [
device_probe.NVIDIA.Archs.Tesla, device_probe.AMD.Archs.TeraScale_1,
], ],
"Stock Storage": [ "Stock Storage": [
"SATA 3.5", "SATA 3.5",

View File

@@ -58,9 +58,15 @@ class SystemPatchDictionary():
self.os_major: int = os_major self.os_major: int = os_major
self.os_minor: int = os_minor self.os_minor: int = os_minor
self.os_float: float = float(f"{self.os_major}.{self.os_minor}")
self.non_metal_os_support: list = non_metal_os_support self.non_metal_os_support: list = non_metal_os_support
self.patchset_dict: dict = {} self.patchset_dict: dict = {}
# XNU Kernel versions
self.macOS_12_0_B7: float = 21.1
self.macOS_12_4: float = 21.5
self.macOS_12_5: float = 21.6
self._generate_sys_patch_dict() self._generate_sys_patch_dict()
@@ -135,8 +141,9 @@ class SystemPatchDictionary():
}, },
"Processes": { "Processes": {
# 'When Space Allows' option introduced in 12.4 (XNU 21.5) # 'When Space Allows' option introduced in 12.4 (XNU 21.5)
**({"defaults write /Library/Preferences/.GlobalPreferences.plist ShowDate -int 1": True } if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 4, self.os_major, self.os_minor) else {}), **({"defaults write /Library/Preferences/.GlobalPreferences.plist ShowDate -int 1": True } if self.os_float >= self.macOS_12_4 else {}),
"defaults write /Library/Preferences/.GlobalPreferences.plist InternalDebugUseGPUProcessForCanvasRenderingEnabled -bool false": True, "defaults write /Library/Preferences/.GlobalPreferences.plist InternalDebugUseGPUProcessForCanvasRenderingEnabled -bool false": True,
"defaults write /Library/Preferences/.GlobalPreferences.plist WebKitExperimentalUseGPUProcessForCanvasRenderingEnabled -bool false": True,
}, },
}, },
"Non-Metal IOAccelerator Common": { "Non-Metal IOAccelerator Common": {
@@ -538,7 +545,7 @@ class SystemPatchDictionary():
"NVDANV50HalTesla.kext": "10.13.6", "NVDANV50HalTesla.kext": "10.13.6",
"NVDAResmanTesla.kext": "10.13.6", "NVDAResmanTesla.kext": "10.13.6",
# Apple dropped NVDAStartup in 12.0 Beta 7 (XNU 21.1) # Apple dropped NVDAStartup in 12.0 Beta 7 (XNU 21.1)
**({ "NVDAStartup.kext": "12.0 Beta 6" } if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 0, self.os_major, self.os_minor) else {}) **({ "NVDAStartup.kext": "12.0 Beta 6" } if self.os_float >= self.macOS_12_0_B7 else {})
}, },
}, },
}, },
@@ -569,7 +576,7 @@ class SystemPatchDictionary():
}, },
"/System/Library/Frameworks": { "/System/Library/Frameworks": {
# XNU 21.6 (macOS 12.5) # XNU 21.6 (macOS 12.5)
**({ "Metal.framework": "12.5 Beta 2"} if (os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 5, self.os_major, self.os_minor) and self.os_major < os_data.os_data.ventura) else {}), **({ "Metal.framework": "12.5 Beta 2"} if (self.os_float >= self.macOS_12_5 and self.os_major < os_data.os_data.ventura) else {}),
}, },
"/System/Library/PrivateFrameworks": { "/System/Library/PrivateFrameworks": {
"GPUCompiler.framework": "11.6", "GPUCompiler.framework": "11.6",
@@ -600,6 +607,10 @@ class SystemPatchDictionary():
"GeForceTeslaGLDriverWeb.bundle": "WebDriver-387.10.10.10.40.140", "GeForceTeslaGLDriverWeb.bundle": "WebDriver-387.10.10.10.40.140",
"GeForceTeslaVADriverWeb.bundle": "WebDriver-387.10.10.10.40.140", "GeForceTeslaVADriverWeb.bundle": "WebDriver-387.10.10.10.40.140",
}, },
"/System/Library/PrivateFrameworks": {
# Restore OpenCL by adding missing compiler files
**({ "GPUCompiler.framework": "11.6"} if self.os_major >= os_data.os_data.monterey else {}),
},
}, },
"Install Non-Root": { "Install Non-Root": {
"/Library/Extensions": { "/Library/Extensions": {
@@ -1168,12 +1179,8 @@ class SystemPatchDictionary():
}, },
}, },
"Install": { "Install": {
"/System/Library/Extensions/IOUSBHostFamily.kext/Contents/MacOS": { "/System/Library/Extensions": {
"IOUSBHostFamily": "12.6.2", "IOUSBHostFamily.kext": "12.6.2",
},
"/System/Library/Extensions/IOUSBHostFamily.kext/Contents/PlugIns": {
"AppleUSBEHCI.kext": "12.6.2",
"AppleUSBHub.kext": "12.6.2",
}, },
}, },
} }

View File

@@ -106,7 +106,7 @@ Workaround: Press some combination of Tab, or Tab and then Shift-Tab, or just Sh
## Wake from sleep heavily distorted on AMD/ATI in macOS 11.3 and newer ## Wake from sleep heavily distorted on AMD/ATI in macOS 11.3 and newer
Unfortunately a very well known issue that the community is investigating. A currently known solution is to downgrade to macOS 11.2.3 or older until a proper fix can be found. Additionally logging out and logging in can resolve the issue without requiring a reboot. Unfortunately, this is a very well known issue that the community is investigating. A currently known solution is to downgrade to macOS 11.2.3 or older until a proper fix can be found. Additionally, logging out and logging back in can resolve the issue without requiring a reboot.
* Note, this issue should be exclusive to TeraScale 1 GPUs (ie. HD2000-4000). TeraScale 2 GPUs should not exhibit this issue. * Note, this issue should be exclusive to TeraScale 1 GPUs (ie. HD2000-4000). TeraScale 2 GPUs should not exhibit this issue.
@@ -116,9 +116,9 @@ In the event Apple removes 11.2.3 from their catalogue, we've provided a mirror
## Unable to switch GPUs on 2011 15" and 17" MacBook Pros ## Unable to switch GPUs on 2011 15" and 17" MacBook Pros
Currently OpenCore Legacy Patcher, GPU switching between the iGPU and dGPU is broken. The simplest way to set a specific GPU is to disable the dGPU when you wish to remain on the more power efficient iGPU. Currently, with OpenCore Legacy Patcher, GPU switching between the iGPU and dGPU is broken. The simplest way to set a specific GPU is to disable the dGPU when you wish to remain on the more power efficient iGPU.
The best way to achieve this is to boot Recovery (or Single User Mode if the dGPU refuses to function at all) and run the following command: The best way to achieve this is to boot to Recovery (or Single User Mode if the dGPU refuses to function at all) and run the following command:
```sh ```sh
nvram FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs=%01%00%00%00 nvram FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs=%01%00%00%00
@@ -157,14 +157,13 @@ The following tool can be used to work-around this issue:
By default, OpenCore Legacy Patcher will assume MacBookPro8,2/3 have a faulty dGPU and disable acceleration. This is the safest option for most users as enabling dGPU acceleration on faulty Macs will result in failed booting. By default, OpenCore Legacy Patcher will assume MacBookPro8,2/3 have a faulty dGPU and disable acceleration. This is the safest option for most users as enabling dGPU acceleration on faulty Macs will result in failed booting.
However if your machine does not have the dGPU disabled via NVRAM, you'll experience a login loop. To work around this is quite simple: However, if your machine does not have the dGPU disabled via NVRAM, you'll experience a login loop. To work around this is quite simple:
1. Boot macOS in Single User Mode 1. Boot macOS in Single User Mode
* Press Cmd+S in OpenCore's menu when you turn the Mac on * Press Cmd+S in OpenCore's menu when you turn the Mac on
2. When command line prompt appears, enter the dGPU disabler argument (at the bottom) 2. When the command line prompt appears, enter the dGPU disabler argument (at the bottom)
3. Reboot and patched macOS should work normally 3. Reboot and patched macOS should work normally
4. If you still want to use the dGPU, run OpenCore Legacy Patcher and enable TS2 Acceleration from settings. Then root patch your Mac again 4. If you still want to use the dGPU, run OpenCore Legacy Patcher and enable TS2 Acceleration from settings. Go to `Patcher Settings -> Developer Settings -> Set TeraScale 2 Accel`, then root patch again.
`Patcher Settings -> Developer Settings -> Set TeraScale 2 Accel`
5. Either Reset NVRAM or set `gpu-power-prefs` to zeros to re-enable the dGPU 5. Either Reset NVRAM or set `gpu-power-prefs` to zeros to re-enable the dGPU
```sh ```sh

View File

@@ -2,7 +2,7 @@
Now we finally get to boot OpenCore! Now we finally get to boot OpenCore!
Reboot machine while holding `Option` to select the EFI Boot entry with the OpenCore icon (holding the `Control` key will make this the default boot entry): Reboot the machine while holding `Option` to select the EFI Boot entry with the OpenCore icon (holding the `Control` key will make this the default boot entry):
* This will be the Mac Boot Picker * This will be the Mac Boot Picker
@@ -18,7 +18,7 @@ Firstly, open the Terminal and run the following command:
```sh ```sh
sudo nvram "recovery-boot-mode=unused" && sudo reboot recovery sudo nvram "recovery-boot-mode=unused" && sudo reboot recovery
``` ```
This will make your machine reboot into the Recovery Environment. Alternatively, holding Command + R when your machine is starting up will also let you enter the Recovery. This will make your machine reboot into the Recovery Environment. Alternatively, holding `Command` + `R` when your machine is starting up will also let you enter the Recovery.
Secondly, open the Recovery Environment's Terminal (Menu bar > Utilities > Terminal). Secondly, open the Recovery Environment's Terminal (Menu bar > Utilities > Terminal).
@@ -31,7 +31,7 @@ The command should produce a list of drives installed in your system:
Keep track of the drive with the OCLP install. You will need the drive identifer for later. Keep track of the drive with the OCLP install. You will need the drive identifer for later.
Now you'll want to mount the EFI partition (where OCLP is installed, though may differ if you've installed OCLP to a FAT-32 volume). Now you'll want to mount the EFI partition (where OCLP is installed, though it may differ if you've installed OCLP to a FAT-32 volume).
Run the following command (Replace X with the drive number): Run the following command (Replace X with the drive number):
```sh ```sh
@@ -40,7 +40,7 @@ diskutil mount diskXs1
![](../images/Unflashed-Boot-2.png) ![](../images/Unflashed-Boot-2.png)
If everything is correct, the EFI partion should be mounted. If everything is correct, the EFI partion should be mounted.
Now you'll want to use the bless command to set the default boot device: Now you'll want to use the `bless` command to set the default boot device:
```sh ```sh
bless --mount /Volumes/EFI --setBoot --file /Volumes/EFI/System/Library/CoreServices/boot.efi bless --mount /Volumes/EFI --setBoot --file /Volumes/EFI/System/Library/CoreServices/boot.efi
``` ```
@@ -52,24 +52,24 @@ If the command produces an output, ensure that you've typed it in correctly.
Now you can reboot your machine. OCLP is now the default boot option! Now you can reboot your machine. OCLP is now the default boot option!
::: :::
Now that you've loaded OpenCore, now select Install macOS: Now that you've loaded OpenCore, "select Install macOS":
* This will be the OpenCore Picker * This will be the OpenCore Picker
![](../images/oc-boot.png) ![](../images/oc-boot.png)
You will soon reach the installer screen! If you enabled verbose mode when building OCLP, a lot of text will run across the screen. From there it's just like any normal macOS install. For an example of how the boot process looks, see the following video: You will soon reach the installer screen! If you enabled verbose mode when building OCLP, a lot of text will run across the screen. From there, it's just like any normal macOS install. For an example of how the boot process looks, see the following video:
* [OpenCore Legacy Patcher Boot Process](https://www.youtube.com/watch?v=AN3zsbQV_n4) * [OpenCore Legacy Patcher Boot Process](https://www.youtube.com/watch?v=AN3zsbQV_n4)
If your Mac is looping back into the beginning of the setup after the first reboot, turn it off, start it again and hold `Option`. This time select the option with a grey hard disk icon, it can say "macOS Installer" or the name you gave the disk during the installer process. Keep repeating this step after every reboot if necessary. If your Mac is looping back into the beginning of the setup after the first reboot, turn it off, start it again and hold `Option`. This time, select the option with a grey hard disk icon, it can say "macOS Installer" or the name you gave the disk during the installer process. Keep repeating this step after every reboot if necessary.
![](../images/oclp-stuck-firstreboot.png) ![](../images/oclp-stuck-firstreboot.png)
::: warning ::: warning
**MacBookPro11,3 Note**: When booting macOS Monterey, you'll need to boot into safe mode if acceleration patches are not installed yet. [Otherwise you'll hit a black screen due to missing NVIDIA drivers.](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/522) Safe Mode can be entered by holding Shift+Enter when selecting macOS Monterey in OCLP's Boot Menu. **MacBookPro11,3 Note**: When booting macOS Monterey, you'll need to boot into safe mode if acceleration patches are not installed yet. [Otherwise, you'll hit a black screen due to missing NVIDIA drivers.](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/522) Safe Mode can be entered by holding `Shift + Enter` when selecting macOS Monterey in OCLP's Boot Menu.
::: :::

View File

@@ -1,6 +1,6 @@
# Building and installing OpenCore # Building and installing OpenCore
Now that we have a macOS installer, lets now build our OpenCore configuration! Now that we have a macOS installer, let's now build our OpenCore configuration!
If you haven't downloaded OpenCore Patcher yet, do so now: If you haven't downloaded OpenCore Patcher yet, do so now:

View File

@@ -1,6 +1,6 @@
# How to debug with OpenCore # How to debug with OpenCore
For those who've hit an odd bug and unsure if it's user error or within the patcher, we recommend asking on the [OpenCore Patcher Paradise Discord Server](https://discord.gg/rqdPgH8xSN) for help. For those who've hit an odd bug and are unsure if it's user error or within the patcher, we recommend asking on the [OpenCore Patcher Paradise Discord Server](https://discord.gg/rqdPgH8xSN) for help.
## Debugging yourself ## Debugging yourself
@@ -14,7 +14,7 @@ When you've enabled these 3 options, rebuild OpenCore and install to your drive.
## Obtaining OpenCore logs from disk ## Obtaining OpenCore logs from disk
With "Enable OpenCore DEBUG" set, every boot there will be a .txt file generated in your disk. To grab these logs, [download and run MountEFI](https://github.com/corpnewt/MountEFI): With "Enable OpenCore DEBUG" set, on every boot there will be a .txt file generated on the EFI Partition. To grab these logs, [download and run MountEFI](https://github.com/corpnewt/MountEFI):
![](../images/mountefi.png) ![](../images/mountefi.png)
@@ -40,11 +40,11 @@ Currently issues have been disabled due to [current events](ISSUES-HOLD.md). You
Now that you have proper logs, you can now [file issues with us](https://github.com/dortania/OpenCore-Legacy-Patcher/issues). This is a reminder to include the following info: Now that you have proper logs, you can now [file issues with us](https://github.com/dortania/OpenCore-Legacy-Patcher/issues). This is a reminder to include the following info:
* Model patching for (ie. MacBookPro10,1) * Model that you're patching for (ie. MacBookPro10,1)
* Target OS (ie. macOS 11.2.3) * Target OS (ie. macOS 11.2.3)
* Host OS (ie. macOS 10.15.7) * Host OS (ie. macOS 10.15.7)
* Upload of your OpenCore Build Folder * Upload of your OpenCore Build Folder
* Upload of your OpenCore log (if applicable) * Upload of your OpenCore log (if applicable)
* Upload of your Kernel log (if applicable) * Upload of your Kernel log (if applicable)
Additionally, please search whether the issue has been reported before. This avoids having duplicate issues. Additionally, please search to see if the issue has been reported before. This avoids having duplicate issues.

View File

@@ -1,6 +1,6 @@
# Supporting the patcher # Supporting the patcher
OpenCore Legacy Patcher is a hobby project for us developers, and while we love helping out the community it's very difficult for us to troubleshoot issues remotely. The best way for us to get to work on the patcher, fix issues and add enhancements is having the hardware in-hand. As a hobby project, neither of the main developers can afford to buy every legacy Mac to test on. OpenCore Legacy Patcher is a hobby project for us developers, and while we love helping out the community, it's very difficult for us to troubleshoot issues remotely. The best way for us to get to work on the patcher, fix issues and add enhancements is having the hardware in-hand. As a hobby project, neither of the main developers can afford to buy every legacy Mac to test on.
The best way to support us in all honesty is to donate any old hardware you no longer need, as this allows us to have machines to test locally and push fixes much faster. While we appreciate cash donations, this makes it much more difficult for us to handle as an organization. The best way to support us in all honesty is to donate any old hardware you no longer need, as this allows us to have machines to test locally and push fixes much faster. While we appreciate cash donations, this makes it much more difficult for us to handle as an organization.
@@ -15,7 +15,7 @@ Additionally, hardware info dumps are greatly beneficial for us to determine wha
* `File -> SaveAs` and open an issue on Github * `File -> SaveAs` and open an issue on Github
* Note: We want IOReg dumps of hardware not running on OpenCore, instead running a clean, officially supported OS by the machine * Note: We want IOReg dumps of hardware not running on OpenCore, instead running a clean, officially supported OS by the machine
If you have any legacy hardware you're willing to donate or what to buy us something, please contact us at the following email: If you have any legacy hardware you're willing to donate or want to buy us hardware, please contact us at the following email:
* khronokernel@icloud.com * khronokernel@icloud.com

View File

@@ -1,9 +1,9 @@
# Boot Process with OpenCore Legacy Patcher # Boot Process with OpenCore Legacy Patcher
OpenCore Legacy Patcher itself is actually quite a "dumb" program, and essentially edits a config.plist file and moves files around, it actually has little logic regarding the boot process. The real magic of OCLP is [OpenCorePkg](https://github.com/acidanthera/OpenCorePkg), our back-end and what makes this patcher so powerful. OpenCore Legacy Patcher itself is actually quite a "dumb" program. It essentially edits a config.plist file and moves files around, actually having little logic regarding the boot process. The real magic of OCLP is [OpenCorePkg](https://github.com/acidanthera/OpenCorePkg), our back-end, and what makes this patcher so powerful.
## Boot Process with OpenCore ## Boot Process with OpenCore
To understand a bit more of how OpenCore is able revive older Macs in such a native-like way, we need to go over *how* OpenCore works with your Mac: To understand a bit more of how OpenCore is able to revive older Macs in such a native-like way, we need to go over *how* OpenCore works with your Mac:
![](../images/oc-explained.png) ![](../images/oc-explained.png)

View File

@@ -1,6 +1,6 @@
# Creating custom icons for OpenCore and Mac Boot Picker # Creating custom icons for OpenCore and Mac Boot Picker
For users who want to customize your setup to be more personal, OpenCore does allow for custom icons and images in the boot picker. For users who want to customize their setup to be more personal, OpenCore does allow for custom icons and images in the boot picker.
* [Custom OpenCore icons](#custom-opencore-icons) * [Custom OpenCore icons](#custom-opencore-icons)
* [Custom Mac Boot Picker icons](#custom-mac-boot-picker-icons) * [Custom Mac Boot Picker icons](#custom-mac-boot-picker-icons)
@@ -34,7 +34,7 @@ Once you have a custom image you want to use(for example, as a background), down
![](../images/icnspack-folder.png) ![](../images/icnspack-folder.png)
Now `cd` this folder in terminal and run the following: Now `cd` to this folder in terminal and run the following:
```sh ```sh
./icnspack Background.icns <insert_x1_image> <insert_x2_image> ./icnspack Background.icns <insert_x1_image> <insert_x2_image>
@@ -46,13 +46,13 @@ Once done, you'll see your custom icon generated in `icnspack`'s folder:
# Custom Mac Boot Picker icons # Custom Mac Boot Picker icons
Custom boot picker icons is much more complicated on Legacy Macs, on late 2013+ Macs the [Custom OpenCore icons](#custom-opencore-icons) method will work just fine. However on many 2012 and older Macs, the icons generated will be incompatible with the firmware. Custom boot picker icons are much more complicated on Legacy Macs. On late 2013+ Macs, the [Custom OpenCore icons](#custom-opencore-icons) method will work just fine. However, on many 2012 and older Macs, the icons generated will be incompatible with the firmware.
To generate legacy icons, you'll need the following: To generate legacy icons, you'll need the following:
* A machine running macOS 10.4 through 10.11 * A machine running macOS 10.4 through 10.11
* Icon Composer.app (Requires Apple Developer Account for official download) * Icon Composer.app (Requires Apple Developer Account for official download)
* Users without the developer account can find a mirrors here: * Users without a developer account can find mirrors here:
* [Icon Composer 10.6](https://github.com/dortania/OpenCore-Legacy-Patcher/blob/main/docs/Icon-Composer-10.6.zip) * [Icon Composer 10.6](https://github.com/dortania/OpenCore-Legacy-Patcher/blob/main/docs/Icon-Composer-10.6.zip)
* [Icon Composer 10.11](https://github.com/dortania/OpenCore-Legacy-Patcher/blob/main/docs/Icon-Composer-10.11.zip) * [Icon Composer 10.11](https://github.com/dortania/OpenCore-Legacy-Patcher/blob/main/docs/Icon-Composer-10.11.zip)
* PNG Image you wish to convert * PNG Image you wish to convert
@@ -69,15 +69,15 @@ Now run the app and simply drag the images to each section as so:
![](../images/icon-SL.png) ![](../images/icon-SL.png)
Now save and export the new icns Now save and export the new icns file.
# Installing updated icons # Installing updated icons
To install, please ensure that Vault is disabled when you built OpenCore. If you're unsure, simply rebuild OpenCore with the Patcher setting "Vault" set to false. To install, please ensure that Vault was disabled when you built OpenCore. If you're unsure, simply rebuild OpenCore with the Patcher setting "Vault" set to false.
* <span style="color:red"> Warning</span>: Editing your OpenCore EFI incorrectly can result in a bricked install. Please ensure you have a natively supported version of macOS installed to boot into in case of issues. * <span style="color:red"> Warning</span>: Editing your OpenCore EFI incorrectly can result in a bricked install. Please ensure you have a natively supported version of macOS installed to boot into in case of issues.
Now that you've verified you can edit OpenCore safely, you'll need to mount the drive that OpenCore is stored on. To do this, download [MountEFI](https://github.com/corpnewt/MountEFI) and run it: Now that you've verified that you can edit OpenCore safely, you'll need to mount the drive that OpenCore is stored on. To do this, download [MountEFI](https://github.com/corpnewt/MountEFI) and run it:
![](../images/mountefi.png) ![](../images/mountefi.png)
@@ -96,7 +96,7 @@ Now reboot and you should see your updated icon(s)!
### Updating Mac Boot Picker icons ### Updating Mac Boot Picker icons
To update the Mac Boot Picker icons is actually quite simple, on the root of your drive simply drop the icon onto the root of the drive with the name `.VolumeIcon.icns` Updating the Mac Boot Picker icons is actually quite simple. On the root of your drive, simply drop the icon into the root of the drive with the name `.VolumeIcon.icns`
![](../images/mac-icns-drive.png) ![](../images/mac-icns-drive.png)

View File

@@ -1,8 +1,8 @@
# Download and build macOS Installers # Download and build macOS Installers
This doc is centered around downloading and writing the macOS installer to a USB. If you're already familiar with how to do this, you can skip. This document is centered around downloading and writing the macOS installer to a USB drive. If you're already familiar with how to do this, you can skip this section.
* Note: 16GB+ USB will be required for the installer * Note: 16GB+ USB drive will be required for the installer
## Creating the installer ## Creating the installer
@@ -12,11 +12,11 @@ With OpenCore Legacy Patcher, our new GUI includes a download menu for macOS ins
For this guide, we'll be using the standard OpenCore-Patcher (GUI). For this guide, we'll be using the standard OpenCore-Patcher (GUI).
Once downloaded, open the app and you should be greeted with this menu: Once downloaded, open the app and you should be greeted by this menu:
![OCLP GUI Main Menu](../images/OCLP-GUI-Main-Menu.png) ![OCLP GUI Main Menu](../images/OCLP-GUI-Main-Menu.png)
First we'll want to select the "Create macOS Installer" button. This will present you with 2 options: First, we'll want to select the "Create macOS Installer" button. This will present you with 2 options:
![](../images/OCLP-GUI-Create-Installer-Menu.png) ![](../images/OCLP-GUI-Create-Installer-Menu.png)

View File

@@ -18,13 +18,13 @@ The below table will list all supported and unsupported functions of the patcher
Regarding OS support, see below: Regarding OS support, see below:
* Machines listing `YES - Ventura and older` means they cannot run macOS Ventura at this time. Machines with only `YES` can run all of the supported macOS versions offered by OpenCore Legacy Patcher.
| Support Entry | Supported OSes | Description | Comment | | Support Entry | Supported OSes | Description | Comment |
| :--- | :--- | :--- | :--- | | :--- | :--- | :--- | :--- |
| HostOS | macOS 10.9 - macOS 13 | Refers to OSes where running OpenCore-Patcher.app are supported | Supports 10.7+ if [Python 3.9 or higher](https://www.python.org/downloads/) is manually installed, simply run the `OpenCore-Patcher-GUI.command` located in the repo | | HostOS | macOS 10.10 - macOS 13 | Refers to OSes where running OpenCore-Patcher.app are supported | Supports 10.7+ if [Python 3.9 or higher](https://www.python.org/downloads/) is manually installed, simply run the `OpenCore-Patcher-GUI.command` located in the repo |
| TargetOS | macOS 11 - macOS 13 | Refers to OSes that can be patched to run with OpenCore | May support 10.4 and newer (in a potentially broken state). No support provided. | | TargetOS | macOS 11 - macOS 13 | Refers to OSes that can be patched to run with OpenCore | May support 10.4 and newer (in a potentially broken state). No support provided. |
* macOS Ventura installer creation requires 10.11 or later
### MacBook ### MacBook
| SMBIOS | Year | Supported | Comment | | SMBIOS | Year | Supported | Comment |
@@ -145,8 +145,8 @@ Regarding OS support, see below:
| :--- | :--- | :--- | :--- | | :--- | :--- | :--- | :--- |
| MacPro1,1 | Mid-2006 | <span style="color:red"> NO </span> | 32-Bit Firmware limitation | | MacPro1,1 | Mid-2006 | <span style="color:red"> NO </span> | 32-Bit Firmware limitation |
| MacPro2,1 | Mid-2007 | ^^ | ^^ | | MacPro2,1 | Mid-2007 | ^^ | ^^ |
| MacPro3,1 | Early 2008 | <span style="color:#30BCD5"> YES </span> | - UHCI/OHCI support in Public Beta, see current issues ([#1021](https://github.com/dortania/OpenCore-Legacy-Patcher/issesues/1021)) <br/>- Potential boot issues with stock Bluetooth card, recommend removing to avoid kernel panics | | MacPro3,1 | Early 2008 | <span style="color:#30BCD5"> YES </span> | - UHCI/OHCI support in Public Beta, see current issues ([#1021](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021)) <br/>- Potential boot issues with stock Bluetooth card, recommend removing to avoid kernel panics |
| MacPro4,1 | Early 2009 | ^^ | - Everything is supported as long as GPU is Metal capable <br/> - UHCI/OHCI support in Public Beta, see current issues ([#1021](https://github.com/dortania/OpenCore-Legacy-Patcher/issesues/1021))| | MacPro4,1 | Early 2009 | ^^ | - Everything is supported as long as GPU is Metal capable <br/> - UHCI/OHCI support in Public Beta, see current issues ([#1021](https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1021))|
| MacPro5,1 | Mid-2010, Mid-2012 | ^^ | ^^ | | MacPro5,1 | Mid-2010, Mid-2012 | ^^ | ^^ |
| MacPro6,1 | Late 2013 | ^^ | - CPU Power Management currently unsupported<br/> - No DRM support | | MacPro6,1 | Late 2013 | ^^ | - CPU Power Management currently unsupported<br/> - No DRM support |

View File

@@ -1,6 +1,6 @@
# Explaining the patches in OpenCore Legacy Patcher # Explaining the patches in OpenCore Legacy Patcher
In our patcher, there are numerous patches used to ensure a stable system. Here we're going to go over what patches are used and why we recommend or even require them. In our patcher, there are numerous patches used to ensure a stable system. Here, we're going to go over what patches are used and why we recommend or even require them.
* [OpenCore Settings](#opencore-settings) * [OpenCore Settings](#opencore-settings)
* [Injected Kexts](#injected-kexts) * [Injected Kexts](#injected-kexts)
@@ -8,7 +8,7 @@ In our patcher, there are numerous patches used to ensure a stable system. Here
## OpenCore Settings ## OpenCore Settings
Below is a run down of the main logic OpenCore Legacy Patcher uses to gain native support in macOS. Note that OpenCore's configuration is documented within [OpenCorePkg](https://github.com/acidanthera/OpenCorePkg) as well as on an online version provided by us: Below is a rundown of the main logic that OpenCore Legacy Patcher uses to gain native support in macOS. Note that OpenCore's configuration is documented within [OpenCorePkg](https://github.com/acidanthera/OpenCorePkg) as well as on an online version provided by us:
* [OpenCorePkg Online Docs](https://dortania.github.io/docs/latest/Configuration.html) * [OpenCorePkg Online Docs](https://dortania.github.io/docs/latest/Configuration.html)
@@ -139,6 +139,10 @@ Below is a run down of the main logic OpenCore Legacy Patcher uses to gain nativ
* Reason: Enables Content Caching when using VMM spoofing * Reason: Enables Content Caching when using VMM spoofing
* Logic: Adds args to NVRAM * Logic: Adds args to NVRAM
* Models: Any model using VMM spoofing * Models: Any model using VMM spoofing
* `amfi=0x80`
* Reason: Disables Apple Mobile File Integrity to allow for root patches
* Logic: Adds args to NVRAM
* Models: Any model that requires unsigned root patches
### UEFI -> ProtocolOverrides ### UEFI -> ProtocolOverrides
@@ -184,6 +188,16 @@ Below is an explanation of what Kexts OpenCore Legacy Patcher will inject into m
* RestrictEvents * RestrictEvents
* Reason: Disables memory errors on MacPro7,1 * Reason: Disables memory errors on MacPro7,1
* Models: Mac Pros and Xserves * Models: Mac Pros and Xserves
* CryptexFixup
* Reason: Installs non AVX2.0 Cryptex on non AVX2.0 CPUs
* Models: All CPUs Ivy Bridge and older
* AutoPkgInstaller
* Reason: Allows for automatic root patching
* NVMeFix
* Reason: Fixes 3rd party NVMe support
* RSRHelper
* Reason: Fixes Rapid Security Response Support on root patched installs
*
### Ethernet ### Ethernet
@@ -197,6 +211,23 @@ Below is an explanation of what Kexts OpenCore Legacy Patcher will inject into m
* Reason: Inject old Broadcom Ethernet kext to resolve networking in Big Sur * Reason: Inject old Broadcom Ethernet kext to resolve networking in Big Sur
* Logic: Patch out conflicting symbols to not collide existing BCM5701Ethernet * Logic: Patch out conflicting symbols to not collide existing BCM5701Ethernet
* Models: 2011 and older Broadcom Ethernet require * Models: 2011 and older Broadcom Ethernet require
* Intel82574L
* Reason: Resolves Ethernet Support on MacPros
* Models: MacPro3,1 - 5,1
* CatalinaIntelI210Ethernet
* Reason: Fixes Intel i210/i225 NIC support on pre-Ivy Macs
* AppleIntel8254XEthernet
* Reason: Resolves Ethernet Support on MacPros
* Models: MacPro3,1 - 5,1
### Firewire
* IOFireWireFamily
* Reason: Allows for FireWire Boot Support
* IOFireWireSBP2
* Reason: Allows for FireWire Boot Support
* IOFireWireSerialBusProtoColTransport
* Reason: Allows for FireWire Boot Support
### Maps ### Maps
@@ -215,14 +246,12 @@ Below is an explanation of what Kexts OpenCore Legacy Patcher will inject into m
### Wifi ### Wifi
* IO80211HighSierra * IO80211ElCap
* Reason: Re-inject Atheros wifi drivers from High Sierra * Reason: Re-inject WiFi drivers from El Capitan
* Logic: Patch out conflicting symbols to not collide existing IO80211Family * Models: BCM94328, BCM94322 and Atheros chipsets
* Models: Atheros cards * corecaptureElCap.kext
* IO80211Mojave * Reason: Re-inject WiFi drivers from El Capitan
* Reason: Re-inject Broadcom wifi drivers from Mojave * Models: BCM94328, BCM94322 and Atheros chipsets
* Logic: Patch out conflicting symbols to not collide existing IO80211Family
* Models: BCM94322
### Misc ### Misc
@@ -238,6 +267,40 @@ Below is an explanation of what Kexts OpenCore Legacy Patcher will inject into m
* SMC-Spoof * SMC-Spoof
* Reason: Spoofs SMC version to 9.9999 * Reason: Spoofs SMC version to 9.9999
* Models: All models require when spoofing minimal or higher * Models: All models require when spoofing minimal or higher
* AppleRAIDCard
* Adds AppleRaidCard Support for Xserves
* AMDGPUWakeHandler
* Reason: Adds Software Based Demux for 2011 15/17 Macbook Pros
* AppleIntelCPUPowerManagement and AppleIntelCPUPowerManagementClient
* Reason: Restores Ivy Bridge and older CPU Power Management
* AppleUSBTopCase
* Reason: Restore USB Keyboard support on Mac OS Ventura
* AppleUSBMultitouch and AppleUSBTrackpad
* Reason: Restore USB Trackpad support on Mac OS Ventura
* ASPP-Override
* Reason: Forces ACPI_SMC_PlatformPlugin to outmatch X86PlatformPlugin and disable firmware throttling
* BacklightInjector
* Reason: Fixes Brightness in iMacs with upgraded GPUs
* BigSurSDXC
* Reason: Restores SDXC Support in Pre Ivy-Bridge Macs
* Bluetooth-spoof
* Reason: Spoofs legacy Bluetooth to work on Monterey and newer
* Innie
* Reason: Makes all PCIe drives appear internal
* Models: MacPro3,1 and newer & Xserve3,1 and newer
* KDKlessWorkaround
* Reason: Helps with Mac os updates on KDKless patched systems
* LegacyUSBVieoSupport
* Reason: Fixes Legacy USB iSight support
* MonteAHCIPort
* Reason: Fixes SSD support for stock SSD found in MacBookAir6,x
* NoAVXFSCompressionTypeZlib
* Reason: Prevents AVXFSCompressionTypeZlib crash on pre AVX1.0 systems in 12.4+
* SimpleMSR
* Reason: Disables BD PROCHOT to prevent firmware throttling on Nehalem+ MacBooks
::: :::
## On-Disk Patches ## On-Disk Patches
@@ -286,6 +349,15 @@ Applicable for BCM94328, BCM94322 and Atheros Wifi cards
* OpenCL (libCLVMNVPTXPlugin.dylib, NVPTX.dylib) * OpenCL (libCLVMNVPTXPlugin.dylib, NVPTX.dylib)
* Reason: Re-add Kepler hardware acceleration support * Reason: Re-add Kepler hardware acceleration support
* Metal
* Reason: 3802 based GPU's broken by 13.3, requiring a Metal downgrade to 13.2.1
### PrivateFrameworks
* MTLCompiler
* Reason: 3802 based GPU's broken by 13.3, requiring a MTLCompiler downgrade to 13.2.1
* GPUCompiler
* Reason: 3802 based GPU's broken by 13.3, requiring a GPUCompiler downgrade to 13.2.1
::: :::
@@ -306,6 +378,10 @@ Applicable for BCM94328, BCM94322 and Atheros Wifi cards
* AppleGVA/AppleGVACore * AppleGVA/AppleGVACore
* Reason: Enable DRM support * Reason: Enable DRM support
* MTLCompiler
* Reason: 3802 based GPU's broken by 13.3, requiring a MTLCompiler downgrade to 13.2.1
* GPUCompiler
* Reason: 3802 based GPU's broken by 13.3, requiring a GPUCompiler downgrade to 13.2.1
### Frameworks ### Frameworks
@@ -313,12 +389,117 @@ Applicable for BCM94328, BCM94322 and Atheros Wifi cards
* Reason: Re-add Ivy Bridge hardware acceleration support * Reason: Re-add Ivy Bridge hardware acceleration support
* WebKit (com.apple.WebProcess.sb) * WebKit (com.apple.WebProcess.sb)
* Reason: Re-add Ivy Bridge Safari rendering support * Reason: Re-add Ivy Bridge Safari rendering support
* Metal
* Reason: 3802 based GPU's broken by 13.3, requiring a Metal downgrade to 13.2.1
::: :::
::: details non-Metal Graphics Acceleration Patches (11.0+) ::: details Intel Haswell Graphics Acceleration Patches (13.0+)
### Extensions ### Extensions
* AppleIntelFramebufferAzul.kext
* AppleIntelHD5000Graphics.kext
* AppleIntelHD5000GraphicsGLDriver.bundle
* AppleIntelHD5000GraphicsMTLDriver.bundle
* AppleIntelHD5000GraphicsVADriver.bundle
* AppleIntelHSWVA.bundle
* AppleIntelGraphicsShared.bundle
### Frameworks
* Metal
* Reason: 3802 based GPU's broken by 13.3, requiring a Metal downgrade to 13.2.1
### PrivateFrameworks
* MTLCompiler
* Reason: 3802 based GPU's broken by 13.3, requiring a MTLCompiler downgrade to 13.2.1
* GPUCompiler
* Reason: 3802 based GPU's broken by 13.3, requiring a GPUCompiler downgrade to 13.2.1
:::
::: details Intel Broadwell Graphics Acceleration Patches (13.0+)
### Extensions
* AppleIntelBDWGraphics.kext
* AppleIntelBDWGraphicsFramebuffer.kext
* AppleIntelBDWGraphicsGLDriver.bundle
* AppleIntelBDWGraphicsMTLDriver.bundle
* AppleIntelBDWGraphicsVADriver.bundle
* AppleIntelBDWGraphicsVAME.bundle
* AppleIntelGraphicsShared.bundle
:::
::: details Intel Skylake Graphics Acceleration Patches (13.0+)
### Extensions
* AppleIntelSKLGraphics.kext
* AppleIntelSKLGraphicsFramebuffer.kext
* AppleIntelSKLGraphicsGLDriver.bundle
* AppleIntelSKLGraphicsMTLDriver.bundle
* AppleIntelSKLGraphicsVADriver.bundle
* AppleIntelSKLGraphicsVAME.bundle
* AppleIntelGraphicsShared.bundle
:::
::: details AMD Legacy Vega Graphics Acceleration Patches (13.0+)
### Extensions
* AMDRadeonX5000.kext
* AMDRadeonVADriver2.bundle
* AMDRadeonX5000GLDriver.bundle
* AMDRadeonX5000MTLDriver.bundle
* AMDRadeonX5000Shared.bundle
* AMDShared.bundle
:::
::: details AMD Legacy Polaris Graphics Acceleration Patches (13.0+)
### Extensions
* AMDRadeonX4000.kext
* AMDRadeonX4000HWServices.kext
* AMDRadeonVADriver2.bundle
* AMDRadeonX4000GLDriver.bundle
* AMDMTLBronzeDriver.bundle
* AMDShared.bundle
:::
::: details AMD Legacy GCN Graphics Acceleration Patches
### Extensions
* AMD7000Controller.kext
* AMD8000Controller.kext
* AMD9000Controller.kext
* AMD9500Controller.kext
* AMD10000Controller.kext
* AMDRadeonX4000.kext
* AMDRadeonX4000HWServices.kext
* AMDFramebuffer.kext
* AMDSupport.kext
* AMDRadeonVADriver.bundle
* AMDRadeonVADriver2.bundle
* AMDRadeonX4000GLDriver.bundle
* AMDMTLBronzeDriver.bundle
* AMDShared.bundle
::: details non-Metal Graphics Acceleration Patches (11.0+)
#### General Patches #### General Patches
* IOSurface.kext * IOSurface.kext
@@ -343,6 +524,19 @@ Applicable for BCM94328, BCM94322 and Atheros Wifi cards
* 0x1ea59a - 0x1ea5b3: nop * 0x1ea59a - 0x1ea5b3: nop
* Replace VSLGestalt to IOLockLock or any other known symbol of the same length. * Replace VSLGestalt to IOLockLock or any other known symbol of the same length.
* NVIDIA Web Drivers Binaries
* GeForceWeb.kext
* NVDAGF100HalWeb.kext
* NVDAGK100HalWeb.kext
* NVDAGM100HalWeb.kext
* NVDAGP100HalWeb.kext
* NVDAResmanWeb.kext
* NVDAStartupWeb.kext
* GeForceTeslaWeb.kext
* NVDANV50HalTeslaWeb.kext
* NVDAResmanTeslaWeb.kext
* Reason: Allows for non-Metal Acceleration for NVIDIA Maxwell and Pascal GPUs
* AMD/ATI Binaries * AMD/ATI Binaries
* AMD2400Controller.kext * AMD2400Controller.kext
* AMD2600Controller.kext * AMD2600Controller.kext

View File

@@ -32,7 +32,7 @@ Once you've toggled them both off, build your OpenCore EFI once again and instal
For many users, SIP will be lowered by default on build. For Intel HD 4000 users, you may have noticed that SIP is partially disabled. This is to ensure full compatibility with macOS Monterey and allow seamless booting between it and older OSes. However for users who do not plan to boot Monterey, you can re-enable under Patcher Settings. For many users, SIP will be lowered by default on build. For Intel HD 4000 users, you may have noticed that SIP is partially disabled. This is to ensure full compatibility with macOS Monterey and allow seamless booting between it and older OSes. However for users who do not plan to boot Monterey, you can re-enable under Patcher Settings.
Note: Machines running macOS Ventura or systems with non-Metal GPUs cannot enable SIP outright, due to having a patched root volume. Enabling will brick the installation. Note: Machines running macOS Ventura or systems with non-Metal GPUs cannot enable SIP outright, due to having a patched root volume. Enabling it will brick the installation.
| SIP Enabled | SIP Lowered (Root Patching) | SIP Disabled | | SIP Enabled | SIP Lowered (Root Patching) | SIP Disabled |
| :--- | :--- | :--- | | :--- | :--- | :--- |
@@ -79,7 +79,7 @@ With macOS Ventura and Macs with AMD Legacy GCN GPUs (ie. Metal), Root Patching
* [Apple's Developer Download Page](https://developer.apple.com/download/all/?q=Kernel%20Debug%20Kit) * [Apple's Developer Download Page](https://developer.apple.com/download/all/?q=Kernel%20Debug%20Kit)
Grab the closet Kernel Debug Kit to the OS you installed, and install it to the machine running Ventura. Grab the Kernel Debug Kit whose version is closest to the OS you installed, and install it to the machine running Ventura.
Machines that require this are those with AMD Metal dGPUs: Machines that require this are those with AMD Metal dGPUs:
* 2008 - 2013 Mac Pros (MacPro3,1 - 6,1) * 2008 - 2013 Mac Pros (MacPro3,1 - 6,1)
@@ -88,7 +88,7 @@ Machines that require this are those with AMD Metal dGPUs:
::: :::
Below entires represent GPUs no longer natively supported, ie. requiring root volume patch with OpenCore Legacy Patcher: Below entries represent GPUs no longer natively supported, ie. requiring root volume patching with OpenCore Legacy Patcher:
:::details GPUs requiring patching in macOS Big Sur :::details GPUs requiring patching in macOS Big Sur

View File

@@ -6,7 +6,7 @@ With OpenCore Legacy Patcher, we use a lot of different terms to refer to hardwa
Term | Description Term | Description
--- | --- --- | ---
**macOS** | Apple's own UNIX based OS used for Mac machines and "What makes a Mac a Mac". **macOS** | Apple's own UNIX based OS used for Mac machines and is "What makes a Mac a Mac".
**Windows** | Microsoft's proprietary OS that is used and supported on a wide range of devices **Windows** | Microsoft's proprietary OS that is used and supported on a wide range of devices
**Linux** | Family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution. Note that while macOS and Linux may be UNIX-based, they're vastly different. **Linux** | Family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged in a Linux distribution. Note that while macOS and Linux may be UNIX-based, they're vastly different.
**Bootloader** | Piece of software that loads an OS, usually made by the OS creators. OpenCore is technically not a bootloader per se (see boot manager explanation down below). Apple's Boot.efi would be the actual boot loader in a Mac. **Bootloader** | Piece of software that loads an OS, usually made by the OS creators. OpenCore is technically not a bootloader per se (see boot manager explanation down below). Apple's Boot.efi would be the actual boot loader in a Mac.
@@ -31,9 +31,9 @@ Term | Description
Term | Description Term | Description
--- | --- --- | ---
**EFI** | It can denote two things: <br/>- Mac's firmware, which is the same as UEFI, but pretty modified for Macs only, so not so "Universal" <br/>- The partition on your hard drive that stores software read by the UEFI to load OSes (like the Windows bootloader) or UEFI Applications (like OpenCore), it's FAT32 formatted and has an ID type of EF00 (in hex). It can be named ESP or SYSTEM, and it's usually from 100MB to 400MB in size but the size doesn't reflect upon anything. **EFI** | It can denote two things: <br/>- Mac's firmware, which is the same as UEFI, but pretty modified for Macs only, so not so "Universal" <br/>- The partition on your hard drive that stores software read by the UEFI to load OSes (like the Windows bootloader) or UEFI Applications (like OpenCore), it's FAT32 formatted and has an ID type of EF00 (in hex). It can be named ESP or SYSTEM, and it's usually from 100MB to 400MB in size but the size doesn't reflect upon anything.
**HFS+** | Also known as MacOS Journaled, this was the default macOS drive format up until macOS 10.13, format was designed around spinning disks **HFS+** | Also known as Mac OS Extended (Journaled), this was the default macOS drive format up until macOS 10.13. It was designed around spinning disks.
**APFS** | This was the default macOS drive from macOS 10.13 and onwards for SSDs, and standard for all drives in Mojave. Format was designed around SSDs primarily. **APFS** | This is the default macOS drive format from macOS 10.13 and onwards for SSDs, and standard for all drives in Mojave. This format was designed primarily around SSDs.
**32 and 64-Bit CPU** | The bit number of a CPU determines how much data a CPU can address. <br/>- 32-Bit CPUs were only supported up-to Mac OS X 10.6, Snow Leopard. **32 and 64-Bit CPU** | The bit number of a CPU determines how much data a CPU can address. <br/>- 32-Bit CPUs were only supported up-to Mac OS X 10.6, Snow Leopard.
**32-Bit Firmware** | The bit number of a Firmware determines how much data the firmware can address. In some older Macs, it's common to have a 64-Bit CPU can have a 32-Bit firmware<br/>- 32-Bit Firmwares were only supported up-to Mac OS X 10.7, Lion. **32-Bit Firmware** | The bit number of a Firmware determines how much data the firmware can address. In some older Macs, it's common to have a 64-Bit CPU with a 32-Bit firmware<br/>- 32-Bit Firmwares were only supported up-to Mac OS X 10.7, Lion.
**SSE Instructions** | Also known as **S**IMD **S**ingle-Precision Floating-Point **I**nstructions, these are defined as instruction sets supported by your CPU. In macOS, there are a certain number of instruction sets required for normal operation: <br/>- SSE3: Required for all Intel CPUs since Mac OS X 10.4, Tiger <br/>- SSSE3: Required for all Intel 64-Bit CPUs since Mac OS X 10.6, Snow Leopard <br/>- SSE4.1: Required for all Intel CPUs since macOS 10.12, Sierra **SSE Instructions** | Also known as **S**IMD **S**ingle-Precision Floating-Point **I**nstructions, these are defined as instruction sets supported by your CPU. In macOS, there are a certain number of instruction sets required for normal operation: <br/>- SSE3: Required for all Intel CPUs since Mac OS X 10.4, Tiger <br/>- SSSE3: Required for all Intel 64-Bit CPUs since Mac OS X 10.6, Snow Leopard <br/>- SSE4.1: Required for all Intel CPUs since macOS 10.12, Sierra
--- ---

View File

@@ -6,7 +6,7 @@ To aid users in troubleshooting, we've compiled a list of users who've reported
| SMBIOS | Tested | Tester | Model | Version | Comment | | SMBIOS | Tested | Tester | Model | Version | Comment |
| :--- | :--- | :--- | :--- | :--- | :--- | | :--- | :--- | :--- | :--- | :--- | :--- |
| MacBook4,1 | <span style="color:#30BCD5"> YES </span> | Mami | Stock | Unknown | Couldn't install due to broke USB support | | MacBook4,1 | <span style="color:#30BCD5"> YES </span> | Mami | Stock | Unknown | Couldn't install due to broken USB support |
| MacBook5,1 | ^^ | air.man | ^^ | 0.0.19 | N/A | | MacBook5,1 | ^^ | air.man | ^^ | 0.0.19 | N/A |
| MacBook5,2 | ^^ | Finder352 | ^^ | ^^ | ^^ | | MacBook5,2 | ^^ | Finder352 | ^^ | ^^ | ^^ |
| MacBook6,1 | ^^ | Finder352 | ^^ | ^^ | ^^ | | MacBook6,1 | ^^ | Finder352 | ^^ | ^^ | ^^ |

View File

@@ -1,6 +1,6 @@
# Troubleshooting # Troubleshooting
Here are some common errors users may experience while using this patcher: Here are some common errors that users may experience while using this patcher:
* [OpenCore Legacy Patcher not launching](#opencore-legacy-patcher-not-launching) * [OpenCore Legacy Patcher not launching](#opencore-legacy-patcher-not-launching)
* [Stuck on `This version of Mac OS X is not supported on this platform`](#stuck-on-this-version-of-mac-os-x-is-not-supported-on-this-platform) * [Stuck on `This version of Mac OS X is not supported on this platform`](#stuck-on-this-version-of-mac-os-x-is-not-supported-on-this-platform)
@@ -46,7 +46,7 @@ Reminder that once this is done, you'll need to select OpenCore in the boot pick
With OpenCore Legacy Patcher, we rely on Apple Secure Boot to ensure OS updates work correctly and reliably with Big Sur. However this installs NVRAM variables that will confuse your Mac if not running with OpenCore. To resolve this, simply uninstall OpenCore and [reset NVRAM](https://support.apple.com/en-mide/HT201255). With OpenCore Legacy Patcher, we rely on Apple Secure Boot to ensure OS updates work correctly and reliably with Big Sur. However this installs NVRAM variables that will confuse your Mac if not running with OpenCore. To resolve this, simply uninstall OpenCore and [reset NVRAM](https://support.apple.com/en-mide/HT201255).
* Note: Machines with modded root volumes will also result in an infinite recovery loop until integrity is restored. * Note: Machines with modified root volumes will also result in an infinite recovery loop until integrity is restored.
## Reboot when entering Hibernation (`Sleep Wake Failure`) ## Reboot when entering Hibernation (`Sleep Wake Failure`)
@@ -92,11 +92,11 @@ As a work-around, we recommend users try out the below app:
With OCLP v0.2.5, we've added support for legacy Wi-Fi on Monterey. However, some users may have noticed that they can't connect to wireless networks. With OCLP v0.2.5, we've added support for legacy Wi-Fi on Monterey. However, some users may have noticed that they can't connect to wireless networks.
To work-around this, we recommend that users manually connect using the "other" option in the Wi-Fi menu bar or manually adding the network in the "Network" preference pane. To work-around this, we recommend that users manually connect using the "Other" option in the Wi-Fi menu bar or manually adding the network in the "Network" preference pane.
## No Graphics Acceleration ## No Graphics Acceleration
In macOS, GPU drivers are often dropped from the OS with each major release of it. With macOS Big Sur, currently all non-Metal GPUs require additional patches to gain acceleration. In addition, macOS Monterey removed Graphics Drivers for both Intel Ivy Bridge and NVIDIA Kepler graphics processors. In macOS, GPU drivers are often dropped from the OS with each major release of it. With macOS Big Sur, currently, all non-Metal GPUs require additional patches to gain acceleration. In addition, macOS Monterey removed Graphics Drivers for both Intel Ivy Bridge and NVIDIA Kepler graphics processors.
If you're using OCLP v0.4.4, you should have been prompted to install Root Volume patches after the first boot from installation of macOS. If you need to do this manually, you can do so within the patcher app. Once rebooted, acceleration will be re-enabled as well as brightness control for laptops. If you're using OCLP v0.4.4, you should have been prompted to install Root Volume patches after the first boot from installation of macOS. If you need to do this manually, you can do so within the patcher app. Once rebooted, acceleration will be re-enabled as well as brightness control for laptops.
@@ -151,7 +151,7 @@ Because of this, we recommend placing a USB 2.0/3.0 hub between your devices and
A common area for systems to get "stuck", namely for units that are missing the `AES` CPU instruction/older mobile hardware. During this stage, a lot of heavy cryptography is performed, which can make systems appear to be stuck. In reality they are working quite hard to finish up the installation. A common area for systems to get "stuck", namely for units that are missing the `AES` CPU instruction/older mobile hardware. During this stage, a lot of heavy cryptography is performed, which can make systems appear to be stuck. In reality they are working quite hard to finish up the installation.
Because this step can take a few hours or more depending on drive speeds, be patient at this stage and do not manually power off or reboot your machine as this will break the installation and require you to reinstall. If you think your system has stalled, press the Caps Lock key. If the light turns on, your system is busy. Because this step can take a few hours or more depending on drive speeds, be patient at this stage and do not manually power off or reboot your machine as this will break the installation and require you to reinstall. If you think your system has stalled, press the Caps Lock key. If the light turns on, your system is busy and not actually frozen.
## No acceleration after a Metal GPU swap on Mac Pro ## No acceleration after a Metal GPU swap on Mac Pro

View File

@@ -7,7 +7,7 @@ To remove OpenCore:
* You'll need to mount the drive's EFI partition, and delete the `EFI/OC` and `System` folders * You'll need to mount the drive's EFI partition, and delete the `EFI/OC` and `System` folders
* Note: **Do not** delete the entire EFI folder, this will likely break any existing Windows and Linux installations. * Note: **Do not** delete the entire EFI folder, this will likely break any existing Windows and Linux installations.
* [See here for an example on how to mount](https://dortania.github.io/OpenCore-Post-Install/universal/oc2hdd.html) * [See here for an example on how to mount](https://dortania.github.io/OpenCore-Post-Install/universal/oc2hdd.html)
* For 5k iMac users, you will also need to delete `boot.efi` on the root of the EFI partition. * For 5K iMac users, you will also need to delete `boot.efi` on the root of the EFI partition.
2. [Reset NVRAM](https://support.apple.com/HT204063) 2. [Reset NVRAM](https://support.apple.com/HT204063)

View File

@@ -29,7 +29,7 @@ Technical requirements:
* iPadOS 15.4 or newer (if applicable) * iPadOS 15.4 or newer (if applicable)
* OpenCore Legacy Patcher 0.4.3 or newer * OpenCore Legacy Patcher 0.4.3 or newer
Check the [table of models](#table-of-models) below to see whether you need to upgrade hardware and exactly what hardware is required to be changed based on the offending Macs listed. For help on how to upgrade the Wi-Fi card in older 2008-2011 models, refer to the Discord channel [#hardware](https://discord.gg/rqdPgH8xSN) if required. Check the [table of models](#table-of-models) below to see whether you need to upgrade hardware and exactly what hardware is required to be changed based on the offending Macs listed. For help on how to upgrade the Wi-Fi card in older 2008-2011 models, refer to the `#hardware` channel in the [Discord server](https://discord.gg/rqdPgH8xSN) if required.
@@ -253,7 +253,7 @@ Then, go to **SMBIOS Settings**, tick **Allow Native Spoofs**, set SMBIOS Spoof
Any model after the list of officially blacklisted Macs should be supported, but these are the earliest Macs with Universal Control support, and thus chosen for the sake of simplicity. Any model after the list of officially blacklisted Macs should be supported, but these are the earliest Macs with Universal Control support, and thus chosen for the sake of simplicity.
**Reminder:** Macs that are not listed on this table work without spoofing, including systems that do not natively support Monterey as long as the other requirements are met, since they aren't blacklisted. **Reminder:** Macs that are not listed on this table work without spoofing, including systems that do not natively support Monterey, as long as the other requirements are met, since they aren't blacklisted.
| Mac by name | Native SMBIOS | Spoof SMBIOS | Tested | Tested by | | Mac by name | Native SMBIOS | Spoof SMBIOS | Tested | Tested by |

View File

@@ -19,4 +19,4 @@ nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:OCLP-Version
![](../images/oclp-version.png) ![](../images/oclp-version.png)
From this, we can see that we're running a RELEASE version of OpenCore 0.6.8 built on March 27th, 2021 with Patcher Version 0.0.20! From this, we can see that we're running a RELEASE version of OpenCore 0.8.0 built on April 18th, 2022 with Patcher Version 0.4.5!

View File

@@ -39,11 +39,11 @@ The team is doing their best to investigate and fix the aforementioned issues, h
### AMD Polaris, Vega and Navi support on pre-2019 Mac Pros and pre-2012 iMacs ### AMD Polaris, Vega and Navi support on pre-2019 Mac Pros and pre-2012 iMacs
For users with 2008 to 2013 Mac Pros (MacPro3,1-6,1) and 2009 to 2011 iMacs (iMac9,1-12,2), keep in mind macOS Ventura now requires [AVX2.0 support in the CPU](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2) for native graphics acceleration. Thus while your GPU may be natively supported, you cannot run Ventura officially with these GPUs. For users with 2008 to 2013 Mac Pros (MacPro3,1-6,1) and 2009 to 2011 iMacs (iMac9,1-12,2), keep in mind that macOS Ventura now requires [AVX2.0 support in the CPU](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#Advanced_Vector_Extensions_2) for native graphics acceleration. Thus while your GPU may be natively supported, you cannot run Ventura officially with these GPUs.
* CPUs supporting AVX2.0 are Haswell or newer, which no pre-2019 Mac Pros can be upgraded with. * CPUs supporting AVX2.0 are Haswell or newer, which no pre-2019 Mac Pros can be upgraded with.
Currently at this time, OpenCore Legacy Patcher only supports patching the AMD Polaris and Vega Graphics stack to no longer require AVX2.0. We're recently received an AMD RX 6600 donation, so hopefully in the future the project can support AMD Navi with pre-Haswell Macs. However no time estimates can be given. Currently at this time, OpenCore Legacy Patcher only supports patching the AMD Polaris and Vega Graphics stack to no longer require AVX2.0. We're recently received an AMD RX 6600 donation, so hopefully in the future the project can support AMD Navi with pre-Haswell Macs. However, no time estimates can be given.
Following GPUs are applicable: Following GPUs are applicable:
@@ -80,7 +80,7 @@ With OpenCore Legacy Patcher v0.6.0, basic support has been implemented via Root
### Ethernet issue with Early 2008 Mac Pro ### Ethernet issue with Early 2008 Mac Pro
MacPro3,1 suffers from Ethernet driver dying after returning from sleep, current workaround is to use a USB Ethernet adapter or disable sleep. MacPro3,1 suffers from the Ethernet driver dying after returning from sleep, current workaround is to use a USB Ethernet adapter or disable sleep.
::: details Legacy Wireless Support (Resolved in v0.6.0 and newer) ::: details Legacy Wireless Support (Resolved in v0.6.0 and newer)

View File

@@ -1,102 +1,199 @@
# Installing UEFI Windows 10 # Installing Windows in UEFI Mode
* Guide based off of [cdf's Mac Pro Thread](https://forums.macrumors.com/threads/opencore-on-the-mac-pro.2207814/) Modern versions of Windows officially support two types of firmware: UEFI and BIOS. Users may want to boot Windows through the OCLP Bootpicker, but only UEFI Installations of Windows will show up in the OCLP Bootpicker.
Many older Macs do not "officially" support UEFI Windows installations, leading to installation failures and strange behaviour, but OCLP can be used to prevent almost all of these issues.
To install a UEFI copy of Windows is actually super simple! All it requires is to boot Windows' Installer through OpenCore to force a UEFI setup. Here we'll be going step by step in the process, including partitioning and such. ## Minimum Requirements
* Note: UEFI Windows is generally quite usable for Arrandale and newer models, however machines with Penryn CPUs may experience issues This guide will focus on the installation of Windows 10 without using Boot Camp Assistant. Windows 11 should also work, but its quirks will not be covered.
* Recommended Models:
* MacBookAir4,x - 5,x
* MacBookPro8,x - 10,x
* Macmini5,x - 6,x
* iMac11,x - 13,x
Once you know if your model is supported, you're good to go with the rest of this guide. * Due to hardware and firmware limitations, UEFI Windows installations are only recommended on the following machines:
* Newer models than listed here will already natively support UEFI Windows through Boot Camp. * 2015 MacBook or newer (MacBook8,x+)
* 2011 MacBook Air or newer (MacBookAir4,x+)
* 2011 MacBook Pro or newer (MacBookPro8,x+)
* 2011 Mac mini or newer (Macmini5,x+)
* 2009[^1] Mac Pro or newer (MacPro4,1+), upgraded GPU is preferred
* 2010 iMac or newer (iMac11,x+), upgraded GPU is preferred
* 2009[^2] Xserve (Xserve3,1), upgraded GPU is preferred
For MacPro4,1/5,1 and Xserve3,1 users, please be aware that Windows has troubles with automatic installation, so please refer to cdf's guide on manual installation:
* [cdf's Mac Pro Thread](https://forums.macrumors.com/threads/opencore-on-the-mac-pro.2207814/) [^1]: MacPro4,1 and MacPro5,1 systems experience issues with the Windows installer, follow the DISM installation section for instructions.
[^2]: Theoretically supported, not tested. Follow DISM installation section
## Disk Formatting If your machine is not listed, UEFI Windows will likely still install, but you may face stability/driver issues.
To start off, we'll need the following: ## Disk Partitioning and Formatting
* An 8GB USB drive for the Windows Installer The following is required for installation:
* A minimum of 30GB of free space on whichever drive you want to install Windows to * 8GB+ USB Drive for the Windows installer
* 30GB+ Free Space on an existing drive / empty drive for the Windows installation
First, let's format our drives with the following steps: ### Formatting the USB Drive
### USB Drive Formatting
Open Disk Utility in macOS and format the USB Drive as ExFat with the Master Boot Record scheme: Open Disk Utility in macOS and format the USB Drive as ExFat with the Master Boot Record scheme:
![](../images/windows-mbr-format.png) ![](../images/windows-mbr-format.png)
### Disk Formatting ### Formatting the Target Drive
Next, grab the drive you wish to install Windows on and partition it as ExFat (If formatting the entire drive, ensure it's using the GUID Partition Table scheme): Next, select the drive you wish to install Windows in Disk Utility on and partition it as ExFat (If formatting the entire drive, ensure it's using the GUID Partition Table scheme):
![](../images/windows-partition-1.png) ![](../images/windows-partition-1.png)
:::warning
Incorrectly erasing your drive can lead to data loss! Please verify that you are erasing the correct drive/partition.
:::
If you plan to use the same hard drive for macOS and Windows, we recommend creating a dedicated partition just for OpenCore. This lets Windows have the ESP to itself and OpenCore can stay within it's own bubble. If you plan to use the same hard drive for macOS and Windows, we recommend creating a dedicated partition just for OpenCore. This lets Windows have the ESP to itself and OpenCore can stay within it's own bubble.
Recommended size is 200MB and the partition format **must** be FAT32 for OpenCore to operate correctly. You will next want to install OpenCore onto the new partition, either moving from the ESP with [MountEFI](https://github.com/corpnewt/MountEFI) or rerunning the OpenCore-Patcher.app Recommended size is 200MB and the partition format **must** be FAT32 for OpenCore to operate correctly. You will next want to install OpenCore onto the new partition, either moving from the ESP with [MountEFI](https://github.com/corpnewt/MountEFI) or rerunning the OpenCore-Patcher.app
* Note 1: For machines with dedicated drives for Windows, having different partitions for OpenCore is not required. * Note 1: For machines with dedicated drives for Windows, having different partitions for OpenCore is not required.
* Note 2: We recommend uninstalling OpenCore from the ESP/EFI Partition when you create this new OpenCore partition to avoid confusion when selecting OpenCore builds in the Mac's boot picker. * Note 2: Having different partitions for OpenCore is not required if the Windows boot files detected by the stock Bootpicker are removed. See "Removing the Windows option from the stock bootpicker" for further information.
* Note 3: We recommend uninstalling OpenCore from the ESP/EFI Partition when you create this new OpenCore partition to avoid confusion when selecting OpenCore builds in the Mac's boot picker.
![](../images/windows-partition-2.png) ![](../images/windows-partition-2.png)
## Creating the Installer ## Creating the Windows Installer
First up, lets grab Windows's Installer at the below link: The latest Windows installation images can be downloaded from Microsoft using the following links:
* [Download Windows 10 Disc Image (ISO File)](https://www.microsoft.com/en-ca/software-download/windows10ISO) * [Download Windows 10 Disc Image (ISO File)](https://www.microsoft.com/en-ca/software-download/windows10ISO)
Next, mount the Windows 10 ISO: * [Download Windows 11 Disc Image (ISO File)](https://www.microsoft.com/en-ca/software-download/windows11)
Once the file is downloaded, mount the .iso image:
![](../images/windows-iso.png) ![](../images/windows-iso.png)
Then open terminal and run `rsync` on the USB drive (replace CCCOMA_X64 with the mounted ISO's name, as well as replacing W10USB with your USB drive's name): Then open terminal and use the `rsync` command with the disk image set as the source and your USB drive set as the target. (Replace "CCCOMA_X64" with the mounted image's partition name, and replace "InstallWin10" with your USB Drive's name).
``` ```
rsync -r -P /Volumes/CCCOMA_X64/ /Volumes/W10USB rsync -r -P /Volumes/CCCOMA_X64/ /Volumes/InstallWin10
``` ```
::: details If you get an error about install.wim
One of the files, `install.wim`, may be too big for the FAT32 file system to hold. If this is the case, you should enter the commands below rather than the one above. This assumes you have `wimlib` installed, if not you can install it with [Homebrew](https://brew.sh):
```
# Copy everything but the install.wim file
rsync -vha -P --exclude=sources/install.wim /Volumes/CCCOMA_X64/ /Volumes/W10USB
# Use wimlib to split the install.wim file into a size that fits
wimlib-imagex split /Volumes/CCCOMA_X64/sources/install.wim /Volumes/W10USB/sources/install.swm 4000
```
Once that's completed, you can continue.
:::
![](../images/rsync-progess.png) ![](../images/rsync-progess.png)
Command will take some time, so sit back and get some coffee. Once finished, the root of the USB drive should look as follows: The `rsync` command will take some time, so get some coffee and sit back. Once finished, the root of the USB drive should look as follows:
* Ensure that these folders and files are in the root of the USB drive, otherwise the USB will not boot.
![](../images/windows-rsync-done.png) ![](../images/windows-rsync-done.png)
Once done, lets reboot into OpenCore's Menu and you'll see a new Windows' entry: * Ensure that these folders and files are in the root of the USB drive, otherwise the USB will not boot.
* Note: Do not boot the installer outside of OpenCore as this will default back to the old MBR BIOS setup. Booting through OpenCore ensures Windows uses UEFI.
![](../images/oc-windows.png) ## Installation Process
From there, install Windows as normal and you'll get a new BootCamp entry in OpenCore's picker when done! Don't forget to run BootCamp's utilities installer as well to ensure Wi-Fi and other important features are functioning correctly. This can be downloaded from the BootCamp Assistant app in macOS, or with [brigadier](https://github.com/timsutton/brigadier) in Windows. Once you reboot your machine, you should see a new boot option in the OCLP Bootpicker labelled as "EFI Boot". It may or may not have the Boot Camp icon.
![](../images/oc-windows-done.png) :::warning
If you aren't booted into OCLP, you may see two boot options labelled "Windows" and "EFI Boot". Do not choose either of the options and boot into OCLP to continue.
:::
### Installation: Microsoft Method
Once booted into the Windows installer, proceed as you normally would on any Windows computer. If you see an error message containing “Windows could not prepare the computer to boot into the next phase of installation”, please follow the next portion of this guide (DISM Installation).
### Installation: DISM Deployment Method
Once booted into the Windows installer, proceed as you normally would until you reach the "Where do you want to install Windows" disk formatting section.
When you are prompted to select a drive, select your desired partition and delete it using "Delete". If you want to install Windows to an empty drive, erase every partition currently on the desired drive.
After your drive/partition is erased, press "New" to create the Windows system partitions.
![](../images/DISM-1.png)
You will be prompted to confirm the creation of the system partitions, press "OK".
![](../images/DISM-2.png)
Once the partitions are created, select the main (largest) partition and press "Format". This will format the partition using the NFTS file system.
![](../images/DISM-3.png)
After the installer formats the partition, open up the Command Prompt by pressing SHIFT + F10. Then run the `diskpart` command, and `list vol`. This will produce a list of volumes in your system, make sure to keep track of the drive letters of the main Windows partition (largest, NTFS), the EFI partition (100MB, FAT32), and the Windows installer (Usually Drive D). Run `exit` to close diskpart
![](../images/DISM-4.png)
Now, get a list of available Windows editions by running `dism /Get-WimInfo /WimFile:D:\Sources\install.wim` (substituting D with the Installer Drive Letter). This guide will use Option 6 for Windows 10 Pro.
![](../images/DISM-5.png)
You can now start the deployment process. Run `dism /Apply-Image /ImageFile:D:\Sources\install.wim /index:6 /ApplyDir:E:`, replacing "D" with the Installer Drive Letter, "6" with the Windows edition option, and "E" with the Windows Partition Drive Letter.
![](../images/DISM-6.png)
Once `dism` finishes its thing, run `bcdboot E:\Windows`, substituting "E" for the drive letter of the main Windows partition to create the boot files.
![](../images/DISM-7.png)
Windows is now installed. It should be recognized as "EFI Boot" with a Boot Camp icon in the OCLP Bootpicker.
:::warning
After the boot files are created, **DO NOT** reboot if you are using a MacPro4,1, MacPro5,1, or Xserve3,1 system! A bug in the Windows bootloader exists that will completely brick the system if it is loaded through the stock bootpicker. See the "Installation: Removing the Windows option from the stock bootpicker" section for a workaround.
:::
### Installation: Removing the Windows option from the stock bootpicker
Removing the Windows boot option from the stock bootpicker is **HIGHLY RECOMMENDED** on MacPro4,1, MacPro5,1, and Xserve3,1 systems in order to prevent Secure Boot NVRAM corruption and bricking.
Start up a command prompt window in the Windows Setup environment by running `cmd`.
Next, enter the EFI Folder by running `C:`, substituting "C" for the EFI Partition Drive Letter. Then run `cd EFI` to enter the EFI Partition. Then, run `rmdir Boot /S /Q` to remove the boot files that can be detected by the stock Bootpicker. The OCLP Picker will still be able to detect and boot Windows.
![](../images/DISM-8.png)
You can verify that the `Boot` folder is removed by running the `dir` command:
![](../images/DISM-9.png)
If, for whatever reason, you are not able to remove the boot files from the Windows setup, shut down your system, boot into macOS, mount your EFI partition with [MountEFI](https://github.com/corpnewt/MountEFI), and remove the `Boot` folder (it should have a recent file modification date, and contain `Bootx64.efi`).
## Post-Installation
### Installing Boot Camp Software
To get started, download the Brigadier utility from the following link:
* [Download Brigadier](https://github.com/timsutton/brigadier/releases/download/0.2.4/brigadier.exe)
Once Brigadier is downloaded, move it to your desktop for easy access.
Open up a command prompt window as a standard user and run `cd desktop`.
![](../images/BOOTCAMP-1.png)
Then run `.\brigadier.exe --model=MODEL1,1`, replacing "MODEL1,1" with your machine's SMBIOS model.
![](../images/BOOTCAMP-2.png)
Once the Boot Camp software is downloaded, you can install it by executing `Setup.exe` or `\Drivers\Apple\BootCamp.msi` (`BootCamp64.msi` if present).
### Installing Boot Camp 6 softare on unsupported machines
To get started, download the Brigadier utility from the following link:
* [Download Brigadier](https://github.com/timsutton/brigadier/releases/download/0.2.4/brigadier.exe)
Once Brigadier is downloaded, move it to your desktop for easy access.
Open up a command prompt window as a standard user and run `cd desktop`.
![](../images/BOOTCAMP-1.png)
Then run `.\brigadier.exe --model=MacPro7,1`. This will download the latest BootCamp 6 package.
![](../images/BOOTCAMP-2.png)
Once the Boot Camp software is downloaded, you can install Boot Camp 6 by executing `\Drivers\Apple\BootCamp.msi` in an administrator command prompt window.
## Troubleshooting ## Troubleshooting
@@ -116,9 +213,9 @@ If needed, you can run it from the command line as administrator:
set __COMPAT_LAYER=WIN7RTM && start \path\to\BootCamp\Drivers\Apple\Bootcamp.msi' set __COMPAT_LAYER=WIN7RTM && start \path\to\BootCamp\Drivers\Apple\Bootcamp.msi'
``` ```
Make sure to substitute `\path\to` with the location of the BootCamp folder. Make sure to substitute `\path\to` with the location of the Boot Camp folder.
You can also open `Properties` on the file to change the compatibility to `Previous version of Windows` in case you have BootCamp 4.0 drivers (the above command does this already.) You can also open `Properties` on the file to change the compatibility to `Previous version of Windows` in case you have Boot Camp 4.0 drivers (the above command does this already.)
::: :::

BIN
images/BOOTCAMP-1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
images/BOOTCAMP-2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
images/DISM-1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
images/DISM-2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
images/DISM-3.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
images/DISM-4.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
images/DISM-5.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
images/DISM-6.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
images/DISM-7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
images/DISM-8.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/DISM-9.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -2611,6 +2611,8 @@
<false/> <false/>
<key>ForceResolution</key> <key>ForceResolution</key>
<false/> <false/>
<key>GopBurstMode</key>
<false/>
<key>GopPassThrough</key> <key>GopPassThrough</key>
<string>Disabled</string> <string>Disabled</string>
<key>IgnoreTextInGraphics</key> <key>IgnoreTextInGraphics</key>

Binary file not shown.

View File

@@ -23,7 +23,7 @@ KEXT_DICTIONARY = {
# }, # },
"BlueToolFixup": { "BlueToolFixup": {
"Repository": "https://github.com/acidanthera/BrcmPatchRAM", "Repository": "https://github.com/acidanthera/BrcmPatchRAM",
"Constants Variable": "self.bluetoolfixup_version", "Constants Variable": "self.bluetool_version",
"Override": "BrcmPatchRAM", "Override": "BrcmPatchRAM",
}, },
"CPUFriend": { "CPUFriend": {

Binary file not shown.

View File

@@ -62,6 +62,7 @@ UNUSED_TOOLS = [
"RtcRw.efi", "RtcRw.efi",
"CsrUtil.efi", "CsrUtil.efi",
"TpmInfo.efi", "TpmInfo.efi",
"ListPartitions.efi",
] ]
IMPORTANT_UTILITIES = [ IMPORTANT_UTILITIES = [

Binary file not shown.

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AssociatedBundleIdentifiers</key>
<string>com.dortania.opencore-legacy-patcher</string>
<key>Label</key>
<string>com.dortania.opencore-legacy-patcher.rsr-monitor</string>
<key>ProgramArguments</key>
<array>
<string>rm</string>
<string>-rf</string>
<string>/Library/Extensions/example.kext</string> <!-- Update kext to correct name -->
</array>
<key>WatchPaths</key>
<array>
<string>/System/Volumes/Preboot/UUID/cryptex1/OS.dmg</string> <!-- Update UUID to host's booted Preboot folder -->
</array>
</dict>
</plist>

View File

@@ -1,5 +0,0 @@
# Credit: CorpNewt
from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]

View File

@@ -0,0 +1,97 @@
import datetime
import plistlib
from pathlib import Path
import json
from resources import network_handler, constants, global_settings
DATE_FORMAT: str = "%Y-%m-%d %H-%M-%S"
ANALYTICS_SERVER: str = ""
SITE_KEY: str = ""
VALID_ENTRIES: dict = {
'KEY': str, # Prevent abuse (embedded at compile time)
'UNIQUE_IDENTITY': str, # Host's UUID as SHA1 hash
'APPLICATION_NAME': str, # ex. OpenCore Legacy Patcher
'APPLICATION_VERSION': str, # ex. 0.2.0
'OS_VERSION': str, # ex. 10.15.7
'MODEL': str, # ex. MacBookPro11,5
'GPUS': list, # ex. ['Intel Iris Pro', 'AMD Radeon R9 M370X']
'FIRMWARE': str, # ex. APPLE
'LOCATION': str, # ex. 'US' (just broad region, don't need to be specific)
'TIMESTAMP': datetime.datetime, # ex. 2021-09-01-12-00-00
}
class Analytics:
def __init__(self, global_constants: constants.Constants) -> None:
self.constants: constants.Constants = global_constants
if global_settings.GlobalEnviromentSettings().read_property("DisableCrashAndAnalyticsReporting") is True:
return
self._generate_base_data()
self._post_data()
def _get_country(self) -> str:
# Get approximate country from .GlobalPreferences.plist
path = "/Library/Preferences/.GlobalPreferences.plist"
if not Path(path).exists():
return "US"
try:
result = plistlib.load(Path(path).open("rb"))
except:
return "US"
if "Country" not in result:
return "US"
return result["Country"]
def _generate_base_data(self) -> None:
self.unique_identity = str(self.constants.computer.uuid_sha1)
self.application = str("OpenCore Legacy Patcher")
self.version = str(self.constants.patcher_version)
self.os = str( self.constants.detected_os_version)
self.model = str(self.constants.computer.real_model)
self.gpus = []
self.firmware = str(self.constants.computer.firmware_vendor)
self.location = str(self._get_country())
for gpu in self.constants.computer.gpus:
self.gpus.append(str(gpu.arch))
self.data = {
'KEY': SITE_KEY,
'UNIQUE_IDENTITY': self.unique_identity,
'APPLICATION_NAME': self.application,
'APPLICATION_VERSION': self.version,
'OS_VERSION': self.os,
'MODEL': self.model,
'GPUS': self.gpus,
'FIRMWARE': self.firmware,
'LOCATION': self.location,
'TIMESTAMP': str(datetime.datetime.now().strftime(DATE_FORMAT)),
}
# convert to JSON:
self.data = json.dumps(self.data)
def _post_data(self) -> None:
# Post data to analytics server
if ANALYTICS_SERVER == "":
return
if SITE_KEY == "":
return
network_handler.NetworkUtilities().post(ANALYTICS_SERVER, json = self.data)

View File

@@ -183,4 +183,4 @@ If you plan to create the USB for another machine, please select the "Change Mod
self.constants.allow_oc_everywhere = True self.constants.allow_oc_everywhere = True
self.constants.serial_settings = "None" self.constants.serial_settings = "None"
build.build_opencore(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)

View File

@@ -1,34 +1,49 @@
# Class for handling Bluetooth Patches, invocation from build.py # Class for handling Bluetooth Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import logging
from resources import constants, device_probe from resources import constants, device_probe
from resources.build import support from resources.build import support
from data import smbios_data, bluetooth_data from data import smbios_data, bluetooth_data
import logging
class build_bluetooth: class BuildBluetooth:
"""
Build Library for Bluetooth Support
def __init__(self, model, versions, config): Invoke from build.py
self.model = model """
self.constants: constants.Constants = versions
self.config = config def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.computer = self.constants.computer self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self._build()
def build(self): def _build(self) -> None:
# Bluetooth patches """
Kick off Bluetooth Build Process
"""
if not self.constants.custom_model and self.computer.bluetooth_chipset: if not self.constants.custom_model and self.computer.bluetooth_chipset:
self.on_model() self._on_model()
else: else:
self.prebuilt_assumption() self._prebuilt_assumption()
def on_model(self): def _on_model(self) -> None:
"""
On-Model Hardware Detection Handling
"""
if self.computer.bluetooth_chipset in ["BRCM2070 Hub", "BRCM2046 Hub"]: if self.computer.bluetooth_chipset in ["BRCM2070 Hub", "BRCM2046 Hub"]:
logging.info("- Fixing Legacy Bluetooth for macOS Monterey") logging.info("- Fixing Legacy Bluetooth for macOS Monterey")
support.build_support(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
support.build_support(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path)
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"
elif self.computer.bluetooth_chipset == "BRCM20702 Hub": elif self.computer.bluetooth_chipset == "BRCM20702 Hub":
# BCM94331 can include either BCM2070 or BRCM20702 v1 Bluetooth chipsets # BCM94331 can include either BCM2070 or BRCM20702 v1 Bluetooth chipsets
@@ -37,15 +52,19 @@ class build_bluetooth:
if self.computer.wifi: if self.computer.wifi:
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4360: if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4360:
logging.info("- Fixing Legacy Bluetooth for macOS Monterey") logging.info("- Fixing Legacy Bluetooth for macOS Monterey")
support.build_support(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
elif self.computer.bluetooth_chipset == "3rd Party Bluetooth 4.0 Hub": elif self.computer.bluetooth_chipset == "3rd Party Bluetooth 4.0 Hub":
logging.info("- Detected 3rd Party Bluetooth Chipset") logging.info("- Detected 3rd Party Bluetooth Chipset")
support.build_support(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
logging.info("- Enabling Bluetooth FeatureFlags") logging.info("- Enabling Bluetooth FeatureFlags")
self.config["Kernel"]["Quirks"]["ExtendBTFeatureFlags"] = True self.config["Kernel"]["Quirks"]["ExtendBTFeatureFlags"] = True
def prebuilt_assumption(self): def _prebuilt_assumption(self) -> None:
"""
Fall back to pre-built assumptions
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "Bluetooth Model" in smbios_data.smbios_dictionary[self.model]: if not "Bluetooth Model" in smbios_data.smbios_dictionary[self.model]:
@@ -53,7 +72,7 @@ class build_bluetooth:
if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM20702_v1.value: if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM20702_v1.value:
logging.info("- Fixing Legacy Bluetooth for macOS Monterey") logging.info("- Fixing Legacy Bluetooth for macOS Monterey")
support.build_support(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070.value: if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070.value:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"
support.build_support(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path)

View File

@@ -1,57 +1,69 @@
# Class for generating OpenCore Configurations tailored for Macs # Class for generating OpenCore Configurations tailored for Macs
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import copy import copy
import pickle import pickle
import plistlib import plistlib
import shutil import shutil
import zipfile import zipfile
import logging
from pathlib import Path from pathlib import Path
from datetime import date from datetime import date
import logging
from resources import constants, utilities from resources import constants, utilities
from resources.build import bluetooth, firmware, graphics_audio, support, storage, smbios, security, misc from resources.build import bluetooth, firmware, graphics_audio, support, storage, smbios, security, misc
from resources.build.networking import wired, wireless from resources.build.networking import wired, wireless
def rmtree_handler(func, path, exc_info): def rmtree_handler(func, path, exc_info) -> None:
if exc_info[0] == FileNotFoundError: if exc_info[0] == FileNotFoundError:
return return
raise # pylint: disable=misplaced-bare-raise raise # pylint: disable=misplaced-bare-raise
class build_opencore: class BuildOpenCore:
def __init__(self, model, versions): """
self.model = model Core Build Library for generating and validating OpenCore EFI Configurations
self.config = None compatible with genuine Macs
self.constants: constants.Constants = versions """
def __init__(self, model: str, global_constants: constants.Constants) -> None:
self.model: str = model
self.config: dict = None
self.constants: constants.Constants = global_constants
self._build_opencore()
def build_efi(self): def _build_efi(self) -> None:
"""
Build EFI folder
"""
utilities.cls() utilities.cls()
if not self.constants.custom_model: logging.info(f"Building Configuration {'for external' if self.constants.custom_model else 'on model'}: {self.model}")
logging.info(f"Building Configuration on model: {self.model}")
else:
logging.info(f"Building Configuration for external model: {self.model}")
self.generate_base() self._generate_base()
self.set_revision() self._set_revision()
# Set Lilu and co. # Set Lilu and co.
support.build_support(self.model, self.constants, self.config).enable_kext("Lilu.kext", self.constants.lilu_version, self.constants.lilu_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("Lilu.kext", self.constants.lilu_version, self.constants.lilu_path)
self.config["Kernel"]["Quirks"]["DisableLinkeditJettison"] = True self.config["Kernel"]["Quirks"]["DisableLinkeditJettison"] = True
# Call support functions # Call support functions
firmware.build_firmware(self.model, self.constants, self.config).build() for function in [
wired.build_wired(self.model, self.constants, self.config).build() firmware.BuildFirmware,
wireless.build_wireless(self.model, self.constants, self.config).build() wired.BuildWiredNetworking,
graphics_audio.build_graphics_audio(self.model, self.constants, self.config).build() wireless.BuildWirelessNetworking,
bluetooth.build_bluetooth(self.model, self.constants, self.config).build() graphics_audio.BuildGraphicsAudio,
storage.build_storage(self.model, self.constants, self.config).build() bluetooth.BuildBluetooth,
smbios.build_smbios(self.model, self.constants, self.config).build() storage.BuildStorage,
security.build_security(self.model, self.constants, self.config).build() smbios.BuildSMBIOS,
misc.build_misc(self.model, self.constants, self.config).build() security.BuildSecurity,
misc.BuildMiscellaneous
]:
function(self.model, self.constants, self.config)
# Work-around ocvalidate # Work-around ocvalidate
if self.constants.validate is False: if self.constants.validate is False:
@@ -59,8 +71,11 @@ class build_opencore:
self.config["Misc"]["BlessOverride"] += ["\\EFI\\Microsoft\\Boot\\bootmgfw.efi"] self.config["Misc"]["BlessOverride"] += ["\\EFI\\Microsoft\\Boot\\bootmgfw.efi"]
def generate_base(self): def _generate_base(self) -> None:
# Generate OpenCore base folder and config """
Generate OpenCore base folder and config
"""
if not Path(self.constants.build_path).exists(): if not Path(self.constants.build_path).exists():
logging.info("Creating build folder") logging.info("Creating build folder")
Path(self.constants.build_path).mkdir() Path(self.constants.build_path).mkdir()
@@ -85,8 +100,11 @@ class build_opencore:
self.config = plistlib.load(Path(self.constants.plist_path).open("rb")) self.config = plistlib.load(Path(self.constants.plist_path).open("rb"))
def set_revision(self): def _set_revision(self) -> None:
# Set revision in config """
Set revision information in config.plist
"""
self.config["#Revision"]["Build-Version"] = f"{self.constants.patcher_version} - {date.today()}" self.config["#Revision"]["Build-Version"] = f"{self.constants.patcher_version} - {date.today()}"
if not self.constants.custom_model: if not self.constants.custom_model:
self.config["#Revision"]["Build-Type"] = "OpenCore Built on Target Machine" self.config["#Revision"]["Build-Type"] = "OpenCore Built on Target Machine"
@@ -101,21 +119,35 @@ class build_opencore:
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Model"] = self.model self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Model"] = self.model
def save_config(self): def _save_config(self) -> None:
"""
Save config.plist to disk
"""
plistlib.dump(self.config, Path(self.constants.plist_path).open("wb"), sort_keys=True) plistlib.dump(self.config, Path(self.constants.plist_path).open("wb"), sort_keys=True)
def build_opencore(self): def _build_opencore(self) -> None:
"""
Kick off the build process
This is the main function:
- Generates the OpenCore configuration
- Cleans working directory
- Signs files
- Validates generated EFI
"""
# Generate OpenCore Configuration # Generate OpenCore Configuration
self.build_efi() self._build_efi()
if self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True or (self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != ""): if self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True or (self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != ""):
smbios.build_smbios(self.model, self.constants, self.config).set_smbios() smbios.BuildSMBIOS(self.model, self.constants, self.config).set_smbios()
support.build_support(self.model, self.constants, self.config).cleanup() support.BuildSupport(self.model, self.constants, self.config).cleanup()
self.save_config() self._save_config()
# Post-build handling # Post-build handling
support.build_support(self.model, self.constants, self.config).sign_files() support.BuildSupport(self.model, self.constants, self.config).sign_files()
support.build_support(self.model, self.constants, self.config).validate_pathing() support.BuildSupport(self.model, self.constants, self.config).validate_pathing()
logging.info("") logging.info("")
logging.info(f"Your OpenCore EFI for {self.model} has been built at:") logging.info(f"Your OpenCore EFI for {self.model} has been built at:")

View File

@@ -1,31 +1,50 @@
# Class for handling CPU and Firmware Patches, invocation from build.py # Class for handling CPU and Firmware Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
from resources import constants, generate_smbios import shutil
import logging
import binascii
from pathlib import Path
from resources import constants, generate_smbios, device_probe
from resources.build import support from resources.build import support
from data import smbios_data, cpu_data from data import smbios_data, cpu_data
import binascii, shutil, logging
from pathlib import Path
class build_firmware: class BuildFirmware:
"""
Build Library for CPU and Firmware Support
def __init__(self, model, versions, config): Invoke from build.py
self.model = model """
self.constants: constants.Constants = versions
self.config = config def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.computer = self.constants.computer self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self._build()
def build(self): def _build(self) -> None:
self.cpu_compatibility_handling() """
self.power_management_handling() Kick off CPU and Firmware Build Process
self.acpi_handling() """
self.firmware_driver_handling()
self.firmware_compatibility_handling() self._cpu_compatibility_handling()
self._power_management_handling()
self._acpi_handling()
self._firmware_driver_handling()
self._firmware_compatibility_handling()
def power_management_handling(self): def _power_management_handling(self) -> None:
"""
Power Management Handling
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]: if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]:
@@ -51,8 +70,8 @@ class build_firmware:
# #
# To resolve, we patched AICPUPM to attach regardless of the value of 'intel_cpupm_matching' # To resolve, we patched AICPUPM to attach regardless of the value of 'intel_cpupm_matching'
logging.info("- Enabling legacy power management support") logging.info("- Enabling legacy power management support")
support.build_support(self.model, self.constants, self.config).enable_kext("AppleIntelCPUPowerManagement.kext", self.constants.aicpupm_version, self.constants.aicpupm_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleIntelCPUPowerManagement.kext", self.constants.aicpupm_version, self.constants.aicpupm_path)
support.build_support(self.model, self.constants, self.config).enable_kext("AppleIntelCPUPowerManagementClient.kext", self.constants.aicpupm_version, self.constants.aicpupm_client_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleIntelCPUPowerManagementClient.kext", self.constants.aicpupm_version, self.constants.aicpupm_client_path)
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value or self.constants.disable_xcpm is True: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value or self.constants.disable_xcpm is True:
# With macOS 12.3 Beta 1, Apple dropped the 'plugin-type' check within X86PlatformPlugin # With macOS 12.3 Beta 1, Apple dropped the 'plugin-type' check within X86PlatformPlugin
@@ -61,18 +80,22 @@ class build_firmware:
# power management tables provided. # power management tables provided.
# This patch will simply increase ASPP's 'IOProbeScore' to outmatch X86PP # This patch will simply increase ASPP's 'IOProbeScore' to outmatch X86PP
logging.info("- Overriding ACPI SMC matching") logging.info("- Overriding ACPI SMC matching")
support.build_support(self.model, self.constants, self.config).enable_kext("ASPP-Override.kext", self.constants.aspp_override_version, self.constants.aspp_override_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("ASPP-Override.kext", self.constants.aspp_override_version, self.constants.aspp_override_path)
if self.constants.disable_xcpm is True: if self.constants.disable_xcpm is True:
# Only inject on older OSes if user requests # Only inject on older OSes if user requests
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Add"], "BundlePath", "ASPP-Override.kext")["MinKernel"] = "" support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Add"], "BundlePath", "ASPP-Override.kext")["MinKernel"] = ""
if self.constants.disable_msr_power_ctl is True and smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.nehalem.value: if self.constants.disable_msr_power_ctl is True and smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.nehalem.value:
logging.info("- Disabling Firmware Throttling") logging.info("- Disabling Firmware Throttling")
# Nehalem and newer systems force firmware throttling via MSR_POWER_CTL # Nehalem and newer systems force firmware throttling via MSR_POWER_CTL
support.build_support(self.model, self.constants, self.config).enable_kext("SimpleMSR.kext", self.constants.simplemsr_version, self.constants.simplemsr_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("SimpleMSR.kext", self.constants.simplemsr_version, self.constants.simplemsr_path)
def acpi_handling(self): def _acpi_handling(self) -> None:
"""
ACPI Table Handling
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]: if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]:
@@ -83,19 +106,23 @@ class build_firmware:
# IOPCIFamily will error when enumerating this device, thus we'll power it off via _STA (has no effect in older OSes) # IOPCIFamily will error when enumerating this device, thus we'll power it off via _STA (has no effect in older OSes)
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.nehalem.value and not (self.model.startswith("MacPro") or self.model.startswith("Xserve")): if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.nehalem.value and not (self.model.startswith("MacPro") or self.model.startswith("Xserve")):
logging.info("- Adding SSDT-CPBG.aml") logging.info("- Adding SSDT-CPBG.aml")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-CPBG.aml")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-CPBG.aml")["Enabled"] = True
shutil.copy(self.constants.pci_ssdt_path, self.constants.acpi_path) shutil.copy(self.constants.pci_ssdt_path, self.constants.acpi_path)
if cpu_data.cpu_data.sandy_bridge <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value and self.model != "MacPro6,1": if cpu_data.cpu_data.sandy_bridge <= smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value and self.model != "MacPro6,1":
# Based on: https://egpu.io/forums/pc-setup/fix-dsdt-override-to-correct-error-12/ # Based on: https://egpu.io/forums/pc-setup/fix-dsdt-override-to-correct-error-12/
# Applicable for Sandy and Ivy Bridge Macs # Applicable for Sandy and Ivy Bridge Macs
logging.info("- Enabling Windows 10 UEFI Audio support") logging.info("- Enabling Windows 10 UEFI Audio support")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-PCI.aml")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-PCI.aml")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "BUF0 to BUF1")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "BUF0 to BUF1")["Enabled"] = True
shutil.copy(self.constants.windows_ssdt_path, self.constants.acpi_path) shutil.copy(self.constants.windows_ssdt_path, self.constants.acpi_path)
def cpu_compatibility_handling(self): def _cpu_compatibility_handling(self) -> None:
"""
CPU Compatibility Handling
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]: if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]:
@@ -104,14 +131,14 @@ class build_firmware:
# SSE4,1 support (ie. Penryn) # SSE4,1 support (ie. Penryn)
# Required for macOS Mojave and newer # Required for macOS Mojave and newer
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value:
support.build_support(self.model, self.constants, self.config).enable_kext("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path)
support.build_support(self.model, self.constants, self.config).enable_kext("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("telemetrap.kext", self.constants.telemetrap_version, self.constants.telemetrap_path)
# Force Rosetta Cryptex installation in macOS Ventura # Force Rosetta Cryptex installation in macOS Ventura
# Restores support for CPUs lacking AVX2.0 support # Restores support for CPUs lacking AVX2.0 support
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.ivy_bridge.value:
logging.info("- Enabling Rosetta Cryptex support in Ventura") logging.info("- Enabling Rosetta Cryptex support in Ventura")
support.build_support(self.model, self.constants, self.config).enable_kext("CryptexFixup.kext", self.constants.cryptexfixup_version, self.constants.cryptexfixup_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("CryptexFixup.kext", self.constants.cryptexfixup_version, self.constants.cryptexfixup_path)
# i3 Ivy Bridge iMacs don't support RDRAND # i3 Ivy Bridge iMacs don't support RDRAND
# However for prebuilt, assume they do # However for prebuilt, assume they do
@@ -120,14 +147,14 @@ class build_firmware:
# Ref: https://github.com/reenigneorcim/SurPlus # Ref: https://github.com/reenigneorcim/SurPlus
# Enable for all systems missing RDRAND support # Enable for all systems missing RDRAND support
logging.info("- Adding SurPlus Patch for Race Condition") logging.info("- Adding SurPlus Patch for Race Condition")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random)")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random)")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng")["Enabled"] = True
if self.constants.force_surplus is True: if self.constants.force_surplus is True:
# Syncretic forces SurPlus to only run on Beta 7 and older by default for saftey reasons # Syncretic forces SurPlus to only run on Beta 7 and older by default for saftey reasons
# If users desires, allow forcing in newer OSes # If users desires, allow forcing in newer OSes
logging.info("- Allowing SurPlus on all newer OSes") logging.info("- Allowing SurPlus on all newer OSes")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random)")["MaxKernel"] = "" support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 1 of 2 - Patch read_erandom (inlined in _early_random)")["MaxKernel"] = ""
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng")["MaxKernel"] = "" support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "SurPlus v1 - PART 2 of 2 - Patch register_and_init_prng")["MaxKernel"] = ""
# In macOS 12.4 and 12.5 Beta 1, Apple added AVX1.0 usage in AppleFSCompressionTypeZlib # In macOS 12.4 and 12.5 Beta 1, Apple added AVX1.0 usage in AppleFSCompressionTypeZlib
# Pre-Sandy Bridge CPUs don't support AVX1.0, thus we'll downgrade the kext to 12.3.1's # Pre-Sandy Bridge CPUs don't support AVX1.0, thus we'll downgrade the kext to 12.3.1's
@@ -138,17 +165,20 @@ class build_firmware:
# To verify the non-AVX kext is used, check IOService for 'com_apple_AppleFSCompression_NoAVXCompressionTypeZlib' # To verify the non-AVX kext is used, check IOService for 'com_apple_AppleFSCompression_NoAVXCompressionTypeZlib'
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value:
support.build_support(self.model, self.constants, self.config).enable_kext("NoAVXFSCompressionTypeZlib.kext", self.constants.apfs_zlib_version, self.constants.apfs_zlib_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("NoAVXFSCompressionTypeZlib.kext", self.constants.apfs_zlib_version, self.constants.apfs_zlib_path)
support.build_support(self.model, self.constants, self.config).enable_kext("NoAVXFSCompressionTypeZlib-AVXpel.kext", self.constants.apfs_zlib_v2_version, self.constants.apfs_zlib_v2_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("NoAVXFSCompressionTypeZlib-AVXpel.kext", self.constants.apfs_zlib_v2_version, self.constants.apfs_zlib_v2_path)
# HID patches # HID patches
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value:
logging.info("- Adding IOHIDFamily patch") logging.info("- Adding IOHIDFamily patch")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.iokit.IOHIDFamily")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.iokit.IOHIDFamily")["Enabled"] = True
def firmware_driver_handling(self): def _firmware_driver_handling(self) -> None:
# Firmware Drivers (Drivers/*.efi) """
Firmware Driver Handling (Drivers/*.efi)
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]: if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]:
@@ -159,13 +189,13 @@ class build_firmware:
# Sandy Bridge and newer Macs natively support ExFat # Sandy Bridge and newer Macs natively support ExFat
logging.info("- Adding ExFatDxeLegacy.efi") logging.info("- Adding ExFatDxeLegacy.efi")
shutil.copy(self.constants.exfat_legacy_driver_path, self.constants.drivers_path) shutil.copy(self.constants.exfat_legacy_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("ExFatDxeLegacy.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("ExFatDxeLegacy.efi", "UEFI", "Drivers")["Enabled"] = True
# NVMe check # NVMe check
if self.constants.nvme_boot is True: if self.constants.nvme_boot is True:
logging.info("- Enabling NVMe boot support") logging.info("- Enabling NVMe boot support")
shutil.copy(self.constants.nvme_driver_path, self.constants.drivers_path) shutil.copy(self.constants.nvme_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("NvmExpressDxe.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("NvmExpressDxe.efi", "UEFI", "Drivers")["Enabled"] = True
# USB check # USB check
if self.constants.xhci_boot is True: if self.constants.xhci_boot is True:
@@ -173,18 +203,22 @@ class build_firmware:
logging.info("- Adding XhciDxe.efi and UsbBusDxe.efi") logging.info("- Adding XhciDxe.efi and UsbBusDxe.efi")
shutil.copy(self.constants.xhci_driver_path, self.constants.drivers_path) shutil.copy(self.constants.xhci_driver_path, self.constants.drivers_path)
shutil.copy(self.constants.usb_bus_driver_path, self.constants.drivers_path) shutil.copy(self.constants.usb_bus_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("XhciDxe.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("XhciDxe.efi", "UEFI", "Drivers")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("UsbBusDxe.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("UsbBusDxe.efi", "UEFI", "Drivers")["Enabled"] = True
# PCIe Link Rate check # PCIe Link Rate check
if self.model == "MacPro3,1": if self.model == "MacPro3,1":
logging.info("- Adding PCIe Link Rate Patch") logging.info("- Adding PCIe Link Rate Patch")
shutil.copy(self.constants.link_rate_driver_path, self.constants.drivers_path) shutil.copy(self.constants.link_rate_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("FixPCIeLinkRate.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("FixPCIeLinkRate.efi", "UEFI", "Drivers")["Enabled"] = True
def firmware_compatibility_handling(self): def _firmware_compatibility_handling(self) -> None:
self.dual_dp_handling() """
Firmware Compatibility Handling (Firmware and Kernel)
"""
self._dual_dp_handling()
# Force VMM as a temporary solution to getting the MacPro6,1 booting in Ventura # Force VMM as a temporary solution to getting the MacPro6,1 booting in Ventura
# With macOS Ventura, Apple removed AppleIntelCPUPowerManagement.kext and assumed XCPM support across all Macs # With macOS Ventura, Apple removed AppleIntelCPUPowerManagement.kext and assumed XCPM support across all Macs
@@ -228,21 +262,24 @@ class build_firmware:
if self.model not in affected_smbios: if self.model not in affected_smbios:
# If MacPro6,1 host spoofs, we can safely enable it # If MacPro6,1 host spoofs, we can safely enable it
if self.constants.override_smbios in affected_smbios or generate_smbios.set_smbios_model_spoof(self.model) in affected_smbios: if self.constants.override_smbios in affected_smbios or generate_smbios.set_smbios_model_spoof(self.model) in affected_smbios:
support.build_support(self.model, self.constants, self.config).enable_kext("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleMCEReporterDisabler.kext", self.constants.mce_version, self.constants.mce_path)
def dual_dp_handling(self): def _dual_dp_handling(self) -> None:
# Check if model has 5K display """
# Apple has 2 modes for display handling on 5K iMacs and iMac Pro Dual DisplayPort Stream Handler (ex. 5k iMac)
# If at any point in the boot chain an "unsupported" entry is loaded, the firmware will tell the
# Display Controller to enter a 4K compatible mode that only uses a single DisplayPort 1.2 stream internally.
# This is to prevent situations where the system would boot into an enviroment that cannot handle the custom
# dual DisplayPort 1.2 streams the 5k Display uses
# To work around this issue, we trick the firmware into loading OpenCore through Apple's Hardware Diagnostic Tests Apple has 2 modes for display handling on 5K iMacs and iMac Pro
# Specifically hiding as Product.efi under '/System/Library/CoreServices/.diagnostics/Drivers/HardwareDrivers/Product.efi' If at any point in the boot chain an "unsupported" entry is loaded, the firmware will tell the
# The reason chainloading via ./Drivers/HardwareDrivers is possible is thanks to it being loaded via an encrypted file buffer Display Controller to enter a 4K compatible mode that only uses a single DisplayPort 1.2 stream internally.
# whereas other drivers like ./qa_logger.efi is invoked via Device Path. This is to prevent situations where the system would boot into an enviroment that cannot handle the custom
dual DisplayPort 1.2 streams the 5k Display uses
To work around this issue, we trick the firmware into loading OpenCore through Apple's Hardware Diagnostic Tests
Specifically hiding as Product.efi under '/System/Library/CoreServices/.diagnostics/Drivers/HardwareDrivers/Product.efi'
The reason chainloading via ./Drivers/HardwareDrivers is possible is thanks to it being loaded via an encrypted file buffer
whereas other drivers like ./qa_logger.efi is invoked via Device Path.
"""
if "5K Display" not in smbios_data.smbios_dictionary[self.model]: if "5K Display" not in smbios_data.smbios_dictionary[self.model]:
return return

View File

@@ -1,7 +1,9 @@
# Class for handling Graphics and Audio Patches, invocation from build.py # Class for handling Graphics and Audio Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import shutil, binascii, logging import shutil
import logging
import binascii
from pathlib import Path from pathlib import Path
@@ -10,30 +12,47 @@ from resources.build import support
from data import smbios_data, model_array, os_data, cpu_data, video_bios_data from data import smbios_data, model_array, os_data, cpu_data, video_bios_data
class build_graphics_audio: class BuildGraphicsAudio:
"""
Build Library for Graphics and Audio Support
def __init__(self, model, versions, config): Invoke from build.py
self.model = model """
self.constants: constants.Constants = versions
self.config = config def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.computer = self.constants.computer self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self.gfx0_path = None self.gfx0_path = None
self._build()
def build(self):
self.imac_mxm_patching()
self.graphics_handling()
self.audio_handling()
self.firmware_handling()
self.spoof_handling()
self.ioaccel_workaround()
def graphics_handling(self): def _build(self) -> None:
"""
Kick off Graphics and Audio Build Process
"""
self._imac_mxm_patching()
self._graphics_handling()
self._audio_handling()
self._firmware_handling()
self._spoof_handling()
self._ioaccel_workaround()
def _graphics_handling(self) -> None:
"""
Graphics Handling
Primarily for Mac Pros and systems with Nvidia Maxwell/Pascal GPUs
"""
if self.constants.allow_oc_everywhere is False and self.constants.serial_settings != "None": if self.constants.allow_oc_everywhere is False and self.constants.serial_settings != "None":
if not support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True: if not support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True:
support.build_support(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path)
# Mac Pro handling # Mac Pro handling
if self.model in model_array.MacPro: if self.model in model_array.MacPro:
@@ -77,8 +96,8 @@ class build_graphics_audio:
logging.info("- Adding Mac Pro, Xserve DRM patches") logging.info("- Adding Mac Pro, Xserve DRM patches")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=128 unfairgva=1 -wegtree"
if not support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True: if not support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True:
support.build_support(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path)
# Web Driver specific # Web Driver specific
if not self.constants.custom_model: if not self.constants.custom_model:
@@ -94,23 +113,23 @@ class build_graphics_audio:
self.config["DeviceProperties"]["Add"][device.pci_path].update({"disable-metal": 1, "force-compat": 1}) self.config["DeviceProperties"]["Add"][device.pci_path].update({"disable-metal": 1, "force-compat": 1})
else: else:
self.config["DeviceProperties"]["Add"][device.pci_path] = {"disable-metal": 1, "force-compat": 1} self.config["DeviceProperties"]["Add"][device.pci_path] = {"disable-metal": 1, "force-compat": 1}
support.build_support(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path)
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"].update({"nvda_drv": binascii.unhexlify("31")}) self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"].update({"nvda_drv": binascii.unhexlify("31")})
if "nvda_drv" not in self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]: if "nvda_drv" not in self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]:
self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["nvda_drv"] self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["nvda_drv"]
else: else:
if "ngfxgl=1 ngfxcompat=1" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"]: if "ngfxgl=1 ngfxcompat=1" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"]:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " ngfxgl=1 ngfxcompat=1" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " ngfxgl=1 ngfxcompat=1"
support.build_support(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_version, self.constants.whatevergreen_path)
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"].update({"nvda_drv": binascii.unhexlify("31")}) self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"].update({"nvda_drv": binascii.unhexlify("31")})
if "nvda_drv" not in self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]: if "nvda_drv" not in self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]:
self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["nvda_drv"] self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["nvda_drv"]
def backlight_path_detection(self): def _backlight_path_detection(self) -> None:
"""
iMac MXM dGPU Backlight DevicePath Detection
"""
# self.constants.custom_model: iMac has been modded with new dGPU
# self.computer.dgpu: dGPU has been found using the GFX0 path
# self.computer.dgpu.pci_path:
if not self.constants.custom_model and self.computer.dgpu and self.computer.dgpu.pci_path: if not self.constants.custom_model and self.computer.dgpu and self.computer.dgpu.pci_path:
for i, device in enumerate(self.computer.gpus): for i, device in enumerate(self.computer.gpus):
logging.info(f"- Found dGPU ({i + 1}): {utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}") logging.info(f"- Found dGPU ({i + 1}): {utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}")
@@ -138,16 +157,20 @@ class build_graphics_audio:
logging.info("- Failed to find GFX0 Device path, falling back on known logic") logging.info("- Failed to find GFX0 Device path, falling back on known logic")
if self.model in ["iMac11,1", "iMac11,3"]: if self.model in ["iMac11,1", "iMac11,3"]:
self.gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)" self.gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
elif self.model == "iMac10,1": elif self.model in ["iMac9,1", "iMac10,1"]:
self.gfx0_path = "PciRoot(0x0)/Pci(0xc,0x0)/Pci(0x0,0x0)" self.gfx0_path = "PciRoot(0x0)/Pci(0xc,0x0)/Pci(0x0,0x0)"
else: else:
self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)" self.gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
def nvidia_mxm_patch(self, backlight_path): def _nvidia_mxm_patch(self, backlight_path) -> None:
if not support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True: """
iMac Nvidia Kepler MXM Handler
"""
if not support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True:
# Ensure WEG is enabled as we need if for Backlight patching # Ensure WEG is enabled as we need if for Backlight patching
support.build_support(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_navi_version, self.constants.whatevergreen_navi_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_navi_version, self.constants.whatevergreen_navi_path)
if self.model in ["iMac11,1", "iMac11,2", "iMac11,3", "iMac10,1"]: if self.model in ["iMac11,1", "iMac11,2", "iMac11,3", "iMac10,1"]:
logging.info("- Adding Nvidia Brightness Control and DRM patches") logging.info("- Adding Nvidia Brightness Control and DRM patches")
self.config["DeviceProperties"]["Add"][backlight_path] = { self.config["DeviceProperties"]["Add"][backlight_path] = {
@@ -182,16 +205,24 @@ class build_graphics_audio:
"class-code": binascii.unhexlify("FFFFFFFF"), "class-code": binascii.unhexlify("FFFFFFFF"),
} }
shutil.copy(self.constants.backlight_injector_path, self.constants.kexts_path) shutil.copy(self.constants.backlight_injector_path, self.constants.kexts_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("BacklightInjector.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("BacklightInjector.kext")["Enabled"] = True
self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
def amd_mxm_patch(self, backlight_path): def _amd_mxm_patch(self, backlight_path) -> None:
"""
iMac AMD GCN and Navi MXM Handler
"""
logging.info("- Adding AMD DRM patches") logging.info("- Adding AMD DRM patches")
if not support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True: if not support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("WhateverGreen.kext")["Enabled"] is True:
# Ensure WEG is enabled as we need if for Backlight patching # Ensure WEG is enabled as we need if for Backlight patching
support.build_support(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_navi_version, self.constants.whatevergreen_navi_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("WhateverGreen.kext", self.constants.whatevergreen_navi_version, self.constants.whatevergreen_navi_path)
if self.model == "iMac9,1":
logging.info("- Adding iMac9,1 Brightness Control and DRM patches")
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BacklightInjector.kext", self.constants.backlight_injectorA_version, self.constants.backlight_injectorA_path)
if not self.constants.custom_model: if not self.constants.custom_model:
if self.computer.dgpu.device_id == 0x7340: if self.computer.dgpu.device_id == 0x7340:
@@ -217,8 +248,8 @@ class build_graphics_audio:
"name": binascii.unhexlify("23646973706C6179"), "name": binascii.unhexlify("23646973706C6179"),
"class-code": binascii.unhexlify("FFFFFFFF"), "class-code": binascii.unhexlify("FFFFFFFF"),
} }
elif self.model == "iMac10,1": elif self.model in ["iMac9,1", "iMac10,1"]:
support.build_support(self.model, self.constants, self.config).enable_kext("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path)
if self.computer and self.computer.dgpu: if self.computer and self.computer.dgpu:
if self.computer.dgpu.arch == device_probe.AMD.Archs.Legacy_GCN_7000: if self.computer.dgpu.arch == device_probe.AMD.Archs.Legacy_GCN_7000:
logging.info("- Adding Legacy GCN Power Gate Patches") logging.info("- Adding Legacy GCN Power Gate Patches")
@@ -264,10 +295,17 @@ class build_graphics_audio:
"rebuild-device-tree": 1, "rebuild-device-tree": 1,
"enable-gva-support": 1 "enable-gva-support": 1
} }
logging.info(f"- Adding AMD RX5500XT boot-args")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " agdpmod=pikera applbkl=3"
def _audio_handling(self) -> None:
"""
Audio Handler
"""
def audio_handling(self):
if (self.model in model_array.LegacyAudio or self.model in model_array.MacPro) and self.constants.set_alc_usage is True: if (self.model in model_array.LegacyAudio or self.model in model_array.MacPro) and self.constants.set_alc_usage is True:
support.build_support(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path)
# Audio Patch # Audio Patch
if self.constants.set_alc_usage is True: if self.constants.set_alc_usage is True:
@@ -293,16 +331,21 @@ class build_graphics_audio:
"use-apple-layout-id": 1, "use-apple-layout-id": 1,
"use-layout-id": 1, "use-layout-id": 1,
} }
support.build_support(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path)
elif (self.model.startswith("MacPro") and self.model != "MacPro6,1") or self.model.startswith("Xserve"): elif (self.model.startswith("MacPro") and self.model != "MacPro6,1") or self.model.startswith("Xserve"):
# Used to enable Audio support for non-standard dGPUs # Used to enable Audio support for non-standard dGPUs
support.build_support(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleALC.kext", self.constants.applealc_version, self.constants.applealc_path)
# Due to regression in AppleALC 1.6.4+, temporarily use 1.6.3 and set override # Due to regression in AppleALC 1.6.4+, temporarily use 1.6.3 and set override
if support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleALC.kext")["Enabled"] is True: if support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleALC.kext")["Enabled"] is True:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -lilubetaall" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -lilubetaall"
def firmware_handling(self):
def _firmware_handling(self) -> None:
"""
Firmware Handler
"""
# Add UGA to GOP layer # Add UGA to GOP layer
if "UGA Graphics" in smbios_data.smbios_dictionary[self.model]: if "UGA Graphics" in smbios_data.smbios_dictionary[self.model]:
logging.info("- Adding UGA to GOP Patch") logging.info("- Adding UGA to GOP Patch")
@@ -312,8 +355,8 @@ class build_graphics_audio:
if self.constants.software_demux is True and self.model in ["MacBookPro8,2", "MacBookPro8,3"]: if self.constants.software_demux is True and self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
logging.info("- Enabling software demux") logging.info("- Enabling software demux")
# Add ACPI patches # Add ACPI patches
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-DGPU.aml")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Add"], "Path", "SSDT-DGPU.aml")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "_INI to XINI")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "_INI to XINI")["Enabled"] = True
shutil.copy(self.constants.demux_ssdt_path, self.constants.acpi_path) shutil.copy(self.constants.demux_ssdt_path, self.constants.acpi_path)
# Disable dGPU # Disable dGPU
# IOACPIPlane:/_SB/PCI0@0/P0P2@10000/GFX0@0 # IOACPIPlane:/_SB/PCI0@0/P0P2@10000/GFX0@0
@@ -325,7 +368,7 @@ class build_graphics_audio:
} }
self.config["DeviceProperties"]["Delete"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = ["class-code", "device-id", "IOName", "name"] self.config["DeviceProperties"]["Delete"]["PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"] = ["class-code", "device-id", "IOName", "name"]
# Add AMDGPUWakeHandler # Add AMDGPUWakeHandler
support.build_support(self.model, self.constants, self.config).enable_kext("AMDGPUWakeHandler.kext", self.constants.gpu_wake_version, self.constants.gpu_wake_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AMDGPUWakeHandler.kext", self.constants.gpu_wake_version, self.constants.gpu_wake_path)
if self.constants.dGPU_switch is True and "Switchable GPUs" in smbios_data.smbios_dictionary[self.model]: if self.constants.dGPU_switch is True and "Switchable GPUs" in smbios_data.smbios_dictionary[self.model]:
logging.info("- Allowing GMUX switching in Windows") logging.info("- Allowing GMUX switching in Windows")
@@ -341,16 +384,20 @@ class build_graphics_audio:
if self.constants.amd_gop_injection is True: if self.constants.amd_gop_injection is True:
logging.info("- Adding AMDGOP.efi") logging.info("- Adding AMDGOP.efi")
shutil.copy(self.constants.amd_gop_driver_path, self.constants.drivers_path) shutil.copy(self.constants.amd_gop_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("AMDGOP.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("AMDGOP.efi", "UEFI", "Drivers")["Enabled"] = True
# Nvidia Kepler GOP VBIOS injection # Nvidia Kepler GOP VBIOS injection
if self.constants.nvidia_kepler_gop_injection is True: if self.constants.nvidia_kepler_gop_injection is True:
logging.info("- Adding NVGOP_GK.efi") logging.info("- Adding NVGOP_GK.efi")
shutil.copy(self.constants.nvidia_kepler_gop_driver_path, self.constants.drivers_path) shutil.copy(self.constants.nvidia_kepler_gop_driver_path, self.constants.drivers_path)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("NVGOP_GK.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("NVGOP_GK.efi", "UEFI", "Drivers")["Enabled"] = True
def spoof_handling(self): def _spoof_handling(self) -> None:
"""
SMBIOS Spoofing Handler
"""
if self.constants.serial_settings == "None": if self.constants.serial_settings == "None":
return return
@@ -362,7 +409,7 @@ class build_graphics_audio:
Path(self.constants.amc_kext_folder).mkdir() Path(self.constants.amc_kext_folder).mkdir()
Path(self.constants.amc_contents_folder).mkdir() Path(self.constants.amc_contents_folder).mkdir()
shutil.copy(amc_map_path, self.constants.amc_contents_folder) shutil.copy(amc_map_path, self.constants.amc_contents_folder)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AMC-Override.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AMC-Override.kext")["Enabled"] = True
if self.model not in model_array.NoAGPMSupport: if self.model not in model_array.NoAGPMSupport:
logging.info("- Adding AppleGraphicsPowerManagement Override") logging.info("- Adding AppleGraphicsPowerManagement Override")
@@ -370,7 +417,7 @@ class build_graphics_audio:
Path(self.constants.agpm_kext_folder).mkdir() Path(self.constants.agpm_kext_folder).mkdir()
Path(self.constants.agpm_contents_folder).mkdir() Path(self.constants.agpm_contents_folder).mkdir()
shutil.copy(agpm_map_path, self.constants.agpm_contents_folder) shutil.copy(agpm_map_path, self.constants.agpm_contents_folder)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AGPM-Override.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AGPM-Override.kext")["Enabled"] = True
if self.model in model_array.AGDPSupport: if self.model in model_array.AGDPSupport:
logging.info("- Adding AppleGraphicsDevicePolicy Override") logging.info("- Adding AppleGraphicsDevicePolicy Override")
@@ -378,7 +425,7 @@ class build_graphics_audio:
Path(self.constants.agdp_kext_folder).mkdir() Path(self.constants.agdp_kext_folder).mkdir()
Path(self.constants.agdp_contents_folder).mkdir() Path(self.constants.agdp_contents_folder).mkdir()
shutil.copy(agdp_map_path, self.constants.agdp_contents_folder) shutil.copy(agdp_map_path, self.constants.agdp_contents_folder)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AGDP-Override.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AGDP-Override.kext")["Enabled"] = True
# AGPM Patch # AGPM Patch
if self.model in model_array.DualGPUPatch: if self.model in model_array.DualGPUPatch:
@@ -408,15 +455,19 @@ class build_graphics_audio:
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"agdpmod": "vit9696"} self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"agdpmod": "vit9696"}
def imac_mxm_patching(self): def _imac_mxm_patching(self) -> None:
self.backlight_path_detection() """
General iMac MXM Handler
"""
self._backlight_path_detection()
# Check GPU Vendor # Check GPU Vendor
if self.constants.metal_build is True: if self.constants.metal_build is True:
logging.info("- Adding Metal GPU patches on request") logging.info("- Adding Metal GPU patches on request")
if self.constants.imac_vendor == "AMD": if self.constants.imac_vendor == "AMD":
self.amd_mxm_patch(self.gfx0_path) self._amd_mxm_patch(self.gfx0_path)
elif self.constants.imac_vendor == "Nvidia": elif self.constants.imac_vendor == "Nvidia":
self.nvidia_mxm_patch(self.gfx0_path) self._nvidia_mxm_patch(self.gfx0_path)
else: else:
logging.info("- Failed to find vendor") logging.info("- Failed to find vendor")
elif not self.constants.custom_model and self.model in model_array.LegacyGPU and self.computer.dgpu: elif not self.constants.custom_model and self.model in model_array.LegacyGPU and self.computer.dgpu:
@@ -430,15 +481,18 @@ class build_graphics_audio:
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
self.amd_mxm_patch(self.gfx0_path) self._amd_mxm_patch(self.gfx0_path)
elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler:
self.nvidia_mxm_patch(self.gfx0_path) self._nvidia_mxm_patch(self.gfx0_path)
def ioaccel_workaround(self): def _ioaccel_workaround(self) -> None:
# Handle misc IOAccelerator issues """
Miscellaneous IOAccelerator Handler
When MTL bundles are missing from disk, WindowServer will repeatedly crash
This primarily occurs when installing an RSR update, where root is cleaned but AuxKC is not
"""
# When MTL bundles are missing from disk, WindowServer will repeatedly crash
# This primarily occurs when installing an RSR update, where root is cleaned but AuxKC is not
gpu_dict = [] gpu_dict = []
if not self.constants.custom_model: if not self.constants.custom_model:
gpu_dict = self.constants.computer.gpus gpu_dict = self.constants.computer.gpus
@@ -499,7 +553,7 @@ class build_graphics_audio:
if has_kdkless_gpu is True and has_kdk_gpu is False: if has_kdkless_gpu is True and has_kdk_gpu is False:
# KDKlessWorkaround is required for KDKless GPUs # KDKlessWorkaround is required for KDKless GPUs
support.build_support(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path)
return return
# KDKlessWorkaround supports disabling native AMD stack on Ventura for pre-AVX2.0 CPUs # KDKlessWorkaround supports disabling native AMD stack on Ventura for pre-AVX2.0 CPUs
@@ -515,5 +569,5 @@ class build_graphics_audio:
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
support.build_support(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("KDKlessWorkaround.kext", self.constants.kdkless_version, self.constants.kdkless_path)
return return

View File

@@ -1,62 +1,116 @@
# Class for handling Misc Patches, invocation from build.py # Class for handling Misc Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import shutil
import logging
import binascii
from pathlib import Path
from resources import constants, device_probe, generate_smbios, utilities from resources import constants, device_probe, generate_smbios, utilities
from resources.build import support from resources.build import support
from data import model_array, smbios_data, cpu_data from data import model_array, smbios_data, cpu_data
import binascii, shutil, logging
from pathlib import Path class BuildMiscellaneous:
"""
Build Library for Miscellaneous Hardware and Software Support
Invoke from build.py
"""
def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self._build()
class build_misc: def _build(self) -> None:
"""
Kick off Misc Build Process
"""
def __init__(self, model, versions, config): self._feature_unlock_handling()
self.model = model self._restrict_events_handling()
self.constants: constants.Constants = versions self._firewire_handling()
self.config = config self._trackpad_handling()
self.computer = self.constants.computer self._thunderbolt_handling()
self._webcam_handling()
self._usb_handling()
self._debug_handling()
self._cpu_friend_handling()
self._general_oc_handling()
def rmtree_handler(func, path, exc_info):
if exc_info[0] == FileNotFoundError: def _feature_unlock_handling(self) -> None:
"""
FeatureUnlock Handler
"""
if self.constants.fu_status is False:
return return
raise # pylint: disable=misplaced-bare-raise
def build(self): support.BuildSupport(self.model, self.constants, self.config).enable_kext("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path)
self.feature_unlock_handling() if self.constants.fu_arguments is not None:
self.restrict_events_handling() logging.info(f"- Adding additional FeatureUnlock args: {self.constants.fu_arguments}")
self.firewire_handling() self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += self.constants.fu_arguments
self.trackpad_handling()
self.thunderbolt_handling()
self.webcam_handling()
self.usb_handling()
self.debug_handling()
self.cpu_friend_handling()
self.general_oc_handling()
def feature_unlock_handling(self):
if self.constants.fu_status is True:
support.build_support(self.model, self.constants, self.config).enable_kext("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path)
if self.constants.fu_arguments is not None:
logging.info(f"- Adding additional FeatureUnlock args: {self.constants.fu_arguments}")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += self.constants.fu_arguments
def restrict_events_handling(self): def _restrict_events_handling(self) -> None:
# RestrictEvents handling """
# - revpatch: Process patching RestrictEvents Handler
# - revblock: Process blocking """
block_args = ""
block_args = ",".join(self._re_generate_block_arguments())
patch_args = ",".join(self._re_generate_patch_arguments())
if block_args != "":
logging.info(f"- Setting RestrictEvents block arguments: {block_args}")
support.BuildSupport(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revblock"] = block_args
if block_args != "" and patch_args == "":
# Disable unneeded Userspace patching (cs_validate_page is quite expensive)
patch_args = "none"
if patch_args != "":
logging.info(f"- Setting RestrictEvents patch arguments: {patch_args}")
support.BuildSupport(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revpatch"] = patch_args
if support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False:
# Ensure this is done at the end so all previous RestrictEvents patches are applied
# RestrictEvents and EFICheckDisabler will conflict if both are injected
support.BuildSupport(self.model, self.constants, self.config).enable_kext("EFICheckDisabler.kext", "", self.constants.efi_disabler_path)
def _re_generate_block_arguments(self) -> list:
"""
Generate RestrictEvents block arguments
Returns:
list: RestrictEvents block arguments
"""
re_block_args = []
# Resolve GMUX switching in Big Sur+
if self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1", "MacBookPro10,1"]: if self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1", "MacBookPro10,1"]:
block_args += "gmux," re_block_args.append("gmux")
# Resolve memory error reporting on MacPro7,1 SMBIOS
if self.model in model_array.MacPro: if self.model in model_array.MacPro:
logging.info("- Disabling memory error reporting") logging.info("- Disabling memory error reporting")
block_args += "pcie," re_block_args.append("pcie")
gpu_dict = []
if not self.constants.custom_model: # Resolve mediaanalysisd crashing on 3802 GPUs
gpu_dict = self.constants.computer.gpus gpu_dict = [] if self.constants.custom_model else self.constants.computer.gpus
else: if gpu_dict == []:
if self.model in smbios_data.smbios_dictionary: gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"] if self.model in smbios_data.smbios_dictionary else []
gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"]
for gpu in gpu_dict: for gpu in gpu_dict:
if not self.constants.custom_model: if not self.constants.custom_model:
gpu = gpu.arch gpu = gpu.arch
@@ -66,51 +120,43 @@ class build_misc:
device_probe.NVIDIA.Archs.Kepler, device_probe.NVIDIA.Archs.Kepler,
]: ]:
logging.info("- Disabling mediaanalysisd") logging.info("- Disabling mediaanalysisd")
block_args += "media," re_block_args.append("media")
break break
if block_args.endswith(","):
block_args = block_args[:-1]
if block_args != "": return re_block_args
logging.info(f"- Setting RestrictEvents block arguments: {block_args}")
support.build_support(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revblock"] = block_args
patch_args = ""
if support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True and self.constants.set_content_caching is True: def _re_generate_patch_arguments(self) -> list:
"""
Generate RestrictEvents patch arguments
Returns:
list: Patch arguments
"""
re_patch_args = []
# Resolve content caching when kern.hv_vmm_present is set
if support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True and self.constants.set_content_caching is True:
logging.info("- Fixing Content Caching support") logging.info("- Fixing Content Caching support")
patch_args += "asset," re_patch_args.append("asset")
if patch_args.endswith(","): # Resolve CoreGraphics.framework crashing on Ivy Bridge in macOS 13.3+
patch_args = patch_args[:-1] # Ref: https://github.com/acidanthera/RestrictEvents/pull/12
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] == cpu_data.cpu_data.ivy_bridge.value:
logging.info("- Fixing CoreGraphics support on Ivy Bridge")
re_patch_args.append("f16c")
if block_args != "" and patch_args == "": return re_patch_args
# Disable unneeded Userspace patching (cs_validate_page is quite expensive)
patch_args = "none"
if patch_args != "":
logging.info(f"- Setting RestrictEvents patch arguments: {patch_args}")
support.build_support(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revpatch"] = patch_args
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revcpu"] = self.constants.custom_cpu_model
if self.constants.custom_cpu_model_value != "":
logging.info(f"- Adding custom CPU Name: {self.constants.custom_cpu_model_value}")
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["revcpuname"] = self.constants.custom_cpu_model_value
else:
logging.info("- Adding CPU Name Patch")
support.build_support(self.model, self.constants, self.config).enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
if support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False:
# Ensure this is done at the end so all previous RestrictEvents patches are applied
# RestrictEvents and EFICheckDisabler will conflict if both are injected
support.build_support(self.model, self.constants, self.config).enable_kext("EFICheckDisabler.kext", "", self.constants.efi_disabler_path)
def cpu_friend_handling(self): def _cpu_friend_handling(self) -> None:
if self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"] and self.constants.disallow_cpufriend is False and self.constants.serial_settings != "None": """
support.build_support(self.model, self.constants, self.config).enable_kext("CPUFriend.kext", self.constants.cpufriend_version, self.constants.cpufriend_path) CPUFriend Handler
"""
if self.constants.allow_oc_everywhere is False and self.model not in ["iMac7,1", "Xserve2,1", "Dortania1,1"] and self.constants.disallow_cpufriend is False and self.constants.serial_settings != "None":
support.BuildSupport(self.model, self.constants, self.config).enable_kext("CPUFriend.kext", self.constants.cpufriend_version, self.constants.cpufriend_path)
# CPUFriendDataProvider handling # CPUFriendDataProvider handling
pp_map_path = Path(self.constants.platform_plugin_plist_path) / Path(f"{self.model}/Info.plist") pp_map_path = Path(self.constants.platform_plugin_plist_path) / Path(f"{self.model}/Info.plist")
@@ -119,34 +165,53 @@ class build_misc:
Path(self.constants.pp_kext_folder).mkdir() Path(self.constants.pp_kext_folder).mkdir()
Path(self.constants.pp_contents_folder).mkdir() Path(self.constants.pp_contents_folder).mkdir()
shutil.copy(pp_map_path, self.constants.pp_contents_folder) shutil.copy(pp_map_path, self.constants.pp_contents_folder)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("CPUFriendDataProvider.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("CPUFriendDataProvider.kext")["Enabled"] = True
def firewire_handling(self):
if self.constants.firewire_boot is True and generate_smbios.check_firewire(self.model) is True:
# Enable FireWire Boot Support
# Applicable for both native FireWire and Thunderbolt to FireWire adapters
logging.info("- Enabling FireWire Boot Support")
support.build_support(self.model, self.constants, self.config).enable_kext("IOFireWireFamily.kext", self.constants.fw_kext, self.constants.fw_family_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IOFireWireSBP2.kext", self.constants.fw_kext, self.constants.fw_sbp2_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IOFireWireSerialBusProtocolTransport.kext", self.constants.fw_kext, self.constants.fw_bus_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("IOFireWireFamily.kext/Contents/PlugIns/AppleFWOHCI.kext")["Enabled"] = True
def trackpad_handling(self): def _firewire_handling(self) -> None:
"""
FireWire Handler
"""
if self.constants.firewire_boot is False:
return
if generate_smbios.check_firewire(self.model) is False:
return
# Enable FireWire Boot Support
# Applicable for both native FireWire and Thunderbolt to FireWire adapters
logging.info("- Enabling FireWire Boot Support")
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IOFireWireFamily.kext", self.constants.fw_kext, self.constants.fw_family_path)
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IOFireWireSBP2.kext", self.constants.fw_kext, self.constants.fw_sbp2_path)
support.BuildSupport(self.model, self.constants, self.config).enable_kext("IOFireWireSerialBusProtocolTransport.kext", self.constants.fw_kext, self.constants.fw_bus_path)
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IOFireWireFamily.kext/Contents/PlugIns/AppleFWOHCI.kext")["Enabled"] = True
def _trackpad_handling(self) -> None:
"""
Trackpad Handler
"""
# Pre-Force Touch trackpad support for macOS Ventura # Pre-Force Touch trackpad support for macOS Ventura
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.skylake.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.skylake.value:
if self.model.startswith("MacBook"): if self.model.startswith("MacBook"):
# These units got force touch early, so ignore them # These units got force touch early, so ignore them
if self.model not in ["MacBookPro11,4", "MacBookPro11,5", "MacBookPro12,1", "MacBook8,1"]: if self.model not in ["MacBookPro11,4", "MacBookPro11,5", "MacBookPro12,1", "MacBook8,1"]:
support.build_support(self.model, self.constants, self.config).enable_kext("AppleUSBTopCase.kext", self.constants.topcase_version, self.constants.top_case_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleUSBTopCase.kext", self.constants.topcase_version, self.constants.top_case_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCButtons.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCButtons.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyEventDriver.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyEventDriver.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).enable_kext("AppleUSBMultitouch.kext", self.constants.multitouch_version, self.constants.multitouch_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleUSBMultitouch.kext", self.constants.multitouch_version, self.constants.multitouch_path)
# Legacy Trackpad support # Legacy Trackpad support
if self.model in ["MacBook4,1", "MacBook5,2"]: if self.model in ["MacBook4,1", "MacBook5,2"]:
support.build_support(self.model, self.constants, self.config).enable_kext("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path)
def _thunderbolt_handling(self) -> None:
"""
Thunderbolt Handler
"""
def thunderbolt_handling(self):
if self.constants.disable_tb is True and self.model in ["MacBookPro11,1", "MacBookPro11,2", "MacBookPro11,3", "MacBookPro11,4", "MacBookPro11,5"]: if self.constants.disable_tb is True and self.model in ["MacBookPro11,1", "MacBookPro11,2", "MacBookPro11,3", "MacBookPro11,4", "MacBookPro11,5"]:
logging.info("- Disabling 2013-2014 laptop Thunderbolt Controller") logging.info("- Disabling 2013-2014 laptop Thunderbolt Controller")
if self.model in ["MacBookPro11,3", "MacBookPro11,5"]: if self.model in ["MacBookPro11,3", "MacBookPro11,5"]:
@@ -158,13 +223,22 @@ class build_misc:
self.config["DeviceProperties"]["Add"][tb_device_path] = {"class-code": binascii.unhexlify("FFFFFFFF"), "device-id": binascii.unhexlify("FFFF0000")} self.config["DeviceProperties"]["Add"][tb_device_path] = {"class-code": binascii.unhexlify("FFFFFFFF"), "device-id": binascii.unhexlify("FFFF0000")}
def webcam_handling(self):
# Legacy iSight patches def _webcam_handling(self) -> None:
"""
iSight Handler
"""
if "Legacy iSight" in smbios_data.smbios_dictionary[self.model]: if "Legacy iSight" in smbios_data.smbios_dictionary[self.model]:
if smbios_data.smbios_dictionary[self.model]["Legacy iSight"] is True: if smbios_data.smbios_dictionary[self.model]["Legacy iSight"] is True:
support.build_support(self.model, self.constants, self.config).enable_kext("LegacyUSBVideoSupport.kext", self.constants.apple_isight_version, self.constants.apple_isight_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("LegacyUSBVideoSupport.kext", self.constants.apple_isight_version, self.constants.apple_isight_path)
def _usb_handling(self) -> None:
"""
USB Handler
"""
def usb_handling(self):
# USB Map # USB Map
usb_map_path = Path(self.constants.plist_folder_path) / Path("AppleUSBMaps/Info.plist") usb_map_path = Path(self.constants.plist_folder_path) / Path("AppleUSBMaps/Info.plist")
if ( if (
@@ -179,32 +253,32 @@ class build_misc:
Path(self.constants.map_kext_folder).mkdir() Path(self.constants.map_kext_folder).mkdir()
Path(self.constants.map_contents_folder).mkdir() Path(self.constants.map_contents_folder).mkdir()
shutil.copy(usb_map_path, self.constants.map_contents_folder) shutil.copy(usb_map_path, self.constants.map_contents_folder)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["Enabled"] = True
if self.model in model_array.Missing_USB_Map_Ventura and self.constants.serial_settings not in ["Moderate", "Advanced"]: if self.model in model_array.Missing_USB_Map_Ventura and self.constants.serial_settings not in ["Moderate", "Advanced"]:
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0" support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("USB-Map.kext")["MinKernel"] = "22.0.0"
# Add UHCI/OHCI drivers # Add UHCI/OHCI drivers
# All Penryn Macs lack an internal USB hub to route USB 1.1 devices to the EHCI controller # All Penryn Macs lack an internal USB hub to route USB 1.1 devices to the EHCI controller
# And MacPro4,1 and MacPro5,1 are the only post-Penryn Macs that lack an internal USB hub # And MacPro4,1 and MacPro5,1 are the only post-Penryn Macs that lack an internal USB hub
# - Ref: https://techcommunity.microsoft.com/t5/microsoft-usb-blog/reasons-to-avoid-companion-controllers/ba-p/270710 # - Ref: https://techcommunity.microsoft.com/t5/microsoft-usb-blog/reasons-to-avoid-companion-controllers/ba-p/270710
# #
# Required downgrades: # To be paired for sys_patch_dict.py's 'Legacy USB 1.1' patchset
# - IOUSBHostFamily.kext (only kext itself, not plugins)
# - AppleUSBHub.kext
# - AppleUSBEHCI.kext
if ( if (
smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \ smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.penryn.value or \
self.model in ["MacPro4,1", "MacPro5,1"] self.model in ["MacPro4,1", "MacPro5,1"]
): ):
logging.info("- Adding UHCI/OHCI USB support") logging.info("- Adding UHCI/OHCI USB support")
shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path) shutil.copy(self.constants.apple_usb_11_injector_path, self.constants.kexts_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCI.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBOHCIPCI.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCI.kext")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("USB1.1-Injector.kext/Contents/PlugIns/AppleUSBUHCIPCI.kext")["Enabled"] = True
def debug_handling(self):
# DEBUG Settings (OpenCorePkg and Kernel Space) def _debug_handling(self) -> None:
"""
Debug Handler for OpenCorePkg and Kernel Space
"""
if self.constants.verbose_debug is True: if self.constants.verbose_debug is True:
logging.info("- Enabling Verbose boot") logging.info("- Enabling Verbose boot")
@@ -216,24 +290,25 @@ class build_misc:
# Disabled due to macOS Monterey crashing shortly after kernel init # Disabled due to macOS Monterey crashing shortly after kernel init
# Use DebugEnhancer.kext instead # Use DebugEnhancer.kext instead
# self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " msgbuf=1048576" # self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " msgbuf=1048576"
support.build_support(self.model, self.constants, self.config).enable_kext("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path)
if self.constants.opencore_debug is True: if self.constants.opencore_debug is True:
logging.info("- Enabling DEBUG OpenCore") logging.info("- Enabling DEBUG OpenCore")
self.config["Misc"]["Debug"]["Target"] = 0x43 self.config["Misc"]["Debug"]["Target"] = 0x43
self.config["Misc"]["Debug"]["DisplayLevel"] = 0x80000042 self.config["Misc"]["Debug"]["DisplayLevel"] = 0x80000042
def general_oc_handling(self):
# OpenCorePkg Settings
# OpenCanopy Settings (GUI) def _general_oc_handling(self) -> None:
"""
General OpenCorePkg Handler
"""
logging.info("- Adding OpenCanopy GUI") logging.info("- Adding OpenCanopy GUI")
shutil.rmtree(self.constants.resources_path, onerror=self.rmtree_handler)
shutil.copy(self.constants.gui_path, self.constants.oc_folder) shutil.copy(self.constants.gui_path, self.constants.oc_folder)
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("OpenCanopy.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("OpenCanopy.efi", "UEFI", "Drivers")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("OpenRuntime.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("OpenRuntime.efi", "UEFI", "Drivers")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("OpenLinuxBoot.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("OpenLinuxBoot.efi", "UEFI", "Drivers")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("ResetNvramEntry.efi", "UEFI", "Drivers")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("ResetNvramEntry.efi", "UEFI", "Drivers")["Enabled"] = True
if self.constants.showpicker is False: if self.constants.showpicker is False:
logging.info("- Hiding OpenCore picker") logging.info("- Hiding OpenCore picker")
@@ -246,4 +321,4 @@ class build_misc:
if self.constants.vault is True and utilities.check_command_line_tools() is True: if self.constants.vault is True and utilities.check_command_line_tools() is True:
logging.info("- Setting Vault configuration") logging.info("- Setting Vault configuration")
self.config["Misc"]["Security"]["Vault"] = "Secure" self.config["Misc"]["Security"]["Vault"] = "Secure"
support.build_support(self.model, self.constants, self.config).get_efi_binary_by_path("OpenShell.efi", "Misc", "Tools")["Enabled"] = False support.BuildSupport(self.model, self.constants, self.config).get_efi_binary_by_path("OpenShell.efi", "Misc", "Tools")["Enabled"] = False

View File

@@ -1,29 +1,44 @@
# Class for handling Wired Networking Patches, invocation from build.py # Class for handling Wired Networking Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
from resources import constants, device_probe from resources import constants, device_probe
from resources.build import support from resources.build import support
from data import smbios_data, cpu_data from data import smbios_data, cpu_data
class build_wired:
def __init__(self, model, versions, config): class BuildWiredNetworking:
self.model = model """
self.constants: constants.Constants = versions Build Library for Wired Networking Support
self.config = config
self.computer = self.constants.computer Invoke from build.py
"""
def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self._build()
def build(self): def _build(self) -> None:
"""
Kick off Wired Build Process
"""
# Check if Ethernet was detected, otherwise fall back to assumptions (mainly for 2011 MacBook Airs and TB Ethernet) # Check if Ethernet was detected, otherwise fall back to assumptions (mainly for 2011 MacBook Airs and TB Ethernet)
if not self.constants.custom_model and self.constants.computer.ethernet: if not self.constants.custom_model and self.constants.computer.ethernet:
self.on_model() self._on_model()
else: else:
self.prebuilt_assumption() self._prebuilt_assumption()
def on_model(self): def _on_model(self) -> None:
# On-model hardware detection """
On-Model Hardware Detection Handling
"""
for controller in self.constants.computer.ethernet: for controller in self.constants.computer.ethernet:
if isinstance(controller, device_probe.BroadcomEthernet) and controller.chipset == device_probe.BroadcomEthernet.Chipsets.AppleBCM5701Ethernet: if isinstance(controller, device_probe.BroadcomEthernet) and controller.chipset == device_probe.BroadcomEthernet.Chipsets.AppleBCM5701Ethernet:
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
@@ -31,7 +46,7 @@ class build_wired:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value:
# Required due to Big Sur's BCM5701 requiring VT-D support # Required due to Big Sur's BCM5701 requiring VT-D support
# Applicable for pre-Ivy Bridge models # Applicable for pre-Ivy Bridge models
support.build_support(self.model, self.constants, self.config).enable_kext("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path)
elif isinstance(controller, device_probe.IntelEthernet): elif isinstance(controller, device_probe.IntelEthernet):
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
continue continue
@@ -39,19 +54,22 @@ class build_wired:
# Apple's IOSkywalkFamily in DriverKit requires VT-D support # Apple's IOSkywalkFamily in DriverKit requires VT-D support
# Applicable for pre-Ivy Bridge models # Applicable for pre-Ivy Bridge models
if controller.chipset == device_probe.IntelEthernet.Chipsets.AppleIntelI210Ethernet: if controller.chipset == device_probe.IntelEthernet.Chipsets.AppleIntelI210Ethernet:
support.build_support(self.model, self.constants, self.config).enable_kext("CatalinaIntelI210Ethernet.kext", self.constants.i210_version, self.constants.i210_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("CatalinaIntelI210Ethernet.kext", self.constants.i210_version, self.constants.i210_path)
elif controller.chipset == device_probe.IntelEthernet.Chipsets.AppleIntel8254XEthernet: elif controller.chipset == device_probe.IntelEthernet.Chipsets.AppleIntel8254XEthernet:
support.build_support(self.model, self.constants, self.config).enable_kext("AppleIntel8254XEthernet.kext", self.constants.intel_8254x_version, self.constants.intel_8254x_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleIntel8254XEthernet.kext", self.constants.intel_8254x_version, self.constants.intel_8254x_path)
elif controller.chipset == device_probe.IntelEthernet.Chipsets.Intel82574L: elif controller.chipset == device_probe.IntelEthernet.Chipsets.Intel82574L:
support.build_support(self.model, self.constants, self.config).enable_kext("Intel82574L.kext", self.constants.intel_82574l_version, self.constants.intel_82574l_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("Intel82574L.kext", self.constants.intel_82574l_version, self.constants.intel_82574l_path)
elif isinstance(controller, device_probe.NVIDIAEthernet): elif isinstance(controller, device_probe.NVIDIAEthernet):
support.build_support(self.model, self.constants, self.config).enable_kext("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path)
elif isinstance(controller, device_probe.Marvell) or isinstance(controller, device_probe.SysKonnect): elif isinstance(controller, device_probe.Marvell) or isinstance(controller, device_probe.SysKonnect):
support.build_support(self.model, self.constants, self.config).enable_kext("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path)
def prebuilt_assumption(self): def _prebuilt_assumption(self) -> None:
# Stock hardware assumptions """
Fall back to pre-built assumptions
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "Ethernet Chipset" in smbios_data.smbios_dictionary[self.model]: if not "Ethernet Chipset" in smbios_data.smbios_dictionary[self.model]:
@@ -61,12 +79,12 @@ class build_wired:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.ivy_bridge.value:
# Required due to Big Sur's BCM5701 requiring VT-D support # Required due to Big Sur's BCM5701 requiring VT-D support
# Applicable for pre-Ivy Bridge models # Applicable for pre-Ivy Bridge models
support.build_support(self.model, self.constants, self.config).enable_kext("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("CatalinaBCM5701Ethernet.kext", self.constants.bcm570_version, self.constants.bcm570_path)
elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Nvidia": elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Nvidia":
support.build_support(self.model, self.constants, self.config).enable_kext("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("nForceEthernet.kext", self.constants.nforce_version, self.constants.nforce_path)
elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Marvell": elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Marvell":
support.build_support(self.model, self.constants, self.config).enable_kext("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("MarvelYukonEthernet.kext", self.constants.marvel_version, self.constants.marvel_path)
elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Intel 80003ES2LAN": elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Intel 80003ES2LAN":
support.build_support(self.model, self.constants, self.config).enable_kext("AppleIntel8254XEthernet.kext", self.constants.intel_8254x_version, self.constants.intel_8254x_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleIntel8254XEthernet.kext", self.constants.intel_8254x_version, self.constants.intel_8254x_path)
elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Intel 82574L": elif smbios_data.smbios_dictionary[self.model]["Ethernet Chipset"] == "Intel 82574L":
support.build_support(self.model, self.constants, self.config).enable_kext("Intel82574L.kext", self.constants.intel_82574l_version, self.constants.intel_82574l_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("Intel82574L.kext", self.constants.intel_82574l_version, self.constants.intel_82574l_path)

View File

@@ -1,38 +1,53 @@
# Class for handling Wireless Networking Patches, invocation from build.py # Class for handling Wireless Networking Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import logging
from resources import constants, device_probe, utilities from resources import constants, device_probe, utilities
from resources.build import support from resources.build import support
from data import smbios_data from data import smbios_data
import logging
class build_wireless: class BuildWirelessNetworking:
"""
Build Library for Wireless Networking Support
def __init__(self, model, versions, config): Invoke from build.py
self.model = model """
self.constants: constants.Constants = versions
self.config = config def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.computer = self.constants.computer self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self._build()
def build(self): def _build(self) -> None:
# WiFi patches """
Kick off Wireless Build Process
"""
if not self.constants.custom_model and self.constants.computer.wifi: if not self.constants.custom_model and self.constants.computer.wifi:
self.on_model() self._on_model()
else: else:
self.prebuilt_assumption() self._prebuilt_assumption()
self.wowl_handling() self._wowl_handling()
def on_model(self): def _on_model(self) -> None:
"""
On-Model Hardware Detection Handling
"""
logging.info(f"- Found Wireless Device {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}") logging.info(f"- Found Wireless Device {utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}")
self.config["#Revision"]["Hardware-Wifi"] = f"{utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}" self.config["#Revision"]["Hardware-Wifi"] = f"{utilities.friendly_hex(self.computer.wifi.vendor_id)}:{utilities.friendly_hex(self.computer.wifi.device_id)}"
if isinstance(self.computer.wifi, device_probe.Broadcom): if isinstance(self.computer.wifi, device_probe.Broadcom):
# This works around OCLP spoofing the Wifi card and therefore unable to actually detect the correct device # This works around OCLP spoofing the Wifi card and therefore unable to actually detect the correct device
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirportBrcmNIC and self.constants.validate is False and self.computer.wifi.country_code: if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirportBrcmNIC and self.constants.validate is False and self.computer.wifi.country_code:
support.build_support(self.model, self.constants, self.config).enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path)
logging.info(f"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}") logging.info(f"- Setting Wireless Card's Country Code: {self.computer.wifi.country_code}")
if self.computer.wifi.pci_path: if self.computer.wifi.pci_path:
arpt_path = self.computer.wifi.pci_path arpt_path = self.computer.wifi.pci_path
@@ -44,65 +59,79 @@ class build_wireless:
logging.info("- Enabling Wake on WLAN support") logging.info("- Enabling Wake on WLAN support")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl"
elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4360: elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4360:
self.wifi_fake_id() self._wifi_fake_id()
elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4331: elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4331:
support.build_support(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortBrcm4331.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortBrcm4331.kext")["Enabled"] = True
elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm43224: elif self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm43224:
support.build_support(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AppleAirPortBrcm43224.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AppleAirPortBrcm43224.kext")["Enabled"] = True
elif isinstance(self.computer.wifi, device_probe.Atheros) and self.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40: elif isinstance(self.computer.wifi, device_probe.Atheros) and self.computer.wifi.chipset == device_probe.Atheros.Chipsets.AirPortAtheros40:
support.build_support(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True
def prebuilt_assumption(self): def _prebuilt_assumption(self) -> None:
"""
Fall back to pre-built assumptions
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "Wireless Model" in smbios_data.smbios_dictionary[self.model]: if not "Wireless Model" in smbios_data.smbios_dictionary[self.model]:
return return
if smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4360: if smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4360:
logging.info("- Enabling BCM943224 and BCM94331 Networking Support") logging.info("- Enabling BCM943224 and BCM94331 Networking Support")
self.wifi_fake_id() self._wifi_fake_id()
elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4331: elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm4331:
logging.info("- Enabling BCM94328 Networking Support") logging.info("- Enabling BCM94328 Networking Support")
support.build_support(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortBrcm4331.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortBrcm4331.kext")["Enabled"] = True
elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm43224: elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirPortBrcm43224:
logging.info("- Enabling BCM94328 Networking Support") logging.info("- Enabling BCM94328 Networking Support")
support.build_support(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AppleAirPortBrcm43224.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AppleAirPortBrcm43224.kext")["Enabled"] = True
elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Atheros.Chipsets.AirPortAtheros40: elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Atheros.Chipsets.AirPortAtheros40:
logging.info("- Enabling Atheros Networking Support") logging.info("- Enabling Atheros Networking Support")
support.build_support(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("corecaptureElCap.kext", self.constants.corecaptureelcap_version, self.constants.corecaptureelcap_path)
support.build_support(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("IO80211ElCap.kext", self.constants.io80211elcap_version, self.constants.io80211elcap_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("IO80211ElCap.kext/Contents/PlugIns/AirPortAtheros40.kext")["Enabled"] = True
elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirportBrcmNIC: elif smbios_data.smbios_dictionary[self.model]["Wireless Model"] == device_probe.Broadcom.Chipsets.AirportBrcmNIC:
support.build_support(self.model, self.constants, self.config).enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path)
def wowl_handling(self): def _wowl_handling(self) -> None:
# To avoid reduced networking performance from wake, AirPortBrcmFixup is used to disable wake on WLAN by default. """
# However some users may want to enable wake on WLAN, so enable if requested. Wake on WLAN handling
To avoid reduced networking performance from wake, AirPortBrcmFixup is used to disable wake on WLAN by default.
However some users may want to enable wake on WLAN, so enable if requested.
"""
if self.constants.enable_wake_on_wlan is False: if self.constants.enable_wake_on_wlan is False:
return return
if support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AirportBrcmFixup.kext")["Enabled"] is False: if support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AirportBrcmFixup.kext")["Enabled"] is False:
return return
logging.info("- Enabling Wake on WLAN support") logging.info("- Enabling Wake on WLAN support")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += f" -brcmfxwowl"
def wifi_fake_id(self): def _wifi_fake_id(self) -> None:
# BCM94331 and BCM943224 are both partially supported within Big Sur's native AirPortBrcmNIC stack """
# Simply adding the Device IDs and usage of AirPortBrcmFixup will restore full functionality Fake Device ID Handler for BCM943224 and BCM94331 chipsets
support.build_support(self.model, self.constants, self.config).enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path)
support.build_support(self.model, self.constants, self.config).get_kext_by_bundle_path("AirportBrcmFixup.kext/Contents/PlugIns/AirPortBrcmNIC_Injector.kext")["Enabled"] = True BCM94331 and BCM943224 are both partially supported within Big Sur's native AirPortBrcmNIC stack
Simply adding the Device IDs and usage of AirPortBrcmFixup will restore full functionality
"""
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AirportBrcmFixup.kext", self.constants.airportbcrmfixup_version, self.constants.airportbcrmfixup_path)
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AirportBrcmFixup.kext/Contents/PlugIns/AirPortBrcmNIC_Injector.kext")["Enabled"] = True
if not self.constants.custom_model and self.computer.wifi and self.computer.wifi.pci_path: if not self.constants.custom_model and self.computer.wifi and self.computer.wifi.pci_path:
arpt_path = self.computer.wifi.pci_path arpt_path = self.computer.wifi.pci_path
logging.info(f"- Found ARPT device at {arpt_path}") logging.info(f"- Found ARPT device at {arpt_path}")

View File

@@ -1,23 +1,34 @@
# Class for handling macOS Security Patches, invocation from build.py # Class for handling macOS Security Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
from resources import constants, utilities import logging
import binascii
from resources import constants, utilities, device_probe
from resources.build import support from resources.build import support
import binascii
import logging class BuildSecurity:
"""
Build Library for Security Patch Support
Invoke from build.py
"""
def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self._build()
class build_security: def _build(self) -> None:
"""
Kick off Security Build Process
"""
def __init__(self, model, versions, config):
self.model = model
self.constants: constants.Constants = versions
self.config = config
self.computer = self.constants.computer
def build(self):
if self.constants.sip_status is False or self.constants.custom_sip_value: if self.constants.sip_status is False or self.constants.custom_sip_value:
# Work-around 12.3 bug where Electron apps no longer launch with SIP lowered # Work-around 12.3 bug where Electron apps no longer launch with SIP lowered
# Unknown whether this is intended behavior or not, revisit with 12.4 # Unknown whether this is intended behavior or not, revisit with 12.4
@@ -26,7 +37,7 @@ class build_security:
# Adds AutoPkgInstaller for Automatic OpenCore-Patcher installation # Adds AutoPkgInstaller for Automatic OpenCore-Patcher installation
# Only install if running the GUI (AutoPkg-Assets.pkg requires the GUI) # Only install if running the GUI (AutoPkg-Assets.pkg requires the GUI)
if self.constants.wxpython_variant is True: if self.constants.wxpython_variant is True:
support.build_support(self.model, self.constants, self.config).enable_kext("AutoPkgInstaller.kext", self.constants.autopkg_version, self.constants.autopkg_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AutoPkgInstaller.kext", self.constants.autopkg_version, self.constants.autopkg_path)
if self.constants.custom_sip_value: if self.constants.custom_sip_value:
logging.info(f"- Setting SIP value to: {self.constants.custom_sip_value}") logging.info(f"- Setting SIP value to: {self.constants.custom_sip_value}")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = utilities.string_to_hex(self.constants.custom_sip_value.lstrip("0x")) self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["csr-active-config"] = utilities.string_to_hex(self.constants.custom_sip_value.lstrip("0x"))
@@ -38,7 +49,7 @@ class build_security:
# This is however hidden behind kern.development, thus we patch _apfs_filevault_allowed to always return true # This is however hidden behind kern.development, thus we patch _apfs_filevault_allowed to always return true
# Note this function was added in 11.3 (20E232, 20.4), older builds do not support this (ie. 11.2.3) # Note this function was added in 11.3 (20E232, 20.4), older builds do not support this (ie. 11.2.3)
logging.info("- Allowing FileVault on Root Patched systems") logging.info("- Allowing FileVault on Root Patched systems")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Force FileVault on Broken Seal")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Force FileVault on Broken Seal")["Enabled"] = True
# Lets us check in sys_patch.py if config supports FileVault # Lets us check in sys_patch.py if config supports FileVault
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv" self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_fv"
@@ -46,7 +57,7 @@ class build_security:
# - Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1019 # - Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/issues/1019
logging.info("- Enabling KC UUID mismatch patch") logging.info("- Enabling KC UUID mismatch patch")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -nokcmismatchpanic" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -nokcmismatchpanic"
support.build_support(self.model, self.constants, self.config).enable_kext("RSRHelper.kext", self.constants.rsrhelper_version, self.constants.rsrhelper_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("RSRHelper.kext", self.constants.rsrhelper_version, self.constants.rsrhelper_path)
if self.constants.disable_cs_lv is True: if self.constants.disable_cs_lv is True:
# In Ventura, LV patch broke. For now, add AMFI arg # In Ventura, LV patch broke. For now, add AMFI arg
@@ -56,18 +67,18 @@ class build_security:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " amfi=0x80" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " amfi=0x80"
else: else:
logging.info("- Disabling Library Validation") logging.info("- Disabling Library Validation")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable Library Validation Enforcement")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable Library Validation Enforcement")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable _csr_check() in _vnode_check_signature")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Disable _csr_check() in _vnode_check_signature")["Enabled"] = True
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_amfi" self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Settings"] += " -allow_amfi"
# CSLVFixup simply patches out __RESTRICT and __restrict out of the Music.app Binary # CSLVFixup simply patches out __RESTRICT and __restrict out of the Music.app Binary
# Ref: https://pewpewthespells.com/blog/blocking_code_injection_on_ios_and_os_x.html # Ref: https://pewpewthespells.com/blog/blocking_code_injection_on_ios_and_os_x.html
support.build_support(self.model, self.constants, self.config).enable_kext("CSLVFixup.kext", self.constants.cslvfixup_version, self.constants.cslvfixup_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("CSLVFixup.kext", self.constants.cslvfixup_version, self.constants.cslvfixup_path)
if self.constants.secure_status is False: if self.constants.secure_status is False:
logging.info("- Disabling SecureBootModel") logging.info("- Disabling SecureBootModel")
self.config["Misc"]["Security"]["SecureBootModel"] = "Disabled" self.config["Misc"]["Security"]["SecureBootModel"] = "Disabled"
if self.constants.force_vmm is True: if self.constants.force_vmm is True:
logging.info("- Forcing VMM patchset to support OTA updates") logging.info("- Forcing VMM patchset to support OTA updates")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Legacy")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Legacy")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Ventura")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Ventura")["Enabled"] = True

View File

@@ -1,48 +1,71 @@
# Class for handling SMBIOS Patches, invocation from build.py # Class for handling SMBIOS Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import ast
import uuid
import logging
import binascii
import plistlib
import subprocess
from pathlib import Path
from resources import constants, utilities, generate_smbios from resources import constants, utilities, generate_smbios
from resources.build import support from resources.build import support
from data import smbios_data, cpu_data, model_array from data import smbios_data, cpu_data, model_array
import subprocess, plistlib, binascii, uuid, ast, logging
from pathlib import Path
class build_smbios: class BuildSMBIOS:
"""
Build Library for SMBIOS Support
def __init__(self, model, versions, config): Invoke from build.py
self.model = model """
self.constants: constants.Constants = versions
self.config = config def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self._build()
def _build(self) -> None:
"""
Kick off SMBIOS Build Process
"""
def build(self):
if self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True: if self.constants.allow_oc_everywhere is False or self.constants.allow_native_spoofs is True:
if self.constants.serial_settings == "None": if self.constants.serial_settings == "None":
# Credit to Parrotgeek1 for boot.efi and hv_vmm_present patch sets # Credit to Parrotgeek1 for boot.efi and hv_vmm_present patch sets
logging.info("- Enabling Board ID exemption patch") logging.info("- Enabling Board ID exemption patch")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Booter"]["Patch"], "Comment", "Skip Board ID check")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Booter"]["Patch"], "Comment", "Skip Board ID check")["Enabled"] = True
logging.info("- Enabling VMM exemption patch") logging.info("- Enabling VMM exemption patch")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Legacy")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Legacy")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Ventura")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (2) Ventura")["Enabled"] = True
else: else:
logging.info("- Enabling SMC exemption patch") logging.info("- Enabling SMC exemption patch")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.driver.AppleSMC")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.driver.AppleSMC")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).enable_kext("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("SMC-Spoof.kext", self.constants.smcspoof_version, self.constants.smcspoof_path)
if self.constants.serial_settings in ["Moderate", "Advanced"]: if self.constants.serial_settings in ["Moderate", "Advanced"]:
logging.info("- Enabling USB Rename Patches") logging.info("- Enabling USB Rename Patches")
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "XHC1 to SHC1")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "XHC1 to SHC1")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "EHC1 to EH01")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "EHC1 to EH01")["Enabled"] = True
support.build_support(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "EHC2 to EH02")["Enabled"] = True support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["ACPI"]["Patch"], "Comment", "EHC2 to EH02")["Enabled"] = True
if self.model == self.constants.override_smbios: if self.model == self.constants.override_smbios:
logging.info("- Adding -no_compat_check") logging.info("- Adding -no_compat_check")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -no_compat_check" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -no_compat_check"
def set_smbios(self): def set_smbios(self) -> None:
"""
SMBIOS Handler
"""
spoofed_model = self.model spoofed_model = self.model
if self.constants.override_smbios == "Default": if self.constants.override_smbios == "Default":
@@ -70,14 +93,14 @@ class build_smbios:
if self.constants.serial_settings == "Moderate": if self.constants.serial_settings == "Moderate":
logging.info("- Using Moderate SMBIOS patching") logging.info("- Using Moderate SMBIOS patching")
self.moderate_serial_patch() self._moderate_serial_patch()
elif self.constants.serial_settings == "Advanced": elif self.constants.serial_settings == "Advanced":
logging.info("- Using Advanced SMBIOS patching") logging.info("- Using Advanced SMBIOS patching")
self.advanced_serial_patch() self._advanced_serial_patch()
elif self.constants.serial_settings == "Minimal": elif self.constants.serial_settings == "Minimal":
logging.info("- Using Minimal SMBIOS patching") logging.info("- Using Minimal SMBIOS patching")
self.spoofed_model = self.model self.spoofed_model = self.model
self.minimal_serial_patch() self._minimal_serial_patch()
else: else:
# Update DataHub to resolve Lilu Race Condition # Update DataHub to resolve Lilu Race Condition
# macOS Monterey will sometimes not present the boardIdentifier in the DeviceTree on UEFI 1.2 or older Mac, # macOS Monterey will sometimes not present the boardIdentifier in the DeviceTree on UEFI 1.2 or older Mac,
@@ -178,7 +201,17 @@ class build_smbios:
plistlib.dump(agdp_config, Path(new_agdp_ls).open("wb"), sort_keys=True) plistlib.dump(agdp_config, Path(new_agdp_ls).open("wb"), sort_keys=True)
def minimal_serial_patch(self): def _minimal_serial_patch(self) -> None:
"""
Minimal SMBIOS Spoofing Handler
This function will only spoof the following:
- Board ID
- Firmware Features
- BIOS Version
- Serial Numbers (if override requested)
"""
# Generate Firmware Features # Generate Firmware Features
fw_feature = generate_smbios.generate_fw_features(self.model, self.constants.custom_model) fw_feature = generate_smbios.generate_fw_features(self.model, self.constants.custom_model)
# fw_feature = self.patch_firmware_feature() # fw_feature = self.patch_firmware_feature()
@@ -202,10 +235,6 @@ class build_smbios:
self.config["PlatformInfo"]["SMBIOS"]["SystemProductName"] = self.model self.config["PlatformInfo"]["SMBIOS"]["SystemProductName"] = self.model
self.config["PlatformInfo"]["SMBIOS"]["BoardVersion"] = self.model self.config["PlatformInfo"]["SMBIOS"]["BoardVersion"] = self.model
# ProcessorType (when RestrictEvent's CPU naming is used)
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1:
self.config["PlatformInfo"]["SMBIOS"]["ProcessorType"] = 1537
# Avoid incorrect Firmware Updates # Avoid incorrect Firmware Updates
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["run-efi-updater"] = "No" self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["run-efi-updater"] = "No"
self.config["PlatformInfo"]["SMBIOS"]["BIOSVersion"] = "9999.999.999.999.999" self.config["PlatformInfo"]["SMBIOS"]["BIOSVersion"] = "9999.999.999.999.999"
@@ -233,9 +262,13 @@ class build_smbios:
self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Spoofed-MLB"] = mlb self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Spoofed-MLB"] = mlb
def moderate_serial_patch(self): def _moderate_serial_patch(self) -> None:
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1: """
self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537 Moderate SMBIOS Spoofing Handler
Implements a full SMBIOS replacement, however retains original serial numbers (unless override requested)
"""
if self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != "": if self.constants.custom_serial_number != "" and self.constants.custom_board_serial_number != "":
logging.info("- Adding custom serial numbers") logging.info("- Adding custom serial numbers")
self.config["PlatformInfo"]["Generic"]["SystemSerialNumber"] = self.constants.custom_serial_number self.config["PlatformInfo"]["Generic"]["SystemSerialNumber"] = self.constants.custom_serial_number
@@ -251,9 +284,13 @@ class build_smbios:
self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model self.config["PlatformInfo"]["Generic"]["SystemProductName"] = self.spoofed_model
def advanced_serial_patch(self): def _advanced_serial_patch(self) -> None:
if self.constants.custom_cpu_model == 0 or self.constants.custom_cpu_model == 1: """
self.config["PlatformInfo"]["Generic"]["ProcessorType"] = 1537 Advanced SMBIOS Spoofing Handler
Implements a full SMBIOS replacement, including serial numbers
"""
if self.constants.custom_serial_number == "" or self.constants.custom_board_serial_number == "": if self.constants.custom_serial_number == "" or self.constants.custom_board_serial_number == "":
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {self.spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
macserial_output = macserial_output.stdout.decode().strip().split(" | ") macserial_output = macserial_output.stdout.decode().strip().split(" | ")

View File

@@ -1,29 +1,46 @@
# Class for handling Storage Controller Patches, invocation from build.py # Class for handling Storage Controller Patches, invocation from build.py
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import logging
from resources import constants, device_probe, utilities from resources import constants, device_probe, utilities
from resources.build import support from resources.build import support
from data import model_array, smbios_data, cpu_data from data import model_array, smbios_data, cpu_data
import logging
class build_storage: class BuildStorage:
"""
Build Library for System Storage Support
def __init__(self, model, versions, config): Invoke from build.py
self.model = model """
self.constants: constants.Constants = versions
self.config = config def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.computer = self.constants.computer self.model: str = model
self.config: dict = config
self.constants: constants.Constants = global_constants
self.computer: device_probe.Computer = self.constants.computer
self._build()
def build(self): def _build(self) -> None:
self.ahci_handling() """
self.pata_handling() Kick off Storage Build Process
self.misc_handling() """
self.pcie_handling()
self.trim_handling() self._ahci_handling()
self._pata_handling()
self._misc_handling()
self._pcie_handling()
self._trim_handling()
def _ahci_handling(self) -> None:
"""
AHCI (SATA) Handler
"""
def ahci_handling(self):
# MacBookAir6,x ship with an AHCI over PCIe SSD model 'APPLE SSD TS0128F' and 'APPLE SSD TS0256F' # MacBookAir6,x ship with an AHCI over PCIe SSD model 'APPLE SSD TS0128F' and 'APPLE SSD TS0256F'
# This controller is not supported properly in macOS Ventura, instead populating itself as 'Media' with no partitions # This controller is not supported properly in macOS Ventura, instead populating itself as 'Media' with no partitions
# To work-around this, use Monterey's AppleAHCI driver to force support # To work-around this, use Monterey's AppleAHCI driver to force support
@@ -33,11 +50,11 @@ class build_storage:
# https://linux-hardware.org/?id=pci:1179-010b-1b4b-9183 # https://linux-hardware.org/?id=pci:1179-010b-1b4b-9183
if controller.vendor_id == 0x1179 and controller.device_id == 0x010b: if controller.vendor_id == 0x1179 and controller.device_id == 0x010b:
logging.info("- Enabling AHCI SSD patch") logging.info("- Enabling AHCI SSD patch")
support.build_support(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path)
break break
elif self.model in ["MacBookAir6,1", "MacBookAir6,2"]: elif self.model in ["MacBookAir6,1", "MacBookAir6,2"]:
logging.info("- Enabling AHCI SSD patch") logging.info("- Enabling AHCI SSD patch")
support.build_support(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("MonteAHCIPort.kext", self.constants.monterey_ahci_version, self.constants.monterey_ahci_path)
# ThirdPartyDrives Check # ThirdPartyDrives Check
if self.constants.allow_3rd_party_drives is True: if self.constants.allow_3rd_party_drives is True:
@@ -58,7 +75,11 @@ class build_storage:
break break
def pata_handling(self): def _pata_handling(self) -> None:
"""
ATA (PATA) Handler
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "Stock Storage" in smbios_data.smbios_dictionary[self.model]: if not "Stock Storage" in smbios_data.smbios_dictionary[self.model]:
@@ -66,10 +87,14 @@ class build_storage:
if not "PATA" in smbios_data.smbios_dictionary[self.model]["Stock Storage"]: if not "PATA" in smbios_data.smbios_dictionary[self.model]["Stock Storage"]:
return return
support.build_support(self.model, self.constants, self.config).enable_kext("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path)
def pcie_handling(self): def _pcie_handling(self) -> None:
"""
PCIe/NVMe Handler
"""
if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in model_array.MacPro): if not self.constants.custom_model and (self.constants.allow_oc_everywhere is True or self.model in model_array.MacPro):
# Use Innie's same logic: # Use Innie's same logic:
# https://github.com/cdf/Innie/blob/v1.3.0/Innie/Innie.cpp#L90-L97 # https://github.com/cdf/Innie/blob/v1.3.0/Innie/Innie.cpp#L90-L97
@@ -79,7 +104,7 @@ class build_storage:
self.config["DeviceProperties"]["Add"][controller.pci_path] = {"built-in": 1} self.config["DeviceProperties"]["Add"][controller.pci_path] = {"built-in": 1}
else: else:
logging.info(f"- Failed to find Device path for PCIe Storage Controller {i}, falling back to Innie") logging.info(f"- Failed to find Device path for PCIe Storage Controller {i}, falling back to Innie")
support.build_support(self.model, self.constants, self.config).enable_kext("Innie.kext", self.constants.innie_version, self.constants.innie_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("Innie.kext", self.constants.innie_version, self.constants.innie_path)
if not self.constants.custom_model and self.constants.allow_nvme_fixing is True: if not self.constants.custom_model and self.constants.allow_nvme_fixing is True:
nvme_devices = [i for i in self.computer.storage if isinstance(i, device_probe.NVMeController)] nvme_devices = [i for i in self.computer.storage if isinstance(i, device_probe.NVMeController)]
@@ -102,7 +127,7 @@ class build_storage:
if (controller.vendor_id != 0x144D and controller.device_id != 0xA804): if (controller.vendor_id != 0x144D and controller.device_id != 0xA804):
# Avoid injecting NVMeFix when a native Apple NVMe drive is present # Avoid injecting NVMeFix when a native Apple NVMe drive is present
# https://github.com/acidanthera/NVMeFix/blob/1.0.9/NVMeFix/NVMeFix.cpp#L220-L225 # https://github.com/acidanthera/NVMeFix/blob/1.0.9/NVMeFix/NVMeFix.cpp#L220-L225
support.build_support(self.model, self.constants, self.config).enable_kext("NVMeFix.kext", self.constants.nvmefix_version, self.constants.nvmefix_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("NVMeFix.kext", self.constants.nvmefix_version, self.constants.nvmefix_path)
# Apple RAID Card check # Apple RAID Card check
if not self.constants.custom_model: if not self.constants.custom_model:
@@ -110,15 +135,19 @@ class build_storage:
for storage_controller in self.computer.storage: for storage_controller in self.computer.storage:
if storage_controller.vendor_id == 0x106b and storage_controller.device_id == 0x008A: if storage_controller.vendor_id == 0x106b and storage_controller.device_id == 0x008A:
# AppleRAIDCard.kext only supports pci106b,8a # AppleRAIDCard.kext only supports pci106b,8a
support.build_support(self.model, self.constants, self.config).enable_kext("AppleRAIDCard.kext", self.constants.apple_raid_version, self.constants.apple_raid_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleRAIDCard.kext", self.constants.apple_raid_version, self.constants.apple_raid_path)
break break
elif self.model.startswith("Xserve"): elif self.model.startswith("Xserve"):
# For Xserves, assume RAID is present # For Xserves, assume RAID is present
# Namely due to Xserve2,1 being limited to 10.7, thus no hardware detection # Namely due to Xserve2,1 being limited to 10.7, thus no hardware detection
support.build_support(self.model, self.constants, self.config).enable_kext("AppleRAIDCard.kext", self.constants.apple_raid_version, self.constants.apple_raid_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleRAIDCard.kext", self.constants.apple_raid_version, self.constants.apple_raid_path)
def misc_handling(self): def _misc_handling(self) -> None:
"""
SDXC Handler
"""
if not self.model in smbios_data.smbios_dictionary: if not self.model in smbios_data.smbios_dictionary:
return return
if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]: if not "CPU Generation" in smbios_data.smbios_dictionary[self.model]:
@@ -128,10 +157,14 @@ class build_storage:
# However pre-Ivy Bridge don't support this feature # However pre-Ivy Bridge don't support this feature
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
if (self.constants.computer.sdxc_controller and not self.constants.custom_model) or (self.model.startswith("MacBookPro8") or self.model.startswith("Macmini5")): if (self.constants.computer.sdxc_controller and not self.constants.custom_model) or (self.model.startswith("MacBookPro8") or self.model.startswith("Macmini5")):
support.build_support(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path) support.BuildSupport(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path)
def trim_handling(self): def _trim_handling(self) -> None:
"""
TRIM Handler
"""
if self.constants.apfs_trim_timeout is False: if self.constants.apfs_trim_timeout is False:
logging.info(f"- Disabling APFS TRIM timeout") logging.info(f"- Disabling APFS TRIM timeout")
self.config["Kernel"]["Quirks"]["SetApfsTrimTimeout"] = 0 self.config["Kernel"]["Quirks"]["SetApfsTrimTimeout"] = 0

View File

@@ -1,22 +1,41 @@
# Utility class for build functions # Utility class for build functions
# Copyright (C) 2020-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2020-2023, Dhinak G, Mykola Grymalyuk
import shutil
import typing
import logging
import plistlib
import zipfile
import subprocess
from pathlib import Path
from resources import constants, utilities from resources import constants, utilities
from pathlib import Path
import shutil, plistlib, subprocess, zipfile
import logging
class build_support: class BuildSupport:
"""
Support Library for build.py and related libraries
"""
def __init__(self, model, versions, config): def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
self.model = model self.model: str = model
self.constants: constants.Constants = versions self.config: dict = config
self.config = config self.constants: constants.Constants = global_constants
@staticmethod @staticmethod
def get_item_by_kv(iterable, key, value): def get_item_by_kv(iterable: dict, key: str, value: typing.Any) -> dict:
"""
Gets an item from a list of dicts by key and value
Parameters:
iterable (list): List of dicts
key (str): Key to search for
value (any): Value to search for
"""
item = None item = None
for i in iterable: for i in iterable:
if i[key] == value: if i[key] == value:
@@ -25,24 +44,49 @@ class build_support:
return item return item
def get_kext_by_bundle_path(self, bundle_path): def get_kext_by_bundle_path(self, bundle_path: str) -> dict:
kext = self.get_item_by_kv(self.config["Kernel"]["Add"], "BundlePath", bundle_path) """
Gets a kext by bundle path
Parameters:
bundle_path (str): Relative bundle path of the kext in the EFI folder
"""
kext: dict = self.get_item_by_kv(self.config["Kernel"]["Add"], "BundlePath", bundle_path)
if not kext: if not kext:
logging.info(f"- Could not find kext {bundle_path}!") logging.info(f"- Could not find kext {bundle_path}!")
raise IndexError raise IndexError
return kext return kext
def get_efi_binary_by_path(self, bundle_path, entry_location, efi_type): def get_efi_binary_by_path(self, bundle_name: str, entry_type: str, efi_type: str) -> dict:
efi_binary = self.get_item_by_kv(self.config[entry_location][efi_type], "Path", bundle_path) """
Gets an EFI binary by name
Parameters:
bundle_name (str): Name of the EFI binary
entry_type (str): Type of EFI binary (UEFI, Misc)
efi_type (str): Type of EFI binary (Drivers, Tools)
"""
efi_binary: dict = self.get_item_by_kv(self.config[entry_type][efi_type], "Path", bundle_name)
if not efi_binary: if not efi_binary:
logging.info(f"- Could not find {efi_type}: {bundle_path}!") logging.info(f"- Could not find {efi_type}: {bundle_name}!")
raise IndexError raise IndexError
return efi_binary return efi_binary
def enable_kext(self, kext_name, kext_version, kext_path, check=False): def enable_kext(self, kext_name: str, kext_version: str, kext_path: Path, check: bool = False) -> None:
kext = self.get_kext_by_bundle_path(kext_name) """
Enables a kext in the config.plist
Parameters:
kext_name (str): Name of the kext
kext_version (str): Version of the kext
kext_path (Path): Path to the kext
"""
kext: dict = self.get_kext_by_bundle_path(kext_name)
if callable(check) and not check(): if callable(check) and not check():
# Check failed # Check failed
@@ -56,7 +100,11 @@ class build_support:
kext["Enabled"] = True kext["Enabled"] = True
def sign_files(self): def sign_files(self) -> None:
"""
Signs files for on OpenCorePkg's Vault system
"""
if self.constants.vault is False: if self.constants.vault is False:
return return
@@ -72,9 +120,13 @@ class build_support:
subprocess.run([str(self.constants.vault_path), f"{self.constants.oc_folder}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) subprocess.run([str(self.constants.vault_path), f"{self.constants.oc_folder}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
def validate_pathing(self): def validate_pathing(self) -> None:
# Verify whether all files are accounted for on-disk """
# This ensures that OpenCore won't hit a critical error and fail to boot Validate whether all files are accounted for on-disk
This ensures that OpenCore won't hit a critical error and fail to boot
"""
logging.info("- Validating generated config") logging.info("- Validating generated config")
if not Path(self.constants.opencore_release_folder / Path("EFI/OC/config.plist")): if not Path(self.constants.opencore_release_folder / Path("EFI/OC/config.plist")):
logging.info("- OpenCore config file missing!!!") logging.info("- OpenCore config file missing!!!")
@@ -124,7 +176,11 @@ class build_support:
raise Exception(f"Found extra driver: {driver_file.name}") raise Exception(f"Found extra driver: {driver_file.name}")
def cleanup(self): def cleanup(self) -> None:
"""
Clean up files and entries
"""
logging.info("- Cleaning up files") logging.info("- Cleaning up files")
# Remove unused entries # Remove unused entries
entries_to_clean = { entries_to_clean = {

View File

@@ -12,8 +12,8 @@ from data import os_data
class Constants: class Constants:
def __init__(self) -> None: def __init__(self) -> None:
# Patcher Versioning # Patcher Versioning
self.patcher_version: str = "0.6.2" # OpenCore-Legacy-Patcher self.patcher_version: str = "0.6.5" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version: str = "0.8.7" # PatcherSupportPkg self.patcher_support_pkg_version: str = "0.9.7" # PatcherSupportPkg
self.copyright_date: str = "Copyright © 2020-2023 Dortania" self.copyright_date: str = "Copyright © 2020-2023 Dortania"
# URLs # URLs
@@ -26,8 +26,8 @@ class Constants:
# OpenCore Versioning # OpenCore Versioning
# https://github.com/acidanthera/OpenCorePkg # https://github.com/acidanthera/OpenCorePkg
self.opencore_commit: str = "e4f0ba1 - 03-06-2023" self.opencore_commit: str = "41b8aca - 04-03-2023"
self.opencore_version: str = "0.9.0" self.opencore_version: str = "0.9.1"
# Kext Versioning # Kext Versioning
## Acidanthera ## Acidanthera
@@ -35,14 +35,14 @@ class Constants:
self.lilu_version: str = "1.6.4" # Lilu self.lilu_version: str = "1.6.4" # Lilu
self.whatevergreen_version: str = "1.6.4" # WhateverGreen self.whatevergreen_version: str = "1.6.4" # WhateverGreen
self.whatevergreen_navi_version: str = "1.6.4-Navi" # WhateverGreen (Navi Patch) self.whatevergreen_navi_version: str = "1.6.4-Navi" # WhateverGreen (Navi Patch)
self.airportbcrmfixup_version: str = "2.1.6" # AirPortBrcmFixup self.airportbcrmfixup_version: str = "2.1.7" # AirPortBrcmFixup
self.nvmefix_version: str = "1.1.0" # NVMeFix self.nvmefix_version: str = "1.1.0" # NVMeFix
self.applealc_version: str = "1.6.3" # AppleALC self.applealc_version: str = "1.6.3" # AppleALC
self.restrictevents_version: str = "1.0.9" # RestrictEvents self.restrictevents_version: str = "1.1.1" # RestrictEvents
self.featureunlock_version: str = "1.1.4" # FeatureUnlock self.featureunlock_version: str = "1.1.4" # FeatureUnlock
self.debugenhancer_version: str = "1.0.7" # DebugEnhancer self.debugenhancer_version: str = "1.0.7" # DebugEnhancer
self.cpufriend_version: str = "1.2.6" # CPUFriend self.cpufriend_version: str = "1.2.6" # CPUFriend
self.bluetool_version: str = "2.6.4" # BlueToolFixup (BrcmPatchRAM) self.bluetool_version: str = "2.6.5" # BlueToolFixup (BrcmPatchRAM)
self.cslvfixup_version: str = "2.6.1" # CSLVFixup self.cslvfixup_version: str = "2.6.1" # CSLVFixup
self.autopkg_version: str = "1.0.2" # AutoPkgInstaller self.autopkg_version: str = "1.0.2" # AutoPkgInstaller
self.cryptexfixup_version: str = "1.0.1" # CryptexFixup self.cryptexfixup_version: str = "1.0.1" # CryptexFixup
@@ -75,12 +75,13 @@ class Constants:
## Dortania ## Dortania
## https://github.com/dortania ## https://github.com/dortania
self.backlight_injector_version: str = "1.1.0" # BacklightInjector self.backlight_injector_version: str = "1.1.0" # BacklightInjector
self.smcspoof_version: str = "1.0.0" # SMC-Spoof self.backlight_injectorA_version: str = "1.0.0" # BacklightInjector (iMac9,1)
self.mce_version: str = "1.0.0" # AppleMCEReporterDisabler self.smcspoof_version: str = "1.0.0" # SMC-Spoof
self.btspoof_version: str = "1.0.0" # Bluetooth-Spoof self.mce_version: str = "1.0.0" # AppleMCEReporterDisabler
self.aspp_override_version: str = "1.0.1" # ACPI_SMC_PlatformPlugin Override self.btspoof_version: str = "1.0.0" # Bluetooth-Spoof
self.rsrhelper_version: str = "1.0.0" # RSRHelper self.aspp_override_version: str = "1.0.1" # ACPI_SMC_PlatformPlugin Override
self.rsrhelper_version: str = "1.0.0" # RSRHelper
## Syncretic ## Syncretic
## https://forums.macrumors.com/members/syncretic.1173816/ ## https://forums.macrumors.com/members/syncretic.1173816/
@@ -127,7 +128,7 @@ class Constants:
self.launcher_binary: str = None # Determine launch binary path (ie. Python vs PyInstaller) self.launcher_binary: str = None # Determine launch binary path (ie. Python vs PyInstaller)
self.launcher_script: str = None # Determine launch file path (None if PyInstaller) self.launcher_script: str = None # Determine launch file path (None if PyInstaller)
self.booted_oc_disk: str = None # Determine current disk OCLP booted from self.booted_oc_disk: str = None # Determine current disk OCLP booted from
self.unpack_thread = None # Determine if unpack thread finished (threading.Thread) self.unpack_thread = None # Determine if unpack thread finished (threading.Thread)
self.commit_info: tuple = (None, None, None) # Commit info (Branch, Commit Date, Commit URL) self.commit_info: tuple = (None, None, None) # Commit info (Branch, Commit Date, Commit URL)
@@ -155,10 +156,6 @@ class Constants:
self.override_smbios: str = "Default" # Set SMBIOS model used self.override_smbios: str = "Default" # Set SMBIOS model used
self.allow_native_spoofs: bool = False # Allow native models to recieve spoofs self.allow_native_spoofs: bool = False # Allow native models to recieve spoofs
### RestrictEvents CPU renaming
self.custom_cpu_model: int = 2 # Patch type value
self.custom_cpu_model_value: str = "" # New CPU name within About This Mac
### Serial Number Overrides ### Serial Number Overrides
self.custom_serial_number: str = "" # Set SMBIOS serial number self.custom_serial_number: str = "" # Set SMBIOS serial number
self.custom_board_serial_number: str = "" # Set SMBIOS board serial number self.custom_board_serial_number: str = "" # Set SMBIOS board serial number
@@ -241,6 +238,10 @@ class Constants:
def auto_patch_launch_agent_path(self): def auto_patch_launch_agent_path(self):
return self.payload_path / Path("com.dortania.opencore-legacy-patcher.auto-patch.plist") return self.payload_path / Path("com.dortania.opencore-legacy-patcher.auto-patch.plist")
@property
def rsr_monitor_launch_daemon_path(self):
return self.payload_path / Path("com.dortania.opencore-legacy-patcher.rsr-monitor.plist")
# ACPI # ACPI
@property @property
def pci_ssdt_path(self): def pci_ssdt_path(self):
@@ -412,6 +413,10 @@ class Constants:
def backlight_injector_path(self): def backlight_injector_path(self):
return self.payload_kexts_path / Path(f"Misc/BacklightInjector-v{self.backlight_injector_version}.zip") return self.payload_kexts_path / Path(f"Misc/BacklightInjector-v{self.backlight_injector_version}.zip")
@property
def backlight_injectorA_path(self):
return self.payload_kexts_path / Path(f"Misc/BacklightInjectorA-v{self.backlight_injectorA_version}.zip")
@property @property
def cpufriend_path(self): def cpufriend_path(self):
return self.payload_kexts_path / Path(f"Acidanthera/CPUFriend-v{self.cpufriend_version}-{self.kext_variant}.zip") return self.payload_kexts_path / Path(f"Acidanthera/CPUFriend-v{self.cpufriend_version}-{self.kext_variant}.zip")

View File

@@ -146,12 +146,6 @@ class GenerateDefaults:
self.constants.custom_serial_number = "" self.constants.custom_serial_number = ""
self.constants.custom_board_serial_number = "" self.constants.custom_board_serial_number = ""
custom_cpu_model_value = utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True)
if custom_cpu_model_value is not None:
# TODO: Fix to not use two separate variables
self.constants.custom_cpu_model = 1
self.constants.custom_cpu_model_value = custom_cpu_model_value.split("%00")[0]
def _networking_probe(self) -> None: def _networking_probe(self) -> None:
""" """
@@ -309,7 +303,8 @@ class GenerateDefaults:
# Only disable AMFI if we officially support Ventura # Only disable AMFI if we officially support Ventura
self.constants.disable_amfi = True self.constants.disable_amfi = True
# Enable BetaBlur if user hasn't disabled it for key in ["Moraea_BlurBeta"]:
is_blur_enabled = subprocess.run(["defaults", "read", "-g", "Moraea_BlurBeta"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip() # Enable BetaBlur if user hasn't disabled it
if is_blur_enabled in ["false", "0"]: is_key_enabled = subprocess.run(["defaults", "read", "-g", key], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
subprocess.run(["defaults", "write", "-g", "Moraea_BlurBeta", "-bool", "true"]) if is_key_enabled not in ["false", "0"]:
subprocess.run(["defaults", "write", "-g", key, "-bool", "true"])

View File

@@ -6,6 +6,7 @@ import enum
import itertools import itertools
import subprocess import subprocess
import plistlib import plistlib
import hashlib
from pathlib import Path from pathlib import Path
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import Any, ClassVar, Optional, Type, Union from typing import Any, ClassVar, Optional, Type, Union
@@ -52,7 +53,7 @@ class PCIDevice:
if type(ioname) is bytes: if type(ioname) is bytes:
ioname = ioname.strip(b"\0").decode() ioname = ioname.strip(b"\0").decode()
if ioname.startswith("pci"): if ioname.startswith("pci") and "," in ioname:
vendor_id_unspoofed, device_id_unspoofed = (int(i, 16) for i in ioname[3:].split(",")) vendor_id_unspoofed, device_id_unspoofed = (int(i, 16) for i in ioname[3:].split(","))
if anti_spoof: if anti_spoof:
vendor_id = vendor_id_unspoofed vendor_id = vendor_id_unspoofed
@@ -491,6 +492,7 @@ class Computer:
reported_model: Optional[str] = None reported_model: Optional[str] = None
reported_board_id: Optional[str] = None reported_board_id: Optional[str] = None
build_model: Optional[str] = None build_model: Optional[str] = None
uuid_sha1: Optional[str] = None
gpus: list[GPU] = field(default_factory=list) gpus: list[GPU] = field(default_factory=list)
igpu: Optional[GPU] = None # Shortcut for IGPU igpu: Optional[GPU] = None # Shortcut for IGPU
dgpu: Optional[GPU] = None # Shortcut for GFX0 dgpu: Optional[GPU] = None # Shortcut for GFX0
@@ -719,6 +721,8 @@ class Computer:
else: else:
board = "board-id" board = "board-id"
self.reported_board_id = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(entry, board, ioreg.kCFAllocatorDefault, ioreg.kNilOptions)).strip(b"\0").decode() # type: ignore self.reported_board_id = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(entry, board, ioreg.kCFAllocatorDefault, ioreg.kNilOptions)).strip(b"\0").decode() # type: ignore
self.uuid_sha1 = ioreg.corefoundation_to_native(ioreg.IORegistryEntryCreateCFProperty(entry, "IOPlatformUUID", ioreg.kCFAllocatorDefault, ioreg.kNilOptions)) # type: ignore
self.uuid_sha1 = hashlib.sha1(self.uuid_sha1.encode()).hexdigest()
ioreg.IOObjectRelease(entry) ioreg.IOObjectRelease(entry)
# Real model # Real model

View File

@@ -34,12 +34,12 @@ class gui_help_menu:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Patcher Resources", pos=(10,10)) self.header = wx.StaticText(self.frame_modal, label="Patcher Resources", pos=(10,10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame_modal, label="Following resources are available:") self.subheader = wx.StaticText(self.frame_modal, label="Following resources are available:")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,

View File

@@ -15,9 +15,6 @@ import webbrowser
import time import time
import binascii
import hashlib
import logging import logging
import tempfile import tempfile
@@ -387,12 +384,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame, label="Relaunching as root") self.header = wx.StaticText(self.frame, label="Relaunching as root")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Add count down label # Add count down label
self.countdown_label = wx.StaticText(self.frame, label=f"Closing old process in {timer_val} seconds") self.countdown_label = wx.StaticText(self.frame, label=f"Closing old process in {timer_val} seconds")
self.countdown_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.countdown_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
# Set below header # Set below header
self.countdown_label.SetPosition( self.countdown_label.SetPosition(
( (
@@ -403,7 +400,7 @@ class wx_python_gui:
self.countdown_label.Centre(wx.HORIZONTAL) self.countdown_label.Centre(wx.HORIZONTAL)
# Label: You can close this window if app finished relaunching # Label: You can close this window if app finished relaunching
self.countdown_label2 = wx.StaticText(self.frame, label="You can close this window if app finished relaunching") self.countdown_label2 = wx.StaticText(self.frame, label="You can close this window if app finished relaunching")
self.countdown_label2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.countdown_label2.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
# Set below countdown label # Set below countdown label
self.countdown_label2.SetPosition( self.countdown_label2.SetPosition(
( (
@@ -443,7 +440,7 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame, label="🚧 Not Yet Implemented") self.header = wx.StaticText(self.frame, label="🚧 Not Yet Implemented")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Return to main menu # Return to main menu
@@ -474,12 +471,12 @@ class wx_python_gui:
self.frame.SetTitle(f"OpenCore Legacy Patcher ({self.constants.patcher_version})") self.frame.SetTitle(f"OpenCore Legacy Patcher ({self.constants.patcher_version})")
# Header # Header
self.header = wx.StaticText(self.frame, label=f"OpenCore Legacy Patcher v{self.constants.patcher_version}") self.header = wx.StaticText(self.frame, label=f"OpenCore Legacy Patcher v{self.constants.patcher_version}")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame, label=f"Model: {self.constants.custom_model or self.computer.real_model}") self.subheader = wx.StaticText(self.frame, label=f"Model: {self.constants.custom_model or self.computer.real_model}")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -566,7 +563,7 @@ class wx_python_gui:
# Copyright Label # Copyright Label
self.copyright = wx.StaticText(self.frame, label=self.constants.copyright_date) self.copyright = wx.StaticText(self.frame, label=self.constants.copyright_date)
self.copyright.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.copyright.SetFont(wx.Font(9, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.copyright.SetPosition( self.copyright.SetPosition(
wx.Point( wx.Point(
self.help_button.GetPosition().x, self.help_button.GetPosition().x,
@@ -611,12 +608,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Patcher Resources", pos=(10,10)) self.header = wx.StaticText(self.frame_modal, label="Patcher Resources", pos=(10,10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame_modal, label="Following resources are available:") self.subheader = wx.StaticText(self.frame_modal, label="Following resources are available:")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -693,12 +690,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Build and Install OpenCore", pos=(10,10)) self.header = wx.StaticText(self.frame_modal, label="Build and Install OpenCore", pos=(10,10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame_modal, label=f"Model: {self.constants.custom_model or self.computer.real_model}") self.subheader = wx.StaticText(self.frame_modal, label=f"Model: {self.constants.custom_model or self.computer.real_model}")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -722,7 +719,7 @@ class wx_python_gui:
# Redirect stdout to a text box # Redirect stdout to a text box
self.stdout_text = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY) self.stdout_text = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY)
self.stdout_text.SetPosition(wx.Point(self.build_opencore.GetPosition().x, self.build_opencore.GetPosition().y + self.build_opencore.GetSize().height + 10)) self.stdout_text.SetPosition(wx.Point(self.build_opencore.GetPosition().x, self.build_opencore.GetPosition().y + self.build_opencore.GetSize().height + 10))
self.stdout_text.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.stdout_text.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
# Set width to same as frame # Set width to same as frame
self.stdout_text.SetSize(self.WINDOW_WIDTH_BUILD, 340) self.stdout_text.SetSize(self.WINDOW_WIDTH_BUILD, 340)
# Centre the text box to top of window # Centre the text box to top of window
@@ -752,7 +749,7 @@ class wx_python_gui:
while self.is_unpack_finished() is False: while self.is_unpack_finished() is False:
time.sleep(0.1) time.sleep(0.1)
build.build_opencore(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)
# Once finished, change build_opencore button to "Install OpenCore" # Once finished, change build_opencore button to "Install OpenCore"
self.build_opencore.SetLabel("🔩 Install OpenCore") self.build_opencore.SetLabel("🔩 Install OpenCore")
self.build_opencore.Bind(wx.EVT_BUTTON, self.install_menu) self.build_opencore.Bind(wx.EVT_BUTTON, self.install_menu)
@@ -780,12 +777,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame, label="Install OpenCore") self.header = wx.StaticText(self.frame, label="Install OpenCore")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader: Select Disk to install OpenCore onto # Subheader: Select Disk to install OpenCore onto
self.subheader = wx.StaticText(self.frame, label="Select Disk to install OpenCore onto") self.subheader = wx.StaticText(self.frame, label="Select Disk to install OpenCore onto")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -796,7 +793,7 @@ class wx_python_gui:
# Label: If you're missing disks, ensure they're either FAT32 or formatted as GUI/GPT # Label: If you're missing disks, ensure they're either FAT32 or formatted as GUI/GPT
self.missing_disks = wx.StaticText(self.frame, label="Loading disks shortly...") self.missing_disks = wx.StaticText(self.frame, label="Loading disks shortly...")
self.missing_disks.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.missing_disks.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.missing_disks.SetPosition( self.missing_disks.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -806,7 +803,7 @@ class wx_python_gui:
self.missing_disks.Centre(wx.HORIZONTAL) self.missing_disks.Centre(wx.HORIZONTAL)
self.color_note = wx.StaticText(self.frame, label="Note: Blue represent the disk OpenCore is currently booted from") self.color_note = wx.StaticText(self.frame, label="Note: Blue represent the disk OpenCore is currently booted from")
self.color_note.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.color_note.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.color_note.SetPosition( self.color_note.SetPosition(
wx.Point( wx.Point(
self.missing_disks.GetPosition().x, self.missing_disks.GetPosition().x,
@@ -879,7 +876,7 @@ class wx_python_gui:
else: else:
# Label: No disks found # Label: No disks found
self.install_button = wx.StaticText(self.frame, label="Failed to find any applicable disks") self.install_button = wx.StaticText(self.frame, label="Failed to find any applicable disks")
self.install_button.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.install_button.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.install_button.SetPosition( self.install_button.SetPosition(
wx.Point( wx.Point(
self.color_note.GetPosition().x, self.color_note.GetPosition().x,
@@ -919,12 +916,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Install OpenCore", pos=(10,10)) self.header = wx.StaticText(self.frame_modal, label="Install OpenCore", pos=(10,10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader: Select Partition to install OpenCore onto # Subheader: Select Partition to install OpenCore onto
self.subheader = wx.StaticText(self.frame_modal, label="Select Partition to install OpenCore onto") self.subheader = wx.StaticText(self.frame_modal, label="Select Partition to install OpenCore onto")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -971,14 +968,14 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Install OpenCore", pos=(10,10)) self.header = wx.StaticText(self.frame_modal, label="Install OpenCore", pos=(10,10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Textbox # Textbox
# Redirect stdout to a text box # Redirect stdout to a text box
self.stdout_text = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY) self.stdout_text = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY)
self.stdout_text.SetPosition(wx.Point(self.header.GetPosition().x, self.header.GetPosition().y + self.header.GetSize().height + 10)) self.stdout_text.SetPosition(wx.Point(self.header.GetPosition().x, self.header.GetPosition().y + self.header.GetSize().height + 10))
self.stdout_text.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.stdout_text.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
# Set width to same as frame # Set width to same as frame
self.stdout_text.SetSize(self.WINDOW_WIDTH_BUILD - 40, 240) self.stdout_text.SetSize(self.WINDOW_WIDTH_BUILD - 40, 240)
# Centre the text box to top of window # Centre the text box to top of window
@@ -1064,12 +1061,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label=f"Post-Install Menu", pos=(10,10)) self.header = wx.StaticText(self.frame_modal, label=f"Post-Install Menu", pos=(10,10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame_modal, label="Available patches for system:") self.subheader = wx.StaticText(self.frame_modal, label="Available patches for system:")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1098,7 +1095,7 @@ class wx_python_gui:
if (not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True): if (not patch.startswith("Settings") and not patch.startswith("Validation") and patches[patch] is True):
logging.info(f"- Adding patch: {patch} - {patches[patch]}") logging.info(f"- Adding patch: {patch} - {patches[patch]}")
self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch}") self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch}")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1108,7 +1105,7 @@ class wx_python_gui:
i = i + self.patch_label.GetSize().height + 3 i = i + self.patch_label.GetSize().height + 3
else: else:
self.patch_label = wx.StaticText(self.frame_modal, label=f"All applicable patches already installed") self.patch_label = wx.StaticText(self.frame_modal, label=f"All applicable patches already installed")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1119,7 +1116,7 @@ class wx_python_gui:
self.patch_label.Centre(wx.HORIZONTAL) self.patch_label.Centre(wx.HORIZONTAL)
if patches["Validation: Patching Possible"] is False: if patches["Validation: Patching Possible"] is False:
self.patch_label = wx.StaticText(self.frame_modal, label="Cannot Patch due to following reasons:") self.patch_label = wx.StaticText(self.frame_modal, label="Cannot Patch due to following reasons:")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1134,7 +1131,7 @@ class wx_python_gui:
if patch.startswith("Validation") and patches[patch] is True: if patch.startswith("Validation") and patches[patch] is True:
logging.info(f"- Adding check: {patch} - {patches[patch]}") logging.info(f"- Adding check: {patch} - {patches[patch]}")
self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch[12:]}") self.patch_label = wx.StaticText(self.frame_modal, label=f"- {patch[12:]}")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1146,7 +1143,7 @@ class wx_python_gui:
i += 10 i += 10
if self.constants.host_is_hackintosh is False: if self.constants.host_is_hackintosh is False:
self.patch_label = wx.StaticText(self.frame_modal, label="Please run 'Build and Install OpenCore' and reboot") self.patch_label = wx.StaticText(self.frame_modal, label="Please run 'Build and Install OpenCore' and reboot")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1157,7 +1154,7 @@ class wx_python_gui:
i = i + self.patch_label.GetSize().height + 3 i = i + self.patch_label.GetSize().height + 3
self.patch_label = wx.StaticText(self.frame_modal, label="to remove these errors.") self.patch_label = wx.StaticText(self.frame_modal, label="to remove these errors.")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1178,7 +1175,7 @@ class wx_python_gui:
patch_text = f"{self.constants.computer.oclp_sys_version}, {date}" patch_text = f"{self.constants.computer.oclp_sys_version}, {date}"
self.patch_label = wx.StaticText(self.frame_modal, label="Root Volume last patched:") self.patch_label = wx.StaticText(self.frame_modal, label="Root Volume last patched:")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1189,7 +1186,7 @@ class wx_python_gui:
i = i + self.patch_label.GetSize().height + 3 i = i + self.patch_label.GetSize().height + 3
self.patch_label = wx.StaticText(self.frame_modal, label=patch_text) self.patch_label = wx.StaticText(self.frame_modal, label=patch_text)
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x + 20, self.subheader.GetPosition().x + 20,
@@ -1201,7 +1198,7 @@ class wx_python_gui:
else: else:
# Prompt user with no patches found # Prompt user with no patches found
self.patch_label = wx.StaticText(self.frame_modal, label="No patches needed") self.patch_label = wx.StaticText(self.frame_modal, label="No patches needed")
self.patch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.patch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.patch_label.SetPosition( self.patch_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1271,12 +1268,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame, label="Root Patching", pos=(10, 10)) self.header = wx.StaticText(self.frame, label="Root Patching", pos=(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame, label="Preparing PatcherSupportPkg binaries") self.subheader = wx.StaticText(self.frame, label="Preparing PatcherSupportPkg binaries")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1286,7 +1283,7 @@ class wx_python_gui:
self.subheader.Centre(wx.HORIZONTAL) self.subheader.Centre(wx.HORIZONTAL)
self.developer_note = wx.StaticText(self.frame, label="Starting shortly") self.developer_note = wx.StaticText(self.frame, label="Starting shortly")
self.developer_note.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.developer_note.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.developer_note.SetPosition( self.developer_note.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1399,12 +1396,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Root Patching", pos=(10, 10)) self.header = wx.StaticText(self.frame_modal, label="Root Patching", pos=(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame_modal, label="Starting root volume patching") self.subheader = wx.StaticText(self.frame_modal, label="Starting root volume patching")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1414,7 +1411,7 @@ class wx_python_gui:
self.subheader.Centre(wx.HORIZONTAL) self.subheader.Centre(wx.HORIZONTAL)
self.developer_note = wx.StaticText(self.frame_modal, label="Starting shortly") self.developer_note = wx.StaticText(self.frame_modal, label="Starting shortly")
self.developer_note.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.developer_note.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.developer_note.SetPosition( self.developer_note.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1425,7 +1422,7 @@ class wx_python_gui:
# Text Box # Text Box
self.text_box = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY) self.text_box = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY)
self.text_box.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.text_box.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.text_box.SetPosition( self.text_box.SetPosition(
wx.Point( wx.Point(
self.developer_note.GetPosition().x, self.developer_note.GetPosition().x,
@@ -1504,7 +1501,7 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Revert Root Patches", pos=(10, 10)) self.header = wx.StaticText(self.frame_modal, label="Revert Root Patches", pos=(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
@@ -1512,7 +1509,7 @@ class wx_python_gui:
self.subheader = wx.StaticText(self.frame_modal, label="Currently experimental in Big Sur") self.subheader = wx.StaticText(self.frame_modal, label="Currently experimental in Big Sur")
else: else:
self.subheader = wx.StaticText(self.frame_modal, label="Reverting to last sealed snapshot") self.subheader = wx.StaticText(self.frame_modal, label="Reverting to last sealed snapshot")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1522,7 +1519,7 @@ class wx_python_gui:
self.subheader.Centre(wx.HORIZONTAL) self.subheader.Centre(wx.HORIZONTAL)
self.developer_note = wx.StaticText(self.frame_modal, label="Starting shortly") self.developer_note = wx.StaticText(self.frame_modal, label="Starting shortly")
self.developer_note.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.developer_note.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.developer_note.SetPosition( self.developer_note.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -1533,7 +1530,7 @@ class wx_python_gui:
# Text Box # Text Box
self.text_box = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY) self.text_box = wx.TextCtrl(self.frame_modal, style=wx.TE_MULTILINE | wx.TE_READONLY)
self.text_box.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.text_box.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.text_box.SetPosition( self.text_box.SetPosition(
wx.Point( wx.Point(
self.developer_note.GetPosition().x, self.developer_note.GetPosition().x,
@@ -1592,7 +1589,7 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Create macOS Installer", pos=wx.Point(10, 10)) self.header = wx.StaticText(self.frame_modal, label="Create macOS Installer", pos=wx.Point(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Button: Download macOS Installer # Button: Download macOS Installer
@@ -1635,12 +1632,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame, label="Pulling installer catalog") self.header = wx.StaticText(self.frame, label="Pulling installer catalog")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Label: Download... # Label: Download...
self.download_label = wx.StaticText(self.frame, label="Downloading installer catalog...") self.download_label = wx.StaticText(self.frame, label="Downloading installer catalog...")
self.download_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.download_label.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
self.download_label.SetPosition( self.download_label.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1699,12 +1696,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Download macOS Installer", pos=wx.Point(10, 10)) self.header = wx.StaticText(self.frame_modal, label="Download macOS Installer", pos=wx.Point(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader: # Subheader:
self.subheader = wx.StaticText(self.frame_modal, label="Installers currently available from Apple:") self.subheader = wx.StaticText(self.frame_modal, label="Installers currently available from Apple:")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1744,7 +1741,7 @@ class wx_python_gui:
self.subheader.GetPosition().y + self.subheader.GetSize().height + i self.subheader.GetPosition().y + self.subheader.GetSize().height + i
) )
) )
self.install_selection.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.install_selection.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.install_selection.Centre(wx.HORIZONTAL) self.install_selection.Centre(wx.HORIZONTAL)
self.load_all_installers = wx.Button(self.frame_modal, label="Show all available installers") self.load_all_installers = wx.Button(self.frame_modal, label="Show all available installers")
@@ -1785,7 +1782,7 @@ class wx_python_gui:
if model in ["MacPro3,1", "MacPro4,1", "MacPro5,1"]: if model in ["MacPro3,1", "MacPro4,1", "MacPro5,1"]:
has_legacy_usb = True has_legacy_usb = True
issues_list = "- Lack of Keyboard/Mouse in macOS installer without a USB hub\n" issues_list = "- Lack of Keyboard/Mouse in macOS installer without a USB hub\n"
elif model in smbios_data.smbios_dictionary[model]: elif model in smbios_data.smbios_dictionary:
if "CPU Generation" in smbios_data.smbios_dictionary[model]: if "CPU Generation" in smbios_data.smbios_dictionary[model]:
if smbios_data.smbios_dictionary[model]["CPU Generation"] <= cpu_data.cpu_data.penryn: if smbios_data.smbios_dictionary[model]["CPU Generation"] <= cpu_data.cpu_data.penryn:
has_legacy_usb = True has_legacy_usb = True
@@ -1827,12 +1824,12 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame, label=f"Downloading {installer_name}") self.header = wx.StaticText(self.frame, label=f"Downloading {installer_name}")
self.frame.SetSize(self.header.GetSize().width + 200, -1) self.frame.SetSize(self.header.GetSize().width + 200, -1)
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Label: Download... # Label: Download...
self.download_label = wx.StaticText(self.frame, label="Starting download shortly...") self.download_label = wx.StaticText(self.frame, label="Starting download shortly...")
self.download_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.download_label.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
self.download_label.SetPosition( self.download_label.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1842,7 +1839,7 @@ class wx_python_gui:
self.download_label.Centre(wx.HORIZONTAL) self.download_label.Centre(wx.HORIZONTAL)
self.download_label_2 = wx.StaticText(self.frame, label="") self.download_label_2 = wx.StaticText(self.frame, label="")
self.download_label_2.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.download_label_2.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.download_label_2.SetPosition( self.download_label_2.SetPosition(
wx.Point( wx.Point(
self.download_label.GetPosition().x, self.download_label.GetPosition().x,
@@ -1908,12 +1905,12 @@ class wx_python_gui:
# Header: Verifying InstallAssistant.pkg # Header: Verifying InstallAssistant.pkg
self.header = wx.StaticText(self.frame, label="Verifying InstallAssistant.pkg") self.header = wx.StaticText(self.frame, label="Verifying InstallAssistant.pkg")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Label: Verifying Chunk 0 of 1200 # Label: Verifying Chunk 0 of 1200
self.verifying_chunk_label = wx.StaticText(self.frame, label="Verifying Chunk 0 of 1200") self.verifying_chunk_label = wx.StaticText(self.frame, label="Verifying Chunk 0 of 1200")
self.verifying_chunk_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.verifying_chunk_label.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
self.verifying_chunk_label.SetPosition( self.verifying_chunk_label.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -1950,38 +1947,36 @@ class wx_python_gui:
wx.App.Get().Yield() wx.App.Get().Yield()
integrity_path = Path(Path(self.constants.payload_path) / Path(apple_integrity_file_link.split("/")[-1])) integrity_path = Path(Path(self.constants.payload_path) / Path(apple_integrity_file_link.split("/")[-1]))
if network_handler.DownloadObject(apple_integrity_file_link, integrity_path).download_simple(verify_checksum=False): chunklist_stream = network_handler.NetworkUtilities().get(apple_integrity_file_link).content
if chunklist_stream:
# If we're unable to download the integrity file immediately after downloading the IA, there's a legitimate issue # If we're unable to download the integrity file immediately after downloading the IA, there's a legitimate issue
# on Apple's end. # on Apple's end.
# Fail gracefully and just head to installing the IA. # Fail gracefully and just head to installing the IA.
utilities.disable_sleep_while_running() utilities.disable_sleep_while_running()
apple_integrity_file = str(integrity_path) chunk_obj = integrity_verification.ChunklistVerification(self.constants.payload_path / Path("InstallAssistant.pkg"), chunklist_stream)
chunks = integrity_verification.generate_chunklist_dict(str(apple_integrity_file)) if chunk_obj.chunks:
if chunks: self.progress_bar.SetValue(chunk_obj.current_chunk)
max_progress = len(chunks) self.progress_bar.SetRange(chunk_obj.total_chunks)
self.progress_bar.SetValue(0)
self.progress_bar.SetRange(max_progress)
wx.App.Get().Yield() wx.App.Get().Yield()
# See integrity_verification.py for more information on the integrity verification process chunk_obj.validate()
with Path(self.constants.payload_path / Path("InstallAssistant.pkg")).open("rb") as f:
for chunk in chunks: while chunk_obj.status == integrity_verification.ChunklistStatus.IN_PROGRESS:
status = hashlib.sha256(f.read(chunk["length"])).digest() self.progress_bar.SetValue(chunk_obj.current_chunk)
if status != chunk["checksum"]: self.verifying_chunk_label.SetLabel(f"Verifying Chunk {chunk_obj.current_chunk} of {chunk_obj.total_chunks}")
logging.info(f"Chunk {chunks.index(chunk) + 1} checksum status FAIL: chunk sum {binascii.hexlify(chunk['checksum']).decode()}, calculated sum {binascii.hexlify(status).decode()}") wx.App.Get().Yield()
self.popup = wx.MessageDialog(
self.frame, if chunk_obj.status == integrity_verification.ChunklistStatus.FAILURE:
f"We've found that Chunk {chunks.index(chunk) + 1} of {len(chunks)} has failed the integrity check.\n\nThis generally happens when downloading on unstable connections such as WiFi or cellular.\n\nPlease try redownloading again on a stable connection (ie. Ethernet)", self.popup = wx.MessageDialog(
"Corrupted Installer!", self.frame,
style = wx.OK | wx.ICON_EXCLAMATION f"We've found that Chunk {chunk_obj.current_chunk} of {chunk_obj.total_chunks} has failed the integrity check.\n\nThis generally happens when downloading on unstable connections such as WiFi or cellular.\n\nPlease try redownloading again on a stable connection (ie. Ethernet)",
) "Corrupted Installer!",
self.popup.ShowModal() style = wx.OK | wx.ICON_EXCLAMATION
self.main_menu() )
break self.popup.ShowModal()
else: self.main_menu()
self.progress_bar.SetValue(self.progress_bar.GetValue() + 1)
self.verifying_chunk_label.SetLabel(f"Verifying Chunk {self.progress_bar.GetValue()} of {max_progress}") logging.info("Integrity check passed!")
wx.App.Get().Yield()
else: else:
logging.info("Invalid integrity file provided") logging.info("Invalid integrity file provided")
else: else:
@@ -2012,11 +2007,11 @@ class wx_python_gui:
self.frame.SetSize(self.WINDOW_WIDTH_MAIN, self.WINDOW_HEIGHT_MAIN) self.frame.SetSize(self.WINDOW_WIDTH_MAIN, self.WINDOW_HEIGHT_MAIN)
# Header # Header
self.header = wx.StaticText(self.frame, label="Select macOS Installer") self.header = wx.StaticText(self.frame, label="Select macOS Installer")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader: Installers found in /Applications # Subheader: Installers found in /Applications
self.subheader = wx.StaticText(self.frame, label="Searching for Installers in /Applications") self.subheader = wx.StaticText(self.frame, label="Searching for Installers in /Applications")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -2065,7 +2060,17 @@ class wx_python_gui:
logging.info("Installer(s) found:") logging.info("Installer(s) found:")
for app in available_installers: for app in available_installers:
logging.info(f"- {available_installers[app]['Short Name']}: {available_installers[app]['Version']} ({available_installers[app]['Build']})") logging.info(f"- {available_installers[app]['Short Name']}: {available_installers[app]['Version']} ({available_installers[app]['Build']})")
self.install_selection = wx.Button(self.frame, label=f"{available_installers[app]['Short Name']}: {available_installers[app]['Version']} ({available_installers[app]['Build']})", size=(320, 30))
app_str = f"{available_installers[app]['Short Name']}"
unsupported: bool = available_installers[app]['Minimum Host OS'] > self.constants.detected_os
if unsupported:
min_str = os_data.os_conversion.convert_kernel_to_marketing_name(available_installers[app]['Minimum Host OS'])
app_str += f" (Requires {min_str})"
else:
app_str += f": {available_installers[app]['Version']} ({available_installers[app]['Build']})"
self.install_selection = wx.Button(self.frame, label=app_str, size=(320, 30))
i = i + 25 i = i + 25
self.install_selection.SetPosition( self.install_selection.SetPosition(
wx.Point( wx.Point(
@@ -2075,11 +2080,14 @@ class wx_python_gui:
) )
self.install_selection.Bind(wx.EVT_BUTTON, lambda event, temp=app: self.format_usb_menu(available_installers[temp]['Short Name'], available_installers[temp]['Path'])) self.install_selection.Bind(wx.EVT_BUTTON, lambda event, temp=app: self.format_usb_menu(available_installers[temp]['Short Name'], available_installers[temp]['Path']))
self.install_selection.Centre(wx.HORIZONTAL) self.install_selection.Centre(wx.HORIZONTAL)
if unsupported:
self.install_selection.Disable()
else: else:
logging.info("No installers found") logging.info("No installers found")
# Label: No Installers Found # Label: No Installers Found
self.install_selection = wx.StaticText(self.frame, label="No Installers Found in Applications folder") self.install_selection = wx.StaticText(self.frame, label="No Installers Found in Applications folder")
self.install_selection.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.install_selection.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
self.install_selection.SetPosition( self.install_selection.SetPosition(
# Set Position below header # Set Position below header
wx.Point( wx.Point(
@@ -2104,15 +2112,16 @@ class wx_python_gui:
def format_usb_menu(self, installer_name, installer_path): def format_usb_menu(self, installer_name, installer_path):
self.frame.DestroyChildren() self.frame.DestroyChildren()
logging.info(installer_path) logging.info(installer_path)
self.frame.SetSize(370, -1)
# Header # Header
self.header = wx.StaticText(self.frame, label="Format USB") self.header = wx.StaticText(self.frame, label="Format USB")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader: Selected USB will be erased, please backup your data # Subheader: Selected USB will be erased, please backup your data
self.subheader = wx.StaticText(self.frame, label="Selected USB will be erased, please backup your data") self.subheader = wx.StaticText(self.frame, label="Selected USB will be erased, please backup your data")
self.subheader.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.subheader.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -2123,7 +2132,7 @@ class wx_python_gui:
# Label: Select USB # Label: Select USB
self.usb_selection_label = wx.StaticText(self.frame, label="Missing drives? Ensure they're 14GB+ and removable") self.usb_selection_label = wx.StaticText(self.frame, label="Missing drives? Ensure they're 14GB+ and removable")
self.usb_selection_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.usb_selection_label.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.usb_selection_label.SetPosition( self.usb_selection_label.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -2152,7 +2161,7 @@ class wx_python_gui:
logging.info("No disks found") logging.info("No disks found")
# Label: No Disks Found # Label: No Disks Found
self.usb_selection = wx.StaticText(self.frame, label="No Disks Found") self.usb_selection = wx.StaticText(self.frame, label="No Disks Found")
self.usb_selection.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self.usb_selection.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, False, ".AppleSystemUIFont"))
self.usb_selection.SetPosition( self.usb_selection.SetPosition(
# Set Position below header # Set Position below header
wx.Point( wx.Point(
@@ -2176,15 +2185,15 @@ class wx_python_gui:
def format_usb_progress(self, disk, installer_name, installer_path): def format_usb_progress(self, disk, installer_name, installer_path):
self.frame.DestroyChildren() self.frame.DestroyChildren()
self.frame.SetSize(500, -1) self.frame.SetSize(520, -1)
# Header # Header
self.header = wx.StaticText(self.frame, label=f"Creating Installer: {installer_name}") self.header = wx.StaticText(self.frame, label=f"Creating Installer: {installer_name}")
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Label: Creating macOS Installer # Label: Creating macOS Installer
self.creating_macos_installer_label = wx.StaticText(self.frame, label="Formatting and flashing installer to drive") self.creating_macos_installer_label = wx.StaticText(self.frame, label="Formatting and flashing installer to drive")
self.creating_macos_installer_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.creating_macos_installer_label.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.creating_macos_installer_label.SetPosition( self.creating_macos_installer_label.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -2195,7 +2204,7 @@ class wx_python_gui:
# Label: Developer Note: createinstallmedia output currently not implemented # Label: Developer Note: createinstallmedia output currently not implemented
self.developer_note_label = wx.StaticText(self.frame, label="Developer Note: Creating macOS installers can take 30min+ on slower USB drives.") self.developer_note_label = wx.StaticText(self.frame, label="Developer Note: Creating macOS installers can take 30min+ on slower USB drives.")
self.developer_note_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.developer_note_label.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.developer_note_label.SetPosition( self.developer_note_label.SetPosition(
wx.Point( wx.Point(
self.creating_macos_installer_label.GetPosition().x, self.creating_macos_installer_label.GetPosition().x,
@@ -2206,7 +2215,7 @@ class wx_python_gui:
# We will notify you when it's done. Do not close this window however # We will notify you when it's done. Do not close this window however
self.developer_note_label_2 = wx.StaticText(self.frame, label="We will notify you when it's done, please do not close this window however") self.developer_note_label_2 = wx.StaticText(self.frame, label="We will notify you when it's done, please do not close this window however")
self.developer_note_label_2.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.developer_note_label_2.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.developer_note_label_2.SetPosition( self.developer_note_label_2.SetPosition(
wx.Point( wx.Point(
self.developer_note_label.GetPosition().x, self.developer_note_label.GetPosition().x,
@@ -2231,7 +2240,7 @@ class wx_python_gui:
self.progress_bar.Centre(wx.HORIZONTAL) self.progress_bar.Centre(wx.HORIZONTAL)
self.progress_label = wx.StaticText(self.frame, label="Preparing files, beginning shortly...") self.progress_label = wx.StaticText(self.frame, label="Preparing files, beginning shortly...")
self.progress_label.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.progress_label.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.progress_label.SetPosition( self.progress_label.SetPosition(
wx.Point( wx.Point(
self.progress_bar.GetPosition().x, self.progress_bar.GetPosition().x,
@@ -2516,13 +2525,13 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Settings", pos=wx.Point(10, 10)) self.header = wx.StaticText(self.frame_modal, label="Settings", pos=wx.Point(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.SetPosition((-1, 5)) self.header.SetPosition((-1, 5))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader # Subheader
self.subheader = wx.StaticText(self.frame_modal, label="Changing settings here require you") self.subheader = wx.StaticText(self.frame_modal, label="Changing settings here require you")
self.subheader.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.subheader.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition( self.subheader.SetPosition(
wx.Point( wx.Point(
self.header.GetPosition().x, self.header.GetPosition().x,
@@ -2531,7 +2540,7 @@ class wx_python_gui:
) )
self.subheader.Centre(wx.HORIZONTAL) self.subheader.Centre(wx.HORIZONTAL)
self.subheader2 = wx.StaticText(self.frame_modal, label="to run 'Build and Install OpenCore'") self.subheader2 = wx.StaticText(self.frame_modal, label="to run 'Build and Install OpenCore'")
self.subheader2.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.subheader2.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.subheader2.SetPosition( self.subheader2.SetPosition(
wx.Point( wx.Point(
self.subheader.GetPosition().x, self.subheader.GetPosition().x,
@@ -2540,7 +2549,7 @@ class wx_python_gui:
) )
self.subheader2.Centre(wx.HORIZONTAL) self.subheader2.Centre(wx.HORIZONTAL)
self.subheader3 = wx.StaticText(self.frame_modal, label="then reboot for changes to be applied") self.subheader3 = wx.StaticText(self.frame_modal, label="then reboot for changes to be applied")
self.subheader3.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL)) self.subheader3.SetFont(wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, ".AppleSystemUIFont"))
self.subheader3.SetPosition( self.subheader3.SetPosition(
wx.Point( wx.Point(
self.subheader2.GetPosition().x, self.subheader2.GetPosition().x,
@@ -2765,21 +2774,21 @@ class wx_python_gui:
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Developer Settings", style=wx.ALIGN_CENTRE, pos=wx.Point(10, 10)) self.header = wx.StaticText(self.frame_modal, label="Developer Settings", style=wx.ALIGN_CENTRE, pos=wx.Point(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.SetPosition(wx.Point(0, 10)) self.header.SetPosition(wx.Point(0, 10))
self.header.SetSize(wx.Size(self.frame_modal.GetSize().width, 30)) self.header.SetSize(wx.Size(self.frame_modal.GetSize().width, 30))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader: If unfamiliar with the following settings, please do not change them. # Subheader: If unfamiliar with the following settings, please do not change them.
self.subheader = wx.StaticText(self.frame_modal, label="Do not change if unfamiliar", style=wx.ALIGN_CENTRE) self.subheader = wx.StaticText(self.frame_modal, label="Do not change if unfamiliar", style=wx.ALIGN_CENTRE)
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition(wx.Point(0, self.header.GetPosition().y + self.header.GetSize().height)) self.subheader.SetPosition(wx.Point(0, self.header.GetPosition().y + self.header.GetSize().height))
self.subheader.SetSize(wx.Size(self.frame_modal.GetSize().width, 30)) self.subheader.SetSize(wx.Size(self.frame_modal.GetSize().width, 30))
self.subheader.Centre(wx.HORIZONTAL) self.subheader.Centre(wx.HORIZONTAL)
# Label: Set GPU Model for MXM iMacs # Label: Set GPU Model for MXM iMacs
self.label_model = wx.StaticText(self.frame_modal, label="Set GPU Model for MXM iMacs:", style=wx.ALIGN_CENTRE) self.label_model = wx.StaticText(self.frame_modal, label="Set GPU Model for MXM iMacs:", style=wx.ALIGN_CENTRE)
self.label_model.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.label_model.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.label_model.SetPosition(wx.Point(0, self.subheader.GetPosition().y + self.subheader.GetSize().height + 2)) self.label_model.SetPosition(wx.Point(0, self.subheader.GetPosition().y + self.subheader.GetSize().height + 2))
self.label_model.SetSize(wx.Size(self.frame_modal.GetSize().width, 30)) self.label_model.SetSize(wx.Size(self.frame_modal.GetSize().width, 30))
self.label_model.Centre(wx.HORIZONTAL) self.label_model.Centre(wx.HORIZONTAL)
@@ -2795,14 +2804,14 @@ class wx_python_gui:
self.gpu_dropdown.Bind(wx.EVT_CHOICE, self.gpu_selection_click) self.gpu_dropdown.Bind(wx.EVT_CHOICE, self.gpu_selection_click)
self.gpu_dropdown.Centre(wx.HORIZONTAL) self.gpu_dropdown.Centre(wx.HORIZONTAL)
self.gpu_dropdown.SetToolTip(wx.ToolTip("Configures MXM GPU Vendor logic on pre-built models\nIf you are not using MXM iMacs, please leave this setting as is.")) self.gpu_dropdown.SetToolTip(wx.ToolTip("Configures MXM GPU Vendor logic on pre-built models\nIf you are not using MXM iMacs, please leave this setting as is."))
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"] models = ["iMac9,1", "iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"]
if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models): if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models):
self.gpu_dropdown.Disable() self.gpu_dropdown.Disable()
# OpenCore Picker Timeout (using wxSpinCtrl) # OpenCore Picker Timeout (using wxSpinCtrl)
# Label: Picker Timeout # Label: Picker Timeout
self.label_timeout = wx.StaticText(self.frame_modal, label="Picker Timeout (seconds):", style=wx.ALIGN_CENTRE) self.label_timeout = wx.StaticText(self.frame_modal, label="Picker Timeout (seconds):", style=wx.ALIGN_CENTRE)
self.label_timeout.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.label_timeout.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.label_timeout.SetPosition(wx.Point(0, self.gpu_dropdown.GetPosition().y + self.gpu_dropdown.GetSize().height + 2)) self.label_timeout.SetPosition(wx.Point(0, self.gpu_dropdown.GetPosition().y + self.gpu_dropdown.GetSize().height + 2))
self.label_timeout.SetSize(wx.Size(self.frame_modal.GetSize().width, 30)) self.label_timeout.SetSize(wx.Size(self.frame_modal.GetSize().width, 30))
self.label_timeout.Centre(wx.HORIZONTAL) self.label_timeout.Centre(wx.HORIZONTAL)
@@ -2822,7 +2831,7 @@ class wx_python_gui:
self.timeout_spinner.GetPosition().y + self.timeout_spinner.GetSize().height + 5)) self.timeout_spinner.GetPosition().y + self.timeout_spinner.GetSize().height + 5))
self.set_amd_gop_injection.SetValue(self.constants.amd_gop_injection) self.set_amd_gop_injection.SetValue(self.constants.amd_gop_injection)
self.set_amd_gop_injection.Bind(wx.EVT_CHECKBOX, self.amd_gop_injection_checkbox_click) self.set_amd_gop_injection.Bind(wx.EVT_CHECKBOX, self.amd_gop_injection_checkbox_click)
models = ["iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"] models = ["iMac9,1", "iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"]
if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models): if (not self.constants.custom_model and self.computer.real_model not in models) or (self.constants.custom_model and self.constants.custom_model not in models):
self.set_amd_gop_injection.Disable() self.set_amd_gop_injection.Disable()
@@ -2985,12 +2994,23 @@ class wx_python_gui:
self.delete_unused_kdks_checkbox.GetPosition().y + self.delete_unused_kdks_checkbox.GetSize().height)) self.delete_unused_kdks_checkbox.GetPosition().y + self.delete_unused_kdks_checkbox.GetSize().height))
self.set_ignore_app_updates_checkbox.SetToolTip(wx.ToolTip("This will set whether OpenCore will ignore App Updates on launch.\nEnable this option if you do not want to be prompted for App Updates")) self.set_ignore_app_updates_checkbox.SetToolTip(wx.ToolTip("This will set whether OpenCore will ignore App Updates on launch.\nEnable this option if you do not want to be prompted for App Updates"))
# Set Disable Analytics
res = global_settings.GlobalEnviromentSettings().read_property("DisableCrashAndAnalyticsReporting")
res = False if res is None else res
self.set_disable_analytics_checkbox = wx.CheckBox(self.frame_modal, label="Disable Crash/Analytics")
self.set_disable_analytics_checkbox.SetValue(res)
self.set_disable_analytics_checkbox.Bind(wx.EVT_CHECKBOX, self.set_disable_analytics_click)
self.set_disable_analytics_checkbox.SetPosition(wx.Point(
self.set_ignore_app_updates_checkbox.GetPosition().x,
self.set_ignore_app_updates_checkbox.GetPosition().y + self.set_ignore_app_updates_checkbox.GetSize().height))
self.set_disable_analytics_checkbox.SetToolTip(wx.ToolTip("Sets whether anonymized analytics are sent to the Dortania team.\nThis is used to help improve the application and is completely optional."))
# Button: Developer Debug Info # Button: Developer Debug Info
self.debug_button = wx.Button(self.frame_modal, label="Developer Debug Info") self.debug_button = wx.Button(self.frame_modal, label="Developer Debug Info")
self.debug_button.Bind(wx.EVT_BUTTON, self.additional_info_menu) self.debug_button.Bind(wx.EVT_BUTTON, self.additional_info_menu)
self.debug_button.SetPosition(wx.Point( self.debug_button.SetPosition(wx.Point(
self.set_ignore_app_updates_checkbox.GetPosition().x, self.set_disable_analytics_checkbox.GetPosition().x,
self.set_ignore_app_updates_checkbox.GetPosition().y + self.set_ignore_app_updates_checkbox.GetSize().height + 5)) self.set_disable_analytics_checkbox.GetPosition().y + self.set_disable_analytics_checkbox.GetSize().height + 5))
self.debug_button.Center(wx.HORIZONTAL) self.debug_button.Center(wx.HORIZONTAL)
# Button: return to main menu # Button: return to main menu
@@ -3043,6 +3063,9 @@ class wx_python_gui:
else: else:
global_settings.GlobalEnviromentSettings().write_property("IgnoreAppUpdates", False) global_settings.GlobalEnviromentSettings().write_property("IgnoreAppUpdates", False)
def set_disable_analytics_click(self, event):
global_settings.GlobalEnviromentSettings().write_property("DisableCrashAndAnalyticsReporting", self.set_disable_analytics_checkbox.GetValue())
def firewire_click(self, event=None): def firewire_click(self, event=None):
if self.firewire_boot_checkbox.GetValue(): if self.firewire_boot_checkbox.GetValue():
logging.info("Firewire Enabled") logging.info("Firewire Enabled")
@@ -3264,12 +3287,12 @@ class wx_python_gui:
# Header: SMBIOS Settings # Header: SMBIOS Settings
self.smbios_settings_header = wx.StaticText(self.frame_modal, label="SMBIOS Settings", pos=wx.Point(10, 10)) self.smbios_settings_header = wx.StaticText(self.frame_modal, label="SMBIOS Settings", pos=wx.Point(10, 10))
self.smbios_settings_header.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.smbios_settings_header.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.smbios_settings_header.Center(wx.HORIZONTAL) self.smbios_settings_header.Center(wx.HORIZONTAL)
# Label: SMBIOS Spoof Level # Label: SMBIOS Spoof Level
self.smbios_spoof_level_label = wx.StaticText(self.frame_modal, label="SMBIOS Spoof Level") self.smbios_spoof_level_label = wx.StaticText(self.frame_modal, label="SMBIOS Spoof Level")
self.smbios_spoof_level_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.smbios_spoof_level_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.smbios_spoof_level_label.SetPosition( self.smbios_spoof_level_label.SetPosition(
wx.Point(self.smbios_settings_header.GetPosition().x, self.smbios_settings_header.GetPosition().y + self.smbios_settings_header.GetSize().height + 10) wx.Point(self.smbios_settings_header.GetPosition().x, self.smbios_settings_header.GetPosition().y + self.smbios_settings_header.GetSize().height + 10)
) )
@@ -3287,7 +3310,7 @@ class wx_python_gui:
# Label: SMBIOS Spoof Model # Label: SMBIOS Spoof Model
self.smbios_spoof_model_label = wx.StaticText(self.frame_modal, label="SMBIOS Spoof Model") self.smbios_spoof_model_label = wx.StaticText(self.frame_modal, label="SMBIOS Spoof Model")
self.smbios_spoof_model_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.smbios_spoof_model_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.smbios_spoof_model_label.SetPosition( self.smbios_spoof_model_label.SetPosition(
wx.Point(self.smbios_dropdown.GetPosition().x, self.smbios_dropdown.GetPosition().y + self.smbios_dropdown.GetSize().height + 10) wx.Point(self.smbios_dropdown.GetPosition().x, self.smbios_dropdown.GetPosition().y + self.smbios_dropdown.GetSize().height + 10)
) )
@@ -3311,7 +3334,7 @@ class wx_python_gui:
# Label: Custom Serial Number # Label: Custom Serial Number
self.smbios_serial_label = wx.StaticText(self.frame_modal, label="Custom Serial Number") self.smbios_serial_label = wx.StaticText(self.frame_modal, label="Custom Serial Number")
self.smbios_serial_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.smbios_serial_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.smbios_serial_label.SetPosition( self.smbios_serial_label.SetPosition(
wx.Point(self.smbios_model_dropdown.GetPosition().x, self.smbios_model_dropdown.GetPosition().y + self.smbios_model_dropdown.GetSize().height + 10) wx.Point(self.smbios_model_dropdown.GetPosition().x, self.smbios_model_dropdown.GetPosition().y + self.smbios_model_dropdown.GetSize().height + 10)
) )
@@ -3329,7 +3352,7 @@ class wx_python_gui:
# Label: Custom Board Serial Number # Label: Custom Board Serial Number
self.smbios_board_serial_label = wx.StaticText(self.frame_modal, label="Custom Board Serial Number") self.smbios_board_serial_label = wx.StaticText(self.frame_modal, label="Custom Board Serial Number")
self.smbios_board_serial_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.smbios_board_serial_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.smbios_board_serial_label.SetPosition( self.smbios_board_serial_label.SetPosition(
wx.Point(self.smbios_serial_textbox.GetPosition().x, self.smbios_serial_textbox.GetPosition().y + self.smbios_serial_textbox.GetSize().height + 10) wx.Point(self.smbios_serial_textbox.GetPosition().x, self.smbios_serial_textbox.GetPosition().y + self.smbios_serial_textbox.GetSize().height + 10)
) )
@@ -3437,12 +3460,12 @@ class wx_python_gui:
# Header: Additional Info # Header: Additional Info
self.additional_info_header = wx.StaticText(self.frame_modal, label="Developer Debug Info", pos=wx.Point(10, 10)) self.additional_info_header = wx.StaticText(self.frame_modal, label="Developer Debug Info", pos=wx.Point(10, 10))
self.additional_info_header.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.additional_info_header.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.additional_info_header.Center(wx.HORIZONTAL) self.additional_info_header.Center(wx.HORIZONTAL)
# Label: Real User ID # Label: Real User ID
self.real_user_id_label = wx.StaticText(self.frame_modal, label=f"Current UID: {os.getuid()} - ({os.geteuid()})") self.real_user_id_label = wx.StaticText(self.frame_modal, label=f"Current UID: {os.getuid()} - ({os.geteuid()})")
self.real_user_id_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.real_user_id_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.real_user_id_label.SetPosition( self.real_user_id_label.SetPosition(
wx.Point(self.additional_info_header.GetPosition().x, self.additional_info_header.GetPosition().y + self.additional_info_header.GetSize().height + 10) wx.Point(self.additional_info_header.GetPosition().x, self.additional_info_header.GetPosition().y + self.additional_info_header.GetSize().height + 10)
) )
@@ -3452,7 +3475,7 @@ class wx_python_gui:
commit_dict = self.constants.commit_info commit_dict = self.constants.commit_info
# Label: Built from Branch: # Label: Built from Branch:
self.built_from_branch_label = wx.StaticText(self.frame_modal, label=f"Branch: {commit_dict[0]}") self.built_from_branch_label = wx.StaticText(self.frame_modal, label=f"Branch: {commit_dict[0]}")
self.built_from_branch_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.built_from_branch_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.built_from_branch_label.SetPosition( self.built_from_branch_label.SetPosition(
wx.Point(self.real_user_id_label.GetPosition().x, self.real_user_id_label.GetPosition().y + self.real_user_id_label.GetSize().height + 10) wx.Point(self.real_user_id_label.GetPosition().x, self.real_user_id_label.GetPosition().y + self.real_user_id_label.GetSize().height + 10)
) )
@@ -3460,14 +3483,14 @@ class wx_python_gui:
# Label: Built on: (Date) # Label: Built on: (Date)
self.built_on_label = wx.StaticText(self.frame_modal, label=f"Date: {commit_dict[1]}") self.built_on_label = wx.StaticText(self.frame_modal, label=f"Date: {commit_dict[1]}")
self.built_on_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.built_on_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.built_on_label.SetPosition( self.built_on_label.SetPosition(
wx.Point(self.built_from_branch_label.GetPosition().x, self.built_from_branch_label.GetPosition().y + self.built_from_branch_label.GetSize().height + 10) wx.Point(self.built_from_branch_label.GetPosition().x, self.built_from_branch_label.GetPosition().y + self.built_from_branch_label.GetSize().height + 10)
) )
# Label: Commit URL: (hyperlink) # Label: Commit URL: (hyperlink)
self.commit_url_label = wx.StaticText(self.frame_modal, label=f"URL: ") self.commit_url_label = wx.StaticText(self.frame_modal, label=f"URL: ")
self.commit_url_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.commit_url_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.commit_url_label.SetPosition( self.commit_url_label.SetPosition(
wx.Point(self.built_on_label.GetPosition().x, self.built_on_label.GetPosition().y + self.built_on_label.GetSize().height + 10) wx.Point(self.built_on_label.GetPosition().x, self.built_on_label.GetPosition().y + self.built_on_label.GetSize().height + 10)
) )
@@ -3490,7 +3513,7 @@ class wx_python_gui:
# Label: Model Dump # Label: Model Dump
self.model_dump_label = wx.StaticText(self.frame_modal, label="Model Dump") self.model_dump_label = wx.StaticText(self.frame_modal, label="Model Dump")
self.model_dump_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.model_dump_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.model_dump_label.SetPosition( self.model_dump_label.SetPosition(
wx.Point(self.commit_url_label.GetPosition().x, self.commit_url_label.GetPosition().y + self.commit_url_label.GetSize().height + 10) wx.Point(self.commit_url_label.GetPosition().x, self.commit_url_label.GetPosition().y + self.commit_url_label.GetSize().height + 10)
) )
@@ -3515,7 +3538,7 @@ class wx_python_gui:
# Label: Launcher Binary # Label: Launcher Binary
self.launcher_binary_label = wx.StaticText(self.frame_modal, label="Launcher Binary") self.launcher_binary_label = wx.StaticText(self.frame_modal, label="Launcher Binary")
self.launcher_binary_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.launcher_binary_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.launcher_binary_label.SetPosition( self.launcher_binary_label.SetPosition(
wx.Point(self.model_dump_textbox.GetPosition().x, self.model_dump_textbox.GetPosition().y + self.model_dump_textbox.GetSize().height + 10) wx.Point(self.model_dump_textbox.GetPosition().x, self.model_dump_textbox.GetPosition().y + self.model_dump_textbox.GetSize().height + 10)
) )
@@ -3533,7 +3556,7 @@ class wx_python_gui:
# Label: Launcher Script # Label: Launcher Script
self.launcher_script_label = wx.StaticText(self.frame_modal, label="Payload Location") self.launcher_script_label = wx.StaticText(self.frame_modal, label="Payload Location")
self.launcher_script_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.launcher_script_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.launcher_script_label.SetPosition( self.launcher_script_label.SetPosition(
wx.Point(self.launcher_binary_textbox.GetPosition().x, self.launcher_binary_textbox.GetPosition().y + self.launcher_binary_textbox.GetSize().height + 10) wx.Point(self.launcher_binary_textbox.GetPosition().x, self.launcher_binary_textbox.GetPosition().y + self.launcher_binary_textbox.GetSize().height + 10)
) )
@@ -3567,13 +3590,13 @@ class wx_python_gui:
# Title: Configure SIP # Title: Configure SIP
self.configure_sip_title = wx.StaticText(self.frame_modal, label="Configure SIP", pos=wx.Point(10, 10)) self.configure_sip_title = wx.StaticText(self.frame_modal, label="Configure SIP", pos=wx.Point(10, 10))
self.configure_sip_title.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.configure_sip_title.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.configure_sip_title.Center(wx.HORIZONTAL) self.configure_sip_title.Center(wx.HORIZONTAL)
# Label: Flip individual bits corresponding to XNU's csr.h # Label: Flip individual bits corresponding to XNU's csr.h
# If you're unfamiliar with how SIP works, do not touch this menu # If you're unfamiliar with how SIP works, do not touch this menu
self.sip_label = wx.StaticText(self.frame_modal, label="Flip individual bits corresponding to") self.sip_label = wx.StaticText(self.frame_modal, label="Flip individual bits corresponding to")
self.sip_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.sip_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.sip_label.SetPosition( self.sip_label.SetPosition(
wx.Point(-1, self.configure_sip_title.GetPosition().y + self.configure_sip_title.GetSize().height + 10) wx.Point(-1, self.configure_sip_title.GetPosition().y + self.configure_sip_title.GetSize().height + 10)
) )
@@ -3604,35 +3627,35 @@ class wx_python_gui:
self.sip_value = 0x803 self.sip_value = 0x803
self.sip_label_2 = wx.StaticText(self.frame_modal, label=f"Currently configured SIP: {hex(self.sip_value)}") self.sip_label_2 = wx.StaticText(self.frame_modal, label=f"Currently configured SIP: {hex(self.sip_value)}")
self.sip_label_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.sip_label_2.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.sip_label_2.SetPosition( self.sip_label_2.SetPosition(
wx.Point(self.sip_label.GetPosition().x, self.sip_label.GetPosition().y + self.sip_label.GetSize().height + 10) wx.Point(self.sip_label.GetPosition().x, self.sip_label.GetPosition().y + self.sip_label.GetSize().height + 10)
) )
self.sip_label_2.Center(wx.HORIZONTAL) self.sip_label_2.Center(wx.HORIZONTAL)
self.sip_label_2_2 = wx.StaticText(self.frame_modal, label=f"Currently Booted SIP: {hex(py_sip_xnu.SipXnu().get_sip_status().value)}") self.sip_label_2_2 = wx.StaticText(self.frame_modal, label=f"Currently Booted SIP: {hex(py_sip_xnu.SipXnu().get_sip_status().value)}")
self.sip_label_2_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.sip_label_2_2.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.sip_label_2_2.SetPosition( self.sip_label_2_2.SetPosition(
wx.Point(self.sip_label_2.GetPosition().x, self.sip_label_2.GetPosition().y + self.sip_label_2.GetSize().height + 5) wx.Point(self.sip_label_2.GetPosition().x, self.sip_label_2.GetPosition().y + self.sip_label_2.GetSize().height + 5)
) )
self.sip_label_2_2.Center(wx.HORIZONTAL) self.sip_label_2_2.Center(wx.HORIZONTAL)
self.sip_label_3 = wx.StaticText(self.frame_modal, label="For older Macs requiring root patching, we set SIP to\n be partially disabled (0x803) to allow root patching.") self.sip_label_3 = wx.StaticText(self.frame_modal, label="For older Macs requiring root patching, we set SIP to\n be partially disabled (0x803) to allow root patching.")
self.sip_label_3.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.sip_label_3.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.sip_label_3.SetPosition( self.sip_label_3.SetPosition(
wx.Point(self.sip_label_2_2.GetPosition().x, self.sip_label_2_2.GetPosition().y + self.sip_label_2_2.GetSize().height + 10) wx.Point(self.sip_label_2_2.GetPosition().x, self.sip_label_2_2.GetPosition().y + self.sip_label_2_2.GetSize().height + 10)
) )
self.sip_label_3.Center(wx.HORIZONTAL) self.sip_label_3.Center(wx.HORIZONTAL)
self.sip_label_4 = wx.StaticText(self.frame_modal, label="This value (0x803) corresponds to the following bits in csr.h:") self.sip_label_4 = wx.StaticText(self.frame_modal, label="This value (0x803) corresponds to the following bits in csr.h:")
self.sip_label_4.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.sip_label_4.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.sip_label_4.SetPosition( self.sip_label_4.SetPosition(
wx.Point(self.sip_label_3.GetPosition().x, self.sip_label_3.GetPosition().y + self.sip_label_3.GetSize().height + 5) wx.Point(self.sip_label_3.GetPosition().x, self.sip_label_3.GetPosition().y + self.sip_label_3.GetSize().height + 5)
) )
self.sip_label_4.Center(wx.HORIZONTAL) self.sip_label_4.Center(wx.HORIZONTAL)
self.sip_label_5 = wx.StaticText(self.frame_modal, label=" 0x1 - CSR_ALLOW_UNTRUSTED_KEXTS\n 0x2 - CSR_ALLOW_UNRESTRICTED_FS\n 0x800 - CSR_ALLOW_UNAUTHENTICATED_ROOT") self.sip_label_5 = wx.StaticText(self.frame_modal, label=" 0x1 - CSR_ALLOW_UNTRUSTED_KEXTS\n 0x2 - CSR_ALLOW_UNRESTRICTED_FS\n 0x800 - CSR_ALLOW_UNAUTHENTICATED_ROOT")
self.sip_label_5.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.sip_label_5.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.sip_label_5.SetPosition( self.sip_label_5.SetPosition(
wx.Point(self.sip_label_4.GetPosition().x, self.sip_label_4.GetPosition().y + self.sip_label_4.GetSize().height + 7) wx.Point(self.sip_label_4.GetPosition().x, self.sip_label_4.GetPosition().y + self.sip_label_4.GetSize().height + 7)
) )
@@ -3645,7 +3668,7 @@ OpenCore Legacy Patcher by default knows the most ideal
menu can break your installation. menu can break your installation.
""" """
self.sip_label_6 = wx.StaticText(self.frame_modal, label=warning_string) self.sip_label_6 = wx.StaticText(self.frame_modal, label=warning_string)
self.sip_label_6.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.sip_label_6.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.sip_label_6.SetPosition( self.sip_label_6.SetPosition(
wx.Point(self.sip_label_5.GetPosition().x, self.sip_label_5.GetPosition().y + self.sip_label_5.GetSize().height - 10) wx.Point(self.sip_label_5.GetPosition().x, self.sip_label_5.GetPosition().y + self.sip_label_5.GetSize().height - 10)
) )
@@ -3654,7 +3677,7 @@ OpenCore Legacy Patcher by default knows the most ideal
i = -10 i = -10
for sip_bit in sip_data.system_integrity_protection.csr_values_extended: for sip_bit in sip_data.system_integrity_protection.csr_values_extended:
self.sip_checkbox = wx.CheckBox(self.frame_modal, label=sip_data.system_integrity_protection.csr_values_extended[sip_bit]["name"]) self.sip_checkbox = wx.CheckBox(self.frame_modal, label=sip_data.system_integrity_protection.csr_values_extended[sip_bit]["name"])
self.sip_checkbox.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.sip_checkbox.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.sip_checkbox.SetToolTip(f'Description: {sip_data.system_integrity_protection.csr_values_extended[sip_bit]["description"]}\nValue: {hex(sip_data.system_integrity_protection.csr_values_extended[sip_bit]["value"])}\nIntroduced in: macOS {sip_data.system_integrity_protection.csr_values_extended[sip_bit]["introduced_friendly"]}') self.sip_checkbox.SetToolTip(f'Description: {sip_data.system_integrity_protection.csr_values_extended[sip_bit]["description"]}\nValue: {hex(sip_data.system_integrity_protection.csr_values_extended[sip_bit]["value"])}\nIntroduced in: macOS {sip_data.system_integrity_protection.csr_values_extended[sip_bit]["introduced_friendly"]}')
self.sip_checkbox.SetPosition( self.sip_checkbox.SetPosition(
wx.Point(70, self.sip_label_6.GetPosition().y + self.sip_label_6.GetSize().height + i) wx.Point(70, self.sip_label_6.GetPosition().y + self.sip_label_6.GetSize().height + i)
@@ -3698,27 +3721,27 @@ OpenCore Legacy Patcher by default knows the most ideal
# Header # Header
self.header = wx.StaticText(self.frame_modal, label="Misc Settings", style=wx.ALIGN_CENTRE, pos=wx.Point(10, 10)) self.header = wx.StaticText(self.frame_modal, label="Misc Settings", style=wx.ALIGN_CENTRE, pos=wx.Point(10, 10))
self.header.SetFont(wx.Font(18, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header.SetFont(wx.Font(19, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header.SetPosition(wx.Point(0, 10)) self.header.SetPosition(wx.Point(0, 10))
self.header.SetSize(wx.Size(self.frame_modal.GetSize().width, 30)) self.header.SetSize(wx.Size(self.frame_modal.GetSize().width, 30))
self.header.Centre(wx.HORIZONTAL) self.header.Centre(wx.HORIZONTAL)
# Subheader: If unfamiliar with the following settings, please do not change them. # Subheader: If unfamiliar with the following settings, please do not change them.
self.subheader = wx.StaticText(self.frame_modal, label="Configure settings", style=wx.ALIGN_CENTRE) self.subheader = wx.StaticText(self.frame_modal, label="Configure settings", style=wx.ALIGN_CENTRE)
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition(wx.Point(0, self.header.GetPosition().y + self.header.GetSize().height)) self.subheader.SetPosition(wx.Point(0, self.header.GetPosition().y + self.header.GetSize().height))
self.subheader.SetSize(wx.Size(self.frame_modal.GetSize().width, 30)) self.subheader.SetSize(wx.Size(self.frame_modal.GetSize().width, 30))
self.subheader.Centre(wx.HORIZONTAL) self.subheader.Centre(wx.HORIZONTAL)
# Subheader: , hover over options more info # Subheader: , hover over options more info
self.subheader_2 = wx.StaticText(self.frame_modal, label="Hover over options for more info", style=wx.ALIGN_CENTRE) self.subheader_2 = wx.StaticText(self.frame_modal, label="Hover over options for more info", style=wx.ALIGN_CENTRE)
self.subheader_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader_2.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader_2.SetPosition(wx.Point(0, self.subheader.GetPosition().y + self.subheader.GetSize().height - 15)) self.subheader_2.SetPosition(wx.Point(0, self.subheader.GetPosition().y + self.subheader.GetSize().height - 15))
self.subheader_2.SetSize(wx.Size(self.frame_modal.GetSize().width, 30)) self.subheader_2.SetSize(wx.Size(self.frame_modal.GetSize().width, 30))
self.subheader_2.Centre(wx.HORIZONTAL) self.subheader_2.Centre(wx.HORIZONTAL)
# Label: Set FeatureUnlock status # Label: Set FeatureUnlock status
self.feature_unlock_label = wx.StaticText(self.frame_modal, label="Feature Unlock Status:", style=wx.ALIGN_CENTRE) self.feature_unlock_label = wx.StaticText(self.frame_modal, label="Feature Unlock Status:", style=wx.ALIGN_CENTRE)
self.feature_unlock_label.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.feature_unlock_label.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.feature_unlock_label.SetPosition(wx.Point(0, self.subheader_2.GetPosition().y + self.subheader_2.GetSize().height -5)) self.feature_unlock_label.SetPosition(wx.Point(0, self.subheader_2.GetPosition().y + self.subheader_2.GetSize().height -5))
self.feature_unlock_label.Centre(wx.HORIZONTAL) self.feature_unlock_label.Centre(wx.HORIZONTAL)
@@ -3820,33 +3843,33 @@ OpenCore Legacy Patcher by default knows the most ideal
# Header 1: Configure non-Metal Settings # Header 1: Configure non-Metal Settings
self.header_1 = wx.StaticText(self.frame_modal, label="Configure non-Metal Settings", pos=wx.Point(10, 10)) self.header_1 = wx.StaticText(self.frame_modal, label="Configure non-Metal Settings", pos=wx.Point(10, 10))
self.header_1.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) self.header_1.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, ".AppleSystemUIFont"))
self.header_1.Centre(wx.HORIZONTAL) self.header_1.Centre(wx.HORIZONTAL)
self.subheader = wx.StaticText(self.frame_modal, label="Below settings apply to systems that have installed") self.subheader = wx.StaticText(self.frame_modal, label="Below settings apply to systems that have installed")
self.subheader.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader.SetPosition(wx.Point(0, self.header_1.GetPosition().y + self.header_1.GetSize().height + 5)) self.subheader.SetPosition(wx.Point(0, self.header_1.GetPosition().y + self.header_1.GetSize().height + 5))
self.subheader.Centre(wx.HORIZONTAL) self.subheader.Centre(wx.HORIZONTAL)
self.subheader_2 = wx.StaticText(self.frame_modal, label="non-metal acceleration patches.") self.subheader_2 = wx.StaticText(self.frame_modal, label="non-metal acceleration patches.")
self.subheader_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader_2.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader_2.SetPosition(wx.Point(0, self.subheader.GetPosition().y + self.subheader.GetSize().height)) self.subheader_2.SetPosition(wx.Point(0, self.subheader.GetPosition().y + self.subheader.GetSize().height))
self.subheader_2.Centre(wx.HORIZONTAL) self.subheader_2.Centre(wx.HORIZONTAL)
# This menu will allow you to enable Beta Blur features resolving some of the UI distortions experienced with non-Metal # This menu will allow you to enable Beta Blur features resolving some of the UI distortions experienced with non-Metal
self.subheader2_1 = wx.StaticText(self.frame_modal, label="This menu will allow you to enable Beta Blur features resolving") self.subheader2_1 = wx.StaticText(self.frame_modal, label="This menu will allow you to enable Beta Blur features resolving")
self.subheader2_1.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader2_1.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader2_1.SetPosition(wx.Point(0, self.subheader_2.GetPosition().y + self.subheader_2.GetSize().height + 5)) self.subheader2_1.SetPosition(wx.Point(0, self.subheader_2.GetPosition().y + self.subheader_2.GetSize().height + 5))
self.subheader2_1.Centre(wx.HORIZONTAL) self.subheader2_1.Centre(wx.HORIZONTAL)
self.subheader2_2 = wx.StaticText(self.frame_modal, label="some of the UI distortions experienced with non-metal GPUs.") self.subheader2_2 = wx.StaticText(self.frame_modal, label="some of the UI distortions experienced with non-metal GPUs.")
self.subheader2_2.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader2_2.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader2_2.SetPosition(wx.Point(0, self.subheader2_1.GetPosition().y + self.subheader2_1.GetSize().height)) self.subheader2_2.SetPosition(wx.Point(0, self.subheader2_1.GetPosition().y + self.subheader2_1.GetSize().height))
self.subheader2_2.Centre(wx.HORIZONTAL) self.subheader2_2.Centre(wx.HORIZONTAL)
self.subheader_4 = wx.StaticText(self.frame_modal, label="Note: Only logout and login is required to apply these settings") self.subheader_4 = wx.StaticText(self.frame_modal, label="Note: Only logout and login is required to apply these settings")
self.subheader_4.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) self.subheader_4.SetFont(wx.Font(13, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, ".AppleSystemUIFont"))
self.subheader_4.SetPosition(wx.Point(0, self.subheader2_2.GetPosition().y + self.subheader2_2.GetSize().height+ 5)) self.subheader_4.SetPosition(wx.Point(0, self.subheader2_2.GetPosition().y + self.subheader2_2.GetSize().height+ 5))
self.subheader_4.Centre(wx.HORIZONTAL) self.subheader_4.Centre(wx.HORIZONTAL)

View File

@@ -1,52 +1,120 @@
# Validate the integrity of Apple downloaded files via .chunklist and .integrityDataV1 files # Validate the integrity of Apple downloaded files via .chunklist and .integrityDataV1 files
# Based off of chunklist.py: # Based off of chunklist.py:
# - https://gist.github.com/dhinakg/cbe30edf31ddc153fd0b0c0570c9b041 # - https://gist.github.com/dhinakg/cbe30edf31ddc153fd0b0c0570c9b041
# Copyright (C) 2021-2022, Dhinak G, Mykola Grymalyuk # Copyright (C) 2021-2023, Dhinak G, Mykola Grymalyuk
import binascii import enum
import hashlib import hashlib
import logging import logging
import binascii
import threading
from typing import Union
from pathlib import Path from pathlib import Path
CHUNK_LENGTH = 4 + 32 CHUNK_LENGTH = 4 + 32
def generate_chunklist_dict(chunklist): class ChunklistStatus(enum.Enum):
chunklist = Path(chunklist).read_bytes() if isinstance(chunklist, str) else chunklist """
Chunklist status
# Ref: https://github.com/apple-oss-distributions/xnu/blob/xnu-8020.101.4/bsd/kern/chunklist.h#L59-L69 """
header = { IN_PROGRESS = 0
"magic": chunklist[:4], SUCCESS = 1
"length": int.from_bytes(chunklist[4:8], "little"), FAILURE = 2
"fileVersion": chunklist[8],
"chunkMethod": chunklist[9],
"sigMethod": chunklist[10],
"chunkCount": int.from_bytes(chunklist[12:20], "little"),
"chunkOffset": int.from_bytes(chunklist[20:28], "little"),
"sigOffset": int.from_bytes(chunklist[28:36], "little")
}
if header["magic"] != b"CNKL":
return None
all_chunks = chunklist[header["chunkOffset"]:header["chunkOffset"]+header["chunkCount"]*CHUNK_LENGTH]
chunks = [{"length": int.from_bytes(all_chunks[i:i+4], "little"), "checksum": all_chunks[i+4:i+CHUNK_LENGTH]} for i in range(0, len(all_chunks), CHUNK_LENGTH)]
return chunks
def chunk(file_path, chunklist, verbose): class ChunklistVerification:
chunks = generate_chunklist_dict(chunklist) """
if chunks is None: Library to validate Apple's files against their chunklist format
return False Supports both chunklist and integrityDataV1 files
with Path(file_path).open("rb") as f: - Ref: https://github.com/apple-oss-distributions/xnu/blob/xnu-8020.101.4/bsd/kern/chunklist.h
for chunk in chunks:
status = hashlib.sha256(f.read(chunk["length"])).digest() Parameters:
if not status == chunk["checksum"]: file_path (Path): Path to the file to validate
logging.info( chunklist_path (Path): Path to the chunklist file
f"Chunk {chunks.index(chunk) + 1} checksum status FAIL: chunk sum {binascii.hexlify(chunk['checksum']).decode()}, calculated sum {binascii.hexlify(status).decode()}")
return False Usage:
elif verbose: >>> chunk_obj = ChunklistVerification("InstallAssistant.pkg", "InstallAssistant.pkg.integrityDataV1")
logging.info( >>> chunk_obj.validate()
f"Chunk {chunks.index(chunk) + 1} checksum status success") >>> while chunk_obj.status == ChunklistStatus.IN_PROGRESS:
return True ... print(f"Validating {chunk_obj.current_chunk} of {chunk_obj.total_chunks}")
>>> if chunk_obj.status == ChunklistStatus.FAILURE:
... print(chunk_obj.error_msg)
"""
def __init__(self, file_path: Path, chunklist_path: Union[Path, bytes]) -> None:
if isinstance(chunklist_path, bytes):
self.chunklist_path: bytes = chunklist_path
else:
self.chunklist_path: Path = Path(chunklist_path)
self.file_path: Path = Path(file_path)
self.chunks: dict = self._generate_chunks(self.chunklist_path)
self.error_msg: str = ""
self.current_chunk: int = 0
self.total_chunks: int = len(self.chunks)
self.status: ChunklistStatus = ChunklistStatus.IN_PROGRESS
def _generate_chunks(self, chunklist: Union[Path, bytes]) -> dict:
"""
Generate a dictionary of the chunklist header and chunks
Parameters:
chunklist (Path | bytes): Path to the chunklist file or the chunklist file itself
"""
chunklist: bytes = chunklist if isinstance(chunklist, bytes) else chunklist.read_bytes()
# Ref: https://github.com/apple-oss-distributions/xnu/blob/xnu-8020.101.4/bsd/kern/chunklist.h#L59-L69
header: dict = {
"magic": chunklist[:4],
"length": int.from_bytes(chunklist[4:8], "little"),
"fileVersion": chunklist[8],
"chunkMethod": chunklist[9],
"sigMethod": chunklist[10],
"chunkCount": int.from_bytes(chunklist[12:20], "little"),
"chunkOffset": int.from_bytes(chunklist[20:28], "little"),
"sigOffset": int.from_bytes(chunklist[28:36], "little")
}
if header["magic"] != b"CNKL":
return None
all_chunks = chunklist[header["chunkOffset"]:header["chunkOffset"]+header["chunkCount"]*CHUNK_LENGTH]
chunks = [{"length": int.from_bytes(all_chunks[i:i+4], "little"), "checksum": all_chunks[i+4:i+CHUNK_LENGTH]} for i in range(0, len(all_chunks), CHUNK_LENGTH)]
return chunks
def _validate(self) -> None:
"""
Validates provided file against chunklist
"""
if self.chunks is None:
self.status = ChunklistStatus.FAILURE
return
with self.file_path.open("rb") as f:
for chunk in self.chunks:
self.current_chunk += 1
status = hashlib.sha256(f.read(chunk["length"])).digest()
if status != chunk["checksum"]:
self.error_msg = f"Chunk {self.current_chunk} checksum status FAIL: chunk sum {binascii.hexlify(chunk['checksum']).decode()}, calculated sum {binascii.hexlify(status).decode()}"
self.status = ChunklistStatus.FAILURE
logging.info(self.error_msg)
return
self.status = ChunklistStatus.SUCCESS
def validate(self) -> None:
"""
Spawns _validate() thread
"""
threading.Thread(target=self._validate).start()

View File

@@ -99,7 +99,7 @@ class KernelDebugKitObject:
return KDK_ASSET_LIST return KDK_ASSET_LIST
try: try:
results = network_handler.SESSION.get( results = network_handler.NetworkUtilities().get(
KDK_API_LINK, KDK_API_LINK,
headers={ headers={
"User-Agent": f"OCLP/{self.constants.patcher_version}" "User-Agent": f"OCLP/{self.constants.patcher_version}"
@@ -488,8 +488,6 @@ class KernelDebugKitObject:
if kdk_folder.name.endswith(".kdk") or kdk_folder.name.endswith(".pkg"): if kdk_folder.name.endswith(".kdk") or kdk_folder.name.endswith(".pkg"):
should_remove = True should_remove = True
for build in exclude_builds: for build in exclude_builds:
if build != "":
continue
if kdk_folder.name.endswith(f"_{build}.kdk") or kdk_folder.name.endswith(f"_{build}.pkg"): if kdk_folder.name.endswith(f"_{build}.kdk") or kdk_folder.name.endswith(f"_{build}.pkg"):
should_remove = False should_remove = False
break break

View File

@@ -13,10 +13,24 @@ from resources import network_handler, utilities
APPLICATION_SEARCH_PATH: str = "/Applications" APPLICATION_SEARCH_PATH: str = "/Applications"
SFR_SOFTWARE_UPDATE_PATH: str = "SFR/com_apple_MobileAsset_SFRSoftwareUpdate/com_apple_MobileAsset_SFRSoftwareUpdate.xml" SFR_SOFTWARE_UPDATE_PATH: str = "SFR/com_apple_MobileAsset_SFRSoftwareUpdate/com_apple_MobileAsset_SFRSoftwareUpdate.xml"
CATALOG_URL_BASE: str = "https://swscan.apple.com/content/catalogs/others/index"
CATALOG_URL_BASE: str = "https://swscan.apple.com/content/catalogs/others/index" CATALOG_URL_EXTENSION: str = ".merged-1.sucatalog"
CATALOG_URL_EXTENSION: str = "13-12-10.16-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog" CATALOG_URL_VARIANTS: list = [
CATALOG_URL_VERSION: str = "13" "13",
"12",
"10.16",
"10.15",
"10.14",
"10.13",
"10.12",
"10.11",
"10.10",
"10.9",
"mountainlion",
"lion",
"snowleopard",
"leopard",
]
tmp_dir = tempfile.TemporaryDirectory() tmp_dir = tempfile.TemporaryDirectory()
@@ -222,15 +236,15 @@ class RemoteInstallerCatalog:
Parses Apple's Software Update catalog and finds all macOS installers. Parses Apple's Software Update catalog and finds all macOS installers.
""" """
def __init__(self, seed_override: SeedType = SeedType.PublicRelease) -> None: def __init__(self, seed_override: SeedType = SeedType.PublicRelease, os_override: int = os_data.os_data.ventura) -> None:
self.catalog_url: str = self._construct_catalog_url(seed_override) self.catalog_url: str = self._construct_catalog_url(seed_override, os_override)
self.available_apps: dict = self._parse_catalog() self.available_apps: dict = self._parse_catalog()
self.available_apps_latest: dict = self._list_newest_installers_only() self.available_apps_latest: dict = self._list_newest_installers_only()
def _construct_catalog_url(self, seed_type: SeedType) -> str: def _construct_catalog_url(self, seed_type: SeedType, os_kernel: int) -> str:
""" """
Constructs the catalog URL based on the seed type Constructs the catalog URL based on the seed type
@@ -241,17 +255,30 @@ class RemoteInstallerCatalog:
str: The catalog URL str: The catalog URL
""" """
url: str = CATALOG_URL_BASE
url: str = "" os_version: str = os_data.os_conversion.kernel_to_os(os_kernel)
os_version = "10.16" if os_version == "11" else os_version
if os_version not in CATALOG_URL_VARIANTS:
logging.error(f"OS version {os_version} is not supported, defaulting to latest")
os_version = CATALOG_URL_VARIANTS[0]
url += f"-{os_version}"
if seed_type == SeedType.DeveloperSeed: if seed_type == SeedType.DeveloperSeed:
url = f"{CATALOG_URL_BASE}-{CATALOG_URL_VERSION}seed-{CATALOG_URL_EXTENSION}" url += f"seed"
elif seed_type == SeedType.PublicSeed: elif seed_type == SeedType.PublicSeed:
url = f"{CATALOG_URL_BASE}-{CATALOG_URL_VERSION}beta-{CATALOG_URL_EXTENSION}" url += f"beta"
elif seed_type == SeedType.CustomerSeed: elif seed_type == SeedType.CustomerSeed:
url = f"{CATALOG_URL_BASE}-{CATALOG_URL_VERSION}customerseed-{CATALOG_URL_EXTENSION}" url += f"customerseed"
else:
url = f"{CATALOG_URL_BASE}-{CATALOG_URL_EXTENSION}" did_find_variant: bool = False
for variant in CATALOG_URL_VARIANTS:
if variant in url:
did_find_variant = True
if did_find_variant:
url += f"-{variant}"
url += f"{CATALOG_URL_EXTENSION}"
return url return url
@@ -270,7 +297,7 @@ class RemoteInstallerCatalog:
return catalog return catalog
try: try:
catalog = plistlib.loads(network_handler.SESSION.get(self.catalog_url).content) catalog = plistlib.loads(network_handler.NetworkUtilities().get(self.catalog_url).content)
except plistlib.InvalidFileException: except plistlib.InvalidFileException:
return {} return {}
@@ -311,7 +338,7 @@ class RemoteInstallerCatalog:
continue continue
try: try:
build_plist = plistlib.loads(network_handler.SESSION.get(bm_package["URL"]).content) build_plist = plistlib.loads(network_handler.NetworkUtilities().get(bm_package["URL"]).content)
except plistlib.InvalidFileException: except plistlib.InvalidFileException:
continue continue
@@ -356,13 +383,10 @@ class RemoteInstallerCatalog:
continue continue
if "IntegrityDataURL" not in ia_package: if "IntegrityDataURL" not in ia_package:
continue continue
if "Size" not in ia_package:
size = 0
download_link = ia_package["URL"] download_link = ia_package["URL"]
integrity = ia_package["IntegrityDataURL"] integrity = ia_package["IntegrityDataURL"]
size = ia_package["Size"] size = ia_package["Size"] if ia_package["Size"] else 0
if any([version, build, download_link, size, integrity]) is None: if any([version, build, download_link, size, integrity]) is None:
continue continue
@@ -518,28 +542,34 @@ class LocalInstallerCatalog:
if "CFBundleDisplayName" not in application_info_plist: if "CFBundleDisplayName" not in application_info_plist:
continue continue
app_version = application_info_plist["DTPlatformVersion"] app_version: str = application_info_plist["DTPlatformVersion"]
clean_name = application_info_plist["CFBundleDisplayName"] clean_name: str = application_info_plist["CFBundleDisplayName"]
app_sdk: str = application_info_plist["DTSDKBuild"] if "DTSDKBuild" in application_info_plist else "Unknown"
min_required: str = application_info_plist["LSMinimumSystemVersion"] if "LSMinimumSystemVersion" in application_info_plist else "Unknown"
if "DTSDKBuild" in application_info_plist: kernel: int = 0
app_sdk = application_info_plist["DTSDKBuild"] try:
else: kernel = int(app_sdk[:2])
app_sdk = "Unknown" except ValueError:
pass
min_required = os_data.os_conversion.os_to_kernel(min_required) if min_required != "Unknown" else 0
if min_required == os_data.os_data.sierra and kernel == os_data.os_data.ventura:
# Ventura's installer requires El Capitan minimum
# Ref: https://github.com/dortania/OpenCore-Legacy-Patcher/discussions/1038
min_required = os_data.os_data.el_capitan
# app_version can sometimes report GM instead of the actual version # app_version can sometimes report GM instead of the actual version
# This is a workaround to get the actual version # This is a workaround to get the actual version
if app_version.startswith("GM"): if app_version.startswith("GM"):
try: if kernel == 0:
app_version = int(app_sdk[:2])
if app_version < 20:
app_version = f"10.{app_version - 4}"
else:
app_version = f"{app_version - 9}.0"
except ValueError:
app_version = "Unknown" app_version = "Unknown"
else:
app_version = os_data.os_conversion.kernel_to_os(kernel)
# Check if App Version is High Sierra or newer # Check if App Version is High Sierra or newer
if os_data.os_conversion.os_to_kernel(app_version) < os_data.os_data.high_sierra: if kernel < os_data.os_data.high_sierra:
continue continue
results = self._parse_sharedsupport_version(Path(APPLICATION_SEARCH_PATH) / Path(application)/ Path("Contents/SharedSupport/SharedSupport.dmg")) results = self._parse_sharedsupport_version(Path(APPLICATION_SEARCH_PATH) / Path(application)/ Path("Contents/SharedSupport/SharedSupport.dmg"))
@@ -554,6 +584,7 @@ class LocalInstallerCatalog:
"Version": app_version, "Version": app_version,
"Build": app_sdk, "Build": app_sdk,
"Path": application, "Path": application,
"Minimum Host OS": min_required,
} }
}) })

View File

@@ -16,7 +16,8 @@ from resources import (
arguments, arguments,
reroute_payloads, reroute_payloads,
commit_info, commit_info,
logging_handler logging_handler,
analytics_handler,
) )
@@ -89,6 +90,7 @@ class OpenCoreLegacyPatcher:
# Generate defaults # Generate defaults
defaults.GenerateDefaults(self.computer.real_model, True, self.constants) defaults.GenerateDefaults(self.computer.real_model, True, self.constants)
threading.Thread(target=analytics_handler.Analytics, args=(self.constants,)).start()
if utilities.check_cli_args() is None: if utilities.check_cli_args() is None:
logging.info(f"- No arguments present, loading {'GUI' if self.constants.wxpython_variant is True else 'TUI'} mode") logging.info(f"- No arguments present, loading {'GUI' if self.constants.wxpython_variant is True else 'TUI'} mode")

View File

@@ -80,6 +80,65 @@ class NetworkUtilities:
return False return False
def get(self, url: str, **kwargs) -> requests.Response:
"""
Wrapper for requests's get method
Implement additional error handling
Parameters:
url (str): URL to get
**kwargs: Additional parameters for requests.get
Returns:
requests.Response: Response object from requests.get
"""
result: requests.Response = None
try:
result = SESSION.get(url, **kwargs)
except (
requests.exceptions.Timeout,
requests.exceptions.TooManyRedirects,
requests.exceptions.ConnectionError,
requests.exceptions.HTTPError
) as error:
logging.warn(f"Error calling requests.get: {error}")
# Return empty response object
return requests.Response()
return result
def post(self, url: str, **kwargs) -> requests.Response:
"""
Wrapper for requests's post method
Implement additional error handling
Parameters:
url (str): URL to post
**kwargs: Additional parameters for requests.post
Returns:
requests.Response: Response object from requests.post
"""
result: requests.Response = None
try:
result = SESSION.post(url, **kwargs)
except (
requests.exceptions.Timeout,
requests.exceptions.TooManyRedirects,
requests.exceptions.ConnectionError,
requests.exceptions.HTTPError
) as error:
logging.warn(f"Error calling requests.post: {error}")
# Return empty response object
return requests.Response()
return result
class DownloadObject: class DownloadObject:
""" """
Object for downloading files from the network Object for downloading files from the network
@@ -278,7 +337,7 @@ class DownloadObject:
if self._prepare_working_directory(self.filepath) is False: if self._prepare_working_directory(self.filepath) is False:
raise Exception(self.error_msg) raise Exception(self.error_msg)
response = SESSION.get(self.url, stream=True, timeout=10) response = NetworkUtilities().get(self.url, stream=True, timeout=10)
with open(self.filepath, 'wb') as file: with open(self.filepath, 'wb') as file:
for i, chunk in enumerate(response.iter_content(1024 * 1024 * 4)): for i, chunk in enumerate(response.iter_content(1024 * 1024 * 4)):

View File

@@ -40,13 +40,13 @@ from datetime import datetime
import logging import logging
from resources import constants, utilities, kdk_handler from resources import constants, utilities, kdk_handler
from resources.sys_patch import sys_patch_detect, sys_patch_auto, sys_patch_helpers from resources.sys_patch import sys_patch_detect, sys_patch_auto, sys_patch_helpers, sys_patch_generate
from data import os_data from data import os_data
class PatchSysVolume: class PatchSysVolume:
def __init__(self, model: str, global_constants: constants.Constants, hardware_details: list = None): def __init__(self, model: str, global_constants: constants.Constants, hardware_details: list = None) -> None:
self.model = model self.model = model
self.constants: constants.Constants = global_constants self.constants: constants.Constants = global_constants
self.computer = self.constants.computer self.computer = self.constants.computer
@@ -67,19 +67,21 @@ class PatchSysVolume:
self.skip_root_kmutil_requirement = self.hardware_details["Settings: Supports Auxiliary Cache"] self.skip_root_kmutil_requirement = self.hardware_details["Settings: Supports Auxiliary Cache"]
def __del__(self): def __del__(self) -> None:
# Ensures that each time we're patching, we're using a clean repository """
Ensures that each time we're patching, we're using a clean PatcherSupportPkg folder
"""
if Path(self.constants.payload_local_binaries_root_path).exists(): if Path(self.constants.payload_local_binaries_root_path).exists():
shutil.rmtree(self.constants.payload_local_binaries_root_path) shutil.rmtree(self.constants.payload_local_binaries_root_path)
def _init_pathing(self, custom_root_mount_path: Path = None, custom_data_mount_path: Path = None): def _init_pathing(self, custom_root_mount_path: Path = None, custom_data_mount_path: Path = None) -> None:
""" """
Initializes the pathing for root volume patching Initializes the pathing for root volume patching
Parameters: Parameters:
custom_root_mount_path (Path): Custom path to mount the root volume custom_root_mount_path (Path): Custom path to mount the root volume
custom_data_mount_path (Path): Custom path to mount the data volume custom_data_mount_path (Path): Custom path to mount the data volume
""" """
if custom_root_mount_path and custom_data_mount_path: if custom_root_mount_path and custom_data_mount_path:
self.mount_location = custom_root_mount_path self.mount_location = custom_root_mount_path
@@ -96,7 +98,18 @@ class PatchSysVolume:
self.mount_application_support = f"{self.mount_location_data}/Library/Application Support" self.mount_application_support = f"{self.mount_location_data}/Library/Application Support"
def _mount_root_vol(self): def _mount_root_vol(self) -> bool:
"""
Attempts to mount the booted APFS volume as a writable volume
at /System/Volumes/Update/mnt1
Manual invocation:
'sudo mount -o nobrowse -t apfs /dev/diskXsY /System/Volumes/Update/mnt1'
Returns:
bool: True if successful, False if not
"""
# Returns boolean if Root Volume is available # Returns boolean if Root Volume is available
self.root_mount_path = utilities.get_disk_path() self.root_mount_path = utilities.get_disk_path()
if self.root_mount_path.startswith("disk"): if self.root_mount_path.startswith("disk"):
@@ -122,7 +135,16 @@ class PatchSysVolume:
return False return False
def _merge_kdk_with_root(self, save_hid_cs=False): def _merge_kdk_with_root(self, save_hid_cs=False) -> None:
"""
Merge Kernel Debug Kit (KDK) with the root volume
If no KDK is present, will call kdk_handler to download and install it
Parameters:
save_hid_cs (bool): If True, will save the HID CS file before merging KDK
Required for USB 1.1 downgrades on Ventura and newer
"""
if self.skip_root_kmutil_requirement is True: if self.skip_root_kmutil_requirement is True:
return return
if self.constants.detected_os < os_data.os_data.ventura: if self.constants.detected_os < os_data.os_data.ventura:
@@ -221,25 +243,43 @@ class PatchSysVolume:
def _unpatch_root_vol(self): def _unpatch_root_vol(self):
if self.constants.detected_os > os_data.os_data.catalina and self.root_supports_snapshot is True: """
logging.info("- Reverting to last signed APFS snapshot") Reverts APFS snapshot and cleans up any changes made to the root and data volume
result = utilities.elevated(["bless", "--mount", self.mount_location, "--bootefi", "--last-sealed-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) """
if result.returncode != 0:
logging.info("- Unable to revert root volume patches") if self.constants.detected_os <= os_data.os_data.big_sur or self.root_supports_snapshot is False:
logging.info("Reason for unpatch Failure:") logging.info("- OS version does not support snapshotting, skipping revert")
logging.info(result.stdout.decode())
logging.info("- Failed to revert snapshot via Apple's 'bless' command") logging.info("- Reverting to last signed APFS snapshot")
else: result = utilities.elevated(["bless", "--mount", self.mount_location, "--bootefi", "--last-sealed-snapshot"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
self._clean_skylight_plugins() if result.returncode != 0:
self._delete_nonmetal_enforcement() logging.info("- Unable to revert root volume patches")
self._clean_auxiliary_kc() logging.info("Reason for unpatch Failure:")
self.constants.root_patcher_succeeded = True logging.info(result.stdout.decode())
logging.info("- Unpatching complete") logging.info("- Failed to revert snapshot via Apple's 'bless' command")
logging.info("\nPlease reboot the machine for patches to take effect") else:
self._clean_skylight_plugins()
self._delete_nonmetal_enforcement()
self._clean_auxiliary_kc()
self.constants.root_patcher_succeeded = True
logging.info("- Unpatching complete")
logging.info("\nPlease reboot the machine for patches to take effect")
def _rebuild_root_volume(self) -> bool:
"""
Rebuilds the Root Volume:
- Rebuilds the Kernel Collection
- Updates the Preboot Kernel Cache
- Rebuilds the dyld Shared Cache
- Creates a new APFS Snapshot
Returns:
bool: True if successful, False if not
"""
def _rebuild_snapshot(self):
if self._rebuild_kernel_collection() is True: if self._rebuild_kernel_collection() is True:
self.update_preboot_kernel_cache() self._update_preboot_kernel_cache()
self._rebuild_dyld_shared_cache() self._rebuild_dyld_shared_cache()
if self._create_new_apfs_snapshot() is True: if self._create_new_apfs_snapshot() is True:
logging.info("- Patching complete") logging.info("- Patching complete")
@@ -250,7 +290,20 @@ class PatchSysVolume:
if self.constants.gui_mode is False: if self.constants.gui_mode is False:
input("\nPress [ENTER] to continue") input("\nPress [ENTER] to continue")
def _rebuild_kernel_collection(self):
def _rebuild_kernel_collection(self) -> bool:
"""
Rebuilds the Kernel Collection
Supports following KC generation:
- Boot/SysKC (11.0+)
- AuxKC (11.0+)
- PrelinkedKernel (10.15-)
Returns:
bool: True if successful, False if not
"""
logging.info("- Rebuilding Kernel Cache (This may take some time)") logging.info("- Rebuilding Kernel Cache (This may take some time)")
if self.constants.detected_os > os_data.os_data.catalina: if self.constants.detected_os > os_data.os_data.catalina:
# Base Arguments # Base Arguments
@@ -345,7 +398,15 @@ class PatchSysVolume:
logging.info("- Successfully built new kernel cache") logging.info("- Successfully built new kernel cache")
return True return True
def _create_new_apfs_snapshot(self):
def _create_new_apfs_snapshot(self) -> bool:
"""
Creates a new APFS snapshot of the root volume
Returns:
bool: True if snapshot was created, False if not
"""
if self.root_supports_snapshot is True: if self.root_supports_snapshot is True:
logging.info("- Creating new APFS snapshot") logging.info("- Creating new APFS snapshot")
bless = utilities.elevated( bless = utilities.elevated(
@@ -365,22 +426,44 @@ class PatchSysVolume:
self._unmount_drive() self._unmount_drive()
return True return True
def _unmount_drive(self):
def _unmount_drive(self) -> None:
"""
Unmount root volume
"""
logging.info("- Unmounting Root Volume (Don't worry if this fails)") logging.info("- Unmounting Root Volume (Don't worry if this fails)")
utilities.elevated(["diskutil", "unmount", self.root_mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode() utilities.elevated(["diskutil", "unmount", self.root_mount_path], stdout=subprocess.PIPE).stdout.decode().strip().encode()
def _rebuild_dyld_shared_cache(self):
def _rebuild_dyld_shared_cache(self) -> None:
"""
Rebuild the dyld shared cache
Only required on Mojave and older
"""
if self.constants.detected_os > os_data.os_data.catalina: if self.constants.detected_os > os_data.os_data.catalina:
return return
logging.info("- Rebuilding dyld shared cache") logging.info("- Rebuilding dyld shared cache")
utilities.process_status(utilities.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"])) utilities.process_status(utilities.elevated(["update_dyld_shared_cache", "-root", f"{self.mount_location}/"]))
def update_preboot_kernel_cache(self):
def _update_preboot_kernel_cache(self) -> None:
"""
Update the preboot kernel cache
Only required on Catalina
"""
if self.constants.detected_os == os_data.os_data.catalina: if self.constants.detected_os == os_data.os_data.catalina:
logging.info("- Rebuilding preboot kernel cache") logging.info("- Rebuilding preboot kernel cache")
utilities.process_status(utilities.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["kcditto"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def _clean_skylight_plugins(self):
def _clean_skylight_plugins(self) -> None:
"""
Clean non-Metal's SkylightPlugins folder
"""
if (Path(self.mount_application_support) / Path("SkyLightPlugins/")).exists(): if (Path(self.mount_application_support) / Path("SkyLightPlugins/")).exists():
logging.info("- Found SkylightPlugins folder, removing old plugins") logging.info("- Found SkylightPlugins folder, removing old plugins")
utilities.process_status(utilities.elevated(["rm", "-Rf", f"{self.mount_application_support}/SkyLightPlugins"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["rm", "-Rf", f"{self.mount_application_support}/SkyLightPlugins"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
@@ -389,18 +472,31 @@ class PatchSysVolume:
logging.info("- Creating SkylightPlugins folder") logging.info("- Creating SkylightPlugins folder")
utilities.process_status(utilities.elevated(["mkdir", "-p", f"{self.mount_application_support}/SkyLightPlugins/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["mkdir", "-p", f"{self.mount_application_support}/SkyLightPlugins/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def _delete_nonmetal_enforcement(self):
def _delete_nonmetal_enforcement(self) -> None:
"""
Remove defaults related to forced OpenGL rendering
Primarily for development purposes
"""
for arg in ["useMetal", "useIOP"]: for arg in ["useMetal", "useIOP"]:
result = subprocess.run(["defaults", "read", "/Library/Preferences/com.apple.CoreDisplay", arg], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL).stdout.decode("utf-8").strip() result = subprocess.run(["defaults", "read", "/Library/Preferences/com.apple.CoreDisplay", arg], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL).stdout.decode("utf-8").strip()
if result in ["0", "false", "1", "true"]: if result in ["0", "false", "1", "true"]:
logging.info(f"- Removing non-Metal Enforcement Preference: {arg}") logging.info(f"- Removing non-Metal Enforcement Preference: {arg}")
utilities.elevated(["defaults", "delete", "/Library/Preferences/com.apple.CoreDisplay", arg]) utilities.elevated(["defaults", "delete", "/Library/Preferences/com.apple.CoreDisplay", arg])
def _clean_auxiliary_kc(self):
# When reverting root volume patches, the AuxKC will still retain the UUID def _clean_auxiliary_kc(self) -> None:
# it was built against. Thus when Boot/SysKC are reverted, Aux will break """
# To resolve this, delete all installed kexts in /L*/E* and rebuild the AuxKC Clean the Auxiliary Kernel Collection
# We can verify our binaries based off the OpenCore-Legacy-Patcher.plist file
Logic:
When reverting root volume patches, the AuxKC will still retain the UUID
it was built against. Thus when Boot/SysKC are reverted, Aux will break
To resolve this, delete all installed kexts in /L*/E* and rebuild the AuxKC
We can verify our binaries based off the OpenCore-Legacy-Patcher.plist file
"""
if self.constants.detected_os < os_data.os_data.big_sur: if self.constants.detected_os < os_data.os_data.big_sur:
return return
@@ -441,7 +537,15 @@ class PatchSysVolume:
# ex. Symlinks pointing to symlinks pointing to dead files # ex. Symlinks pointing to symlinks pointing to dead files
pass pass
def _write_patchset(self, patchset):
def _write_patchset(self, patchset: dict) -> None:
"""
Write patchset information to Root Volume
Parameters:
patchset (dict): Patchset information (generated by GenerateRootPatchSets)
"""
destination_path = f"{self.mount_location}/System/Library/CoreServices" destination_path = f"{self.mount_location}/System/Library/CoreServices"
file_name = "OpenCore-Legacy-Patcher.plist" file_name = "OpenCore-Legacy-Patcher.plist"
destination_path_file = f"{destination_path}/{file_name}" destination_path_file = f"{destination_path}/{file_name}"
@@ -451,16 +555,31 @@ class PatchSysVolume:
utilities.process_status(utilities.elevated(["rm", destination_path_file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["rm", destination_path_file], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["cp", f"{self.constants.payload_path}/{file_name}", destination_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["cp", f"{self.constants.payload_path}/{file_name}", destination_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def _add_auxkc_support(self, install_file, source_folder_path, install_patch_directory, destination_folder_path):
# In macOS Ventura, KDKs are required to build new Boot and System KCs
# However for some patch sets, we're able to use the Auxiliary KCs with '/Library/Extensions'
# kernelmanagerd determines which kext is installed by their 'OSBundleRequired' entry def _add_auxkc_support(self, install_file: str, source_folder_path: str, install_patch_directory: str, destination_folder_path: str) -> str:
# If a kext is labeled as 'OSBundleRequired: Root' or 'OSBundleRequired: Safe Boot', """
# kernelmanagerd will require the kext to be installed in the Boot/SysKC Patch provided Kext to support Auxiliary Kernel Collection
# Additionally, kexts starting with 'com.apple.' are not natively allowed to be installed Logic:
# in the AuxKC. So we need to explicitly set our 'OSBundleRequired' to 'Auxiliary' In macOS Ventura, KDKs are required to build new Boot and System KCs
However for some patch sets, we're able to use the Auxiliary KCs with '/Library/Extensions'
kernelmanagerd determines which kext is installed by their 'OSBundleRequired' entry
If a kext is labeled as 'OSBundleRequired: Root' or 'OSBundleRequired: Safe Boot',
kernelmanagerd will require the kext to be installed in the Boot/SysKC
Additionally, kexts starting with 'com.apple.' are not natively allowed to be installed
in the AuxKC. So we need to explicitly set our 'OSBundleRequired' to 'Auxiliary'
Parameters:
install_file (str): Kext file name
source_folder_path (str): Source folder path
install_patch_directory (str): Patch directory
destination_folder_path (str): Destination folder path
Returns:
str: Updated destination folder path
"""
if self.skip_root_kmutil_requirement is False: if self.skip_root_kmutil_requirement is False:
return destination_folder_path return destination_folder_path
@@ -491,14 +610,24 @@ class PatchSysVolume:
return updated_install_location return updated_install_location
def _check_kexts_needs_authentication(self, kext_name):
# Verify whether the user needs to authenticate in System Preferences def _check_kexts_needs_authentication(self, kext_name: str):
# Specifically under 'private/var/db/KernelManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist' """
# ["kextsToBuild"][i]: Verify whether the user needs to authenticate in System Preferences
# ["bundlePathMainOS"] = /Library/Extensions/Test.kext Sets 'needs_to_open_preferences' to True if the kext is not in the AuxKC
# ["cdHash"] = Bundle's CDHash (random on ad-hoc signed, static on dev signed)
# ["teamID"] = Team ID (blank on ad-hoc signed) Logic:
# To grab the CDHash of a kext, run 'codesign -dvvv <kext_path>' Under 'private/var/db/KernelManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist'
["kextsToBuild"][i]:
["bundlePathMainOS"] = /Library/Extensions/Test.kext
["cdHash"] = Bundle's CDHash (random on ad-hoc signed, static on dev signed)
["teamID"] = Team ID (blank on ad-hoc signed)
To grab the CDHash of a kext, run 'codesign -dvvv <kext_path>'
Parameters:
kext_name (str): Name of the kext to check
"""
try: try:
aux_cache_path = Path(self.mount_location_data) / Path("/private/var/db/KernelExtensionManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist") aux_cache_path = Path(self.mount_location_data) / Path("/private/var/db/KernelExtensionManagement/AuxKC/CurrentAuxKC/com.apple.kcgen.instructions.plist")
if aux_cache_path.exists(): if aux_cache_path.exists():
@@ -513,19 +642,32 @@ class PatchSysVolume:
logging.info(f" - {kext_name} requires authentication in System Preferences") logging.info(f" - {kext_name} requires authentication in System Preferences")
self.constants.needs_to_open_preferences = True # Notify in GUI to open System Preferences self.constants.needs_to_open_preferences = True # Notify in GUI to open System Preferences
def _patch_root_vol(self): def _patch_root_vol(self):
"""
Patch root volume
"""
logging.info(f"- Running patches for {self.model}") logging.info(f"- Running patches for {self.model}")
if self.patch_set_dictionary != {}: if self.patch_set_dictionary != {}:
self._execute_patchset(self.patch_set_dictionary) self._execute_patchset(self.patch_set_dictionary)
else: else:
self._execute_patchset(sys_patch_detect.DetectRootPatch(self.computer.real_model, self.constants).generate_patchset(self.hardware_details)) self._execute_patchset(sys_patch_generate.GenerateRootPatchSets(self.computer.real_model, self.constants, self.hardware_details).patchset)
if self.constants.wxpython_variant is True and self.constants.detected_os >= os_data.os_data.big_sur: if self.constants.wxpython_variant is True and self.constants.detected_os >= os_data.os_data.big_sur:
sys_patch_auto.AutomaticSysPatch(self.constants).install_auto_patcher_launch_agent() sys_patch_auto.AutomaticSysPatch(self.constants).install_auto_patcher_launch_agent()
self._rebuild_snapshot() self._rebuild_root_volume()
def _execute_patchset(self, required_patches: dict):
"""
Executes provided patchset
Parameters:
required_patches (dict): Patchset to execute (generated by sys_patch_generate.GenerateRootPatchSets)
"""
def _execute_patchset(self, required_patches):
source_files_path = str(self.constants.payload_local_binaries_root_path) source_files_path = str(self.constants.payload_local_binaries_root_path)
self._preflight_checks(required_patches, source_files_path) self._preflight_checks(required_patches, source_files_path)
for patch in required_patches: for patch in required_patches:
@@ -579,9 +721,21 @@ class PatchSysVolume:
sys_patch_helpers.SysPatchHelpers(self.constants).disable_window_server_caching() sys_patch_helpers.SysPatchHelpers(self.constants).disable_window_server_caching()
if any(x in required_patches for x in ["Intel Ivy Bridge", "Intel Haswell"]): if any(x in required_patches for x in ["Intel Ivy Bridge", "Intel Haswell"]):
sys_patch_helpers.SysPatchHelpers(self.constants).remove_news_widgets() sys_patch_helpers.SysPatchHelpers(self.constants).remove_news_widgets()
if "Metal 3802 Common Extended" in required_patches:
sys_patch_helpers.SysPatchHelpers(self.constants).patch_gpu_compiler_libraries(mount_point=self.mount_location)
self._write_patchset(required_patches) self._write_patchset(required_patches)
def _preflight_checks(self, required_patches, source_files_path):
def _preflight_checks(self, required_patches: dict, source_files_path: Path) -> None:
"""
Runs preflight checks before patching
Parameters:
required_patches (dict): Patchset dictionary (from sys_patch_generate.GenerateRootPatchSets)
source_files_path (Path): Path to the source files (PatcherSupportPkg)
"""
logging.info("- Running Preflight Checks before patching") logging.info("- Running Preflight Checks before patching")
# Make sure old SkyLight plugins aren't being used # Make sure old SkyLight plugins aren't being used
@@ -606,16 +760,25 @@ class PatchSysVolume:
raise Exception(f"Failed to find {source_file}") raise Exception(f"Failed to find {source_file}")
# Ensure KDK is properly installed # Ensure KDK is properly installed
should_save_cs = False self._merge_kdk_with_root(save_hid_cs=True if "Legacy USB 1.1" in required_patches else False)
if "Legacy USB 1.1" in required_patches:
should_save_cs = True
self._merge_kdk_with_root(save_hid_cs=should_save_cs)
logging.info("- Finished Preflight, starting patching") logging.info("- Finished Preflight, starting patching")
def _install_new_file(self, source_folder, destination_folder, file_name):
# .frameworks are merged def _install_new_file(self, source_folder: Path, destination_folder: Path, file_name: str) -> None:
# .kexts and .apps are deleted and replaced """
Installs a new file to the destination folder
File handling logic:
- .frameworks are merged with the destination folder
- Other files are deleted and replaced (ex. .kexts, .apps)
Parameters:
source_folder (Path): Path to the source folder
destination_folder (Path): Path to the destination folder
file_name (str): Name of the file to install
"""
file_name_str = str(file_name) file_name_str = str(file_name)
if not Path(destination_folder).exists(): if not Path(destination_folder).exists():
@@ -646,7 +809,16 @@ class PatchSysVolume:
utilities.process_status(utilities.elevated(["cp", f"{source_folder}/{file_name}", destination_folder], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["cp", f"{source_folder}/{file_name}", destination_folder], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
self._fix_permissions(destination_folder + "/" + file_name) self._fix_permissions(destination_folder + "/" + file_name)
def _remove_file(self, destination_folder, file_name):
def _remove_file(self, destination_folder: Path, file_name: str) -> None:
"""
Removes a file from the destination folder
Parameters:
destination_folder (Path): Path to the destination folder
file_name (str): Name of the file to remove
"""
if Path(destination_folder + "/" + file_name).exists(): if Path(destination_folder + "/" + file_name).exists():
logging.info(f" - Removing: {file_name}") logging.info(f" - Removing: {file_name}")
if Path(destination_folder + "/" + file_name).is_dir(): if Path(destination_folder + "/" + file_name).is_dir():
@@ -655,7 +827,11 @@ class PatchSysVolume:
utilities.process_status(utilities.elevated(["rm", f"{destination_folder}/{file_name}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["rm", f"{destination_folder}/{file_name}"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def _fix_permissions(self, destination_file): def _fix_permissions(self, destination_file: Path) -> None:
"""
Fix file permissions for a given file or directory
"""
chmod_args = ["chmod", "-Rf", "755", destination_file] chmod_args = ["chmod", "-Rf", "755", destination_file]
chown_args = ["chown", "-Rf", "root:wheel", destination_file] chown_args = ["chown", "-Rf", "root:wheel", destination_file]
if not Path(destination_file).is_dir(): if not Path(destination_file).is_dir():
@@ -666,7 +842,14 @@ class PatchSysVolume:
utilities.process_status(utilities.elevated(chown_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(chown_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def _check_files(self): def _check_files(self) -> bool:
"""
Check if all files are present (primarily PatcherSupportPkg resources)
Returns:
bool: True if all files are present, False otherwise
"""
if Path(self.constants.payload_local_binaries_root_path).exists(): if Path(self.constants.payload_local_binaries_root_path).exists():
logging.info("- Local PatcherSupportPkg resources available, continuing...") logging.info("- Local PatcherSupportPkg resources available, continuing...")
return True return True
@@ -683,9 +866,13 @@ class PatchSysVolume:
# Entry Function # Entry Function
def start_patch(self): def start_patch(self):
"""
Entry function for the patching process
"""
logging.info("- Starting Patch Process") logging.info("- Starting Patch Process")
logging.info(f"- Determining Required Patch set for Darwin {self.constants.detected_os}") logging.info(f"- Determining Required Patch set for Darwin {self.constants.detected_os}")
self.patch_set_dictionary = sys_patch_detect.DetectRootPatch(self.computer.real_model, self.constants).generate_patchset(self.hardware_details) self.patch_set_dictionary = sys_patch_generate.GenerateRootPatchSets(self.computer.real_model, self.constants, self.hardware_details).patchset
if self.patch_set_dictionary == {}: if self.patch_set_dictionary == {}:
change_menu = None change_menu = None
@@ -716,7 +903,11 @@ class PatchSysVolume:
else: else:
logging.info("- Returning to main menu") logging.info("- Returning to main menu")
def start_unpatch(self): def start_unpatch(self) -> None:
"""
Entry function for unpatching the root volume
"""
logging.info("- Starting Unpatch Process") logging.info("- Starting Unpatch Process")
if sys_patch_detect.DetectRootPatch(self.computer.real_model, self.constants).verify_patch_allowed(print_errors=True) is True: if sys_patch_detect.DetectRootPatch(self.computer.real_model, self.constants).verify_patch_allowed(print_errors=True) is True:
if self._mount_root_vol() is True: if self._mount_root_vol() is True:

View File

@@ -312,9 +312,71 @@ class AutomaticSysPatch:
utilities.process_status(utilities.elevated(["chmod", "644", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["chmod", "644", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["chown", "root:wheel", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["chown", "root:wheel", "/Library/LaunchAgents/com.dortania.opencore-legacy-patcher.auto-patch.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Copy over our launch daemon
if self._create_rsr_monitor_daemon() is True:
logging.info("- Copying rsr-monitor.plist Launch Daemon to /Library/LaunchDaemons/")
if Path("/Library/LaunchDaemons/com.dortania.opencore-legacy-patcher.rsr-monitor.plist").exists():
logging.info("- Deleting existing rsr-monitor.plist")
utilities.process_status(utilities.elevated(["rm", "/Library/LaunchDaemons/com.dortania.opencore-legacy-patcher.rsr-monitor.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
if not Path("/Library/LaunchDaemons/").exists():
logging.info("- Creating /Library/LaunchDaemons/")
utilities.process_status(utilities.elevated(["mkdir", "-p", "/Library/LaunchDaemons/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["cp", self.constants.rsr_monitor_launch_daemon_path, "/Library/LaunchDaemons/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Set the permissions on the com.dortania.opencore-legacy-patcher.rsr-monitor.plist
logging.info("- Setting permissions on rsr-monitor.plist")
utilities.process_status(utilities.elevated(["chmod", "644", "/Library/LaunchDaemons/com.dortania.opencore-legacy-patcher.rsr-monitor.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
utilities.process_status(utilities.elevated(["chown", "root:wheel", "/Library/LaunchDaemons/com.dortania.opencore-legacy-patcher.rsr-monitor.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
# Making app alias # Making app alias
# Simply an easy way for users to notice the app # Simply an easy way for users to notice the app
# If there's already an alias or exiting app, skip # If there's already an alias or exiting app, skip
if not Path("/Applications/OpenCore-Patcher.app").exists(): if not Path("/Applications/OpenCore-Patcher.app").exists():
logging.info("- Making app alias") logging.info("- Making app alias")
utilities.process_status(utilities.elevated(["ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)) utilities.process_status(utilities.elevated(["ln", "-s", "/Library/Application Support/Dortania/OpenCore-Patcher.app", "/Applications/OpenCore-Patcher.app"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
def _create_rsr_monitor_daemon(self) -> bool:
# Get kext list in /Library/Extensions that have the 'GPUCompanionBundles' property
# This is used to determine if we need to run the RSRMonitor
logging.info("- Checking if RSRMonitor is needed")
cryptex_path = f"/System/Volumes/Preboot/{utilities.get_preboot_uuid()}/cryptex1/current/OS.dmg"
if not Path(cryptex_path).exists():
logging.info("- No OS.dmg, skipping RSRMonitor")
return False
kexts = []
for kext in Path("/Library/Extensions").glob("*.kext"):
if not Path(f"{kext}/Contents/Info.plist").exists():
continue
kext_plist = plistlib.load(open(f"{kext}/Contents/Info.plist", "rb"))
if "GPUCompanionBundles" not in kext_plist:
continue
logging.info(f" - Found kext with GPUCompanionBundles: {kext.name}")
kexts.append(kext.name)
# If we have no kexts, we don't need to run the RSRMonitor
if not kexts:
logging.info("- No kexts found with GPUCompanionBundles, skipping RSRMonitor")
return False
# Load the RSRMonitor plist
rsr_monitor_plist = plistlib.load(open(self.constants.rsr_monitor_launch_daemon_path, "rb"))
arguments = ["rm", "-Rfv"]
arguments += [f"/Library/Extensions/{kext}" for kext in kexts]
# Add the arguments to the RSRMonitor plist
rsr_monitor_plist["ProgramArguments"] = arguments
# Next add monitoring for '/System/Volumes/Preboot/{UUID}/cryptex1/OS.dmg'
logging.info(f" - Adding monitor: {cryptex_path}")
rsr_monitor_plist["WatchPaths"] = [
cryptex_path,
]
# Write the RSRMonitor plist
plistlib.dump(rsr_monitor_plist, Path(self.constants.rsr_monitor_launch_daemon_path).open("wb"))
return True

View File

@@ -20,7 +20,6 @@ from data import (
model_array, model_array,
os_data, os_data,
sip_data, sip_data,
sys_patch_dict,
smbios_data, smbios_data,
cpu_data cpu_data
) )
@@ -478,12 +477,6 @@ class DetectRootPatch:
if self.constants.detected_os < os_data.os_data.ventura: if self.constants.detected_os < os_data.os_data.ventura:
return False return False
for controller in self.constants.computer.usb_controllers:
if (isinstance(controller, device_probe.XHCIController)):
# Currently USB 1.1 patches are incompatible with USB 3.0 controllers
# TODO: Downgrade remaining USB stack to ensure full support
return False
# If we're on a hackintosh, check for UHCI/OHCI controllers # If we're on a hackintosh, check for UHCI/OHCI controllers
if self.constants.host_is_hackintosh is True: if self.constants.host_is_hackintosh is True:
for controller in self.constants.computer.usb_controllers: for controller in self.constants.computer.usb_controllers:
@@ -731,170 +724,3 @@ class DetectRootPatch:
""" """
return not self.sip_enabled return not self.sip_enabled
def generate_patchset(self, hardware_details: dict):
"""
Generate Patchset dictionary for the current system
Parameters:
hardware_details (dict): Dictionary of hardware details generated by detect_patch_set()
Returns:
dict: Dictionary of patches to be applied from sys_patch_dict.py
"""
all_hardware_patchset: dict = sys_patch_dict.SystemPatchDictionary(self.constants.detected_os, self.constants.detected_os_minor, self.constants.legacy_accel_support).patchset_dict
required_patches: dict = {}
utilities.cls()
logging.info("- The following patches will be applied:")
if hardware_details["Graphics: Intel Ironlake"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Ironlake": all_hardware_patchset["Graphics"]["Intel Ironlake"]})
if hardware_details["Graphics: Intel Sandy Bridge"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"High Sierra GVA": all_hardware_patchset["Graphics"]["High Sierra GVA"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Sandy Bridge": all_hardware_patchset["Graphics"]["Intel Sandy Bridge"]})
# Patchset breaks Display Profiles, don't install if primary GPU is AMD
if self.constants.computer.real_model not in ["Macmini5,2", "iMac12,1", "iMac12,2"]:
required_patches.update({"Non-Metal ColorSync Workaround": all_hardware_patchset["Graphics"]["Non-Metal ColorSync Workaround"]})
if hardware_details["Graphics: Intel Ivy Bridge"] is True:
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Metal 3802 Common Extended": all_hardware_patchset["Graphics"]["Metal 3802 Common Extended"]})
required_patches.update({"Catalina GVA": all_hardware_patchset["Graphics"]["Catalina GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Big Sur OpenCL": all_hardware_patchset["Graphics"]["Big Sur OpenCL"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Ivy Bridge": all_hardware_patchset["Graphics"]["Intel Ivy Bridge"]})
if hardware_details["Graphics: Intel Haswell"] is True:
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Metal 3802 Common Extended": all_hardware_patchset["Graphics"]["Metal 3802 Common Extended"]})
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Haswell": all_hardware_patchset["Graphics"]["Intel Haswell"]})
if hardware_details["Graphics: Intel Broadwell"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Broadwell": all_hardware_patchset["Graphics"]["Intel Broadwell"]})
if hardware_details["Graphics: Intel Skylake"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Skylake": all_hardware_patchset["Graphics"]["Intel Skylake"]})
if hardware_details["Graphics: Nvidia Tesla"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Tesla": all_hardware_patchset["Graphics"]["Nvidia Tesla"]})
if hardware_details["Graphics: Nvidia Web Drivers"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Non-Metal IOAccelerator Common": all_hardware_patchset["Graphics"]["Non-Metal IOAccelerator Common"]})
required_patches.update({"Non-Metal CoreDisplay Common": all_hardware_patchset["Graphics"]["Non-Metal CoreDisplay Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Web Drivers": all_hardware_patchset["Graphics"]["Nvidia Web Drivers"]})
required_patches.update({"Non-Metal Enforcement": all_hardware_patchset["Graphics"]["Non-Metal Enforcement"]})
if hardware_details["Graphics: Nvidia Kepler"] is True:
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Metal 3802 Common Extended": all_hardware_patchset["Graphics"]["Metal 3802 Common Extended"]})
required_patches.update({"Catalina GVA": all_hardware_patchset["Graphics"]["Catalina GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Big Sur OpenCL": all_hardware_patchset["Graphics"]["Big Sur OpenCL"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Kepler": all_hardware_patchset["Graphics"]["Nvidia Kepler"]})
for gpu in self.constants.computer.gpus:
# Handle mixed GPU situations (ie. MacBookPro11,3: Haswell iGPU + Kepler dGPU)
if gpu.arch == device_probe.Intel.Archs.Haswell:
if "Catalina GVA" in required_patches:
del(required_patches["Catalina GVA"])
break
if hardware_details["Graphics: AMD TeraScale 1"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"AMD TeraScale Common": all_hardware_patchset["Graphics"]["AMD TeraScale Common"]})
required_patches.update({"AMD TeraScale 1": all_hardware_patchset["Graphics"]["AMD TeraScale 1"]})
if hardware_details["Graphics: AMD TeraScale 2"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Non-Metal IOAccelerator Common": all_hardware_patchset["Graphics"]["Non-Metal IOAccelerator Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"AMD TeraScale Common": all_hardware_patchset["Graphics"]["AMD TeraScale Common"]})
required_patches.update({"AMD TeraScale 2": all_hardware_patchset["Graphics"]["AMD TeraScale 2"]})
if self.constants.allow_ts2_accel is False or self.constants.detected_os not in self.constants.legacy_accel_support:
# TeraScale 2 MacBooks with faulty GPUs are highly prone to crashing with AMDRadeonX3000 attached
# Additionally, AMDRadeonX3000 requires IOAccelerator downgrade which is not installed without 'Non-Metal IOAccelerator Common'
del(required_patches["AMD TeraScale 2"]["Install"]["/System/Library/Extensions"]["AMDRadeonX3000.kext"])
if hardware_details["Graphics: AMD Legacy GCN"] is True or hardware_details["Graphics: AMD Legacy Polaris"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
if hardware_details["Graphics: AMD Legacy GCN"] is True:
required_patches.update({"AMD Legacy GCN": all_hardware_patchset["Graphics"]["AMD Legacy GCN"]})
else:
required_patches.update({"AMD Legacy Polaris": all_hardware_patchset["Graphics"]["AMD Legacy Polaris"]})
required_patches.update({"Revert GVA Downgrade": all_hardware_patchset["Graphics"]["Revert GVA Downgrade"]})
if "AVX2" not in self.constants.computer.cpu.leafs:
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if hardware_details["Graphics: AMD Legacy Vega"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"AMD Legacy Vega": all_hardware_patchset["Graphics"]["AMD Legacy Vega"]})
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if hardware_details["Graphics: AMD Legacy GCN"] is True:
required_patches.update({"AMD Legacy Vega Extended": all_hardware_patchset["Graphics"]["AMD Legacy Vega Extended"]})
else:
required_patches.update({"Revert GVA Downgrade": all_hardware_patchset["Graphics"]["Revert GVA Downgrade"]})
if hardware_details["Brightness: Legacy Backlight Control"] is True:
required_patches.update({"Legacy Backlight Control": all_hardware_patchset["Brightness"]["Legacy Backlight Control"]})
if hardware_details["Audio: Legacy Realtek"] is True:
if self.model in ["iMac7,1", "iMac8,1"]:
required_patches.update({"Legacy Realtek": all_hardware_patchset["Audio"]["Legacy Realtek"]})
else:
required_patches.update({"Legacy Non-GOP": all_hardware_patchset["Audio"]["Legacy Non-GOP"]})
if hardware_details["Networking: Legacy Wireless"] is True:
required_patches.update({"Legacy Wireless": all_hardware_patchset["Networking"]["Legacy Wireless"]})
required_patches.update({"Legacy Wireless Extended": all_hardware_patchset["Networking"]["Legacy Wireless Extended"]})
if hardware_details["Miscellaneous: Legacy GMUX"] is True:
required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]})
if hardware_details["Miscellaneous: Legacy Keyboard Backlight"] is True:
required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]})
if hardware_details["Miscellaneous: Legacy USB 1.1"] is True:
required_patches.update({"Legacy USB 1.1": all_hardware_patchset["Miscellaneous"]["Legacy USB 1.1"]})
if required_patches:
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")
# Prioritize Monterey GVA patches
if "Catalina GVA" in required_patches and "Monterey GVA" in required_patches:
del(required_patches["Catalina GVA"])
for patch_name in list(required_patches):
patch_os_min_float = float(f'{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Minor"]}')
patch_os_max_float = float(f'{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Minor"]}')
if (host_os_float < patch_os_min_float or host_os_float > patch_os_max_float):
del(required_patches[patch_name])
else:
if required_patches[patch_name]["Display Name"]:
logging.info(f" - {required_patches[patch_name]['Display Name']}")
else:
logging.info(" - No patch sets found for booted model")
return required_patches

View File

@@ -0,0 +1,191 @@
# Generate patch set for use in sys_patch.py
import logging
from resources import constants, utilities, device_probe
from data import sys_patch_dict
class GenerateRootPatchSets:
"""
Library for generating patch sets for the current host
Parameters:
model (str): Model identifier
global_constants (constants.Constants): Global constants object
hardware_details (dict): Dictionary of hardware details generated by detect_patch_set()
Usage:
>>> from resources.sys_patch import sys_patch_generate
>>> patchset = sys_patch_generate.GenerateRootPatches("iMac7,1", self.constants, self.hardware_details).patchset
"""
def __init__(self, model: str, global_constants: constants.Constants, hardware_details: dict) -> None:
self.model: str = model
self.constants: constants.Constants = global_constants
self.hardware_details: dict = hardware_details
self.patchset: dict = self._generate_patchset()
def _generate_patchset(self) -> dict:
"""
Generate Patchset dictionary for the current system
Returns:
dict: Dictionary of patches to be applied from sys_patch_dict.py
"""
all_hardware_patchset: dict = sys_patch_dict.SystemPatchDictionary(self.constants.detected_os, self.constants.detected_os_minor, self.constants.legacy_accel_support).patchset_dict
required_patches: dict = {}
utilities.cls()
logging.info("- The following patches will be applied:")
if self.hardware_details["Graphics: Intel Ironlake"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Ironlake": all_hardware_patchset["Graphics"]["Intel Ironlake"]})
if self.hardware_details["Graphics: Intel Sandy Bridge"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"High Sierra GVA": all_hardware_patchset["Graphics"]["High Sierra GVA"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Sandy Bridge": all_hardware_patchset["Graphics"]["Intel Sandy Bridge"]})
# Patchset breaks Display Profiles, don't install if primary GPU is AMD
if self.constants.computer.real_model not in ["Macmini5,2", "iMac12,1", "iMac12,2"]:
required_patches.update({"Non-Metal ColorSync Workaround": all_hardware_patchset["Graphics"]["Non-Metal ColorSync Workaround"]})
if self.hardware_details["Graphics: Intel Ivy Bridge"] is True:
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Metal 3802 Common Extended": all_hardware_patchset["Graphics"]["Metal 3802 Common Extended"]})
required_patches.update({"Catalina GVA": all_hardware_patchset["Graphics"]["Catalina GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Big Sur OpenCL": all_hardware_patchset["Graphics"]["Big Sur OpenCL"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Intel Ivy Bridge": all_hardware_patchset["Graphics"]["Intel Ivy Bridge"]})
if self.hardware_details["Graphics: Intel Haswell"] is True:
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Metal 3802 Common Extended": all_hardware_patchset["Graphics"]["Metal 3802 Common Extended"]})
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Haswell": all_hardware_patchset["Graphics"]["Intel Haswell"]})
if self.hardware_details["Graphics: Intel Broadwell"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Broadwell": all_hardware_patchset["Graphics"]["Intel Broadwell"]})
if self.hardware_details["Graphics: Intel Skylake"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Intel Skylake": all_hardware_patchset["Graphics"]["Intel Skylake"]})
if self.hardware_details["Graphics: Nvidia Tesla"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Tesla": all_hardware_patchset["Graphics"]["Nvidia Tesla"]})
if self.hardware_details["Graphics: Nvidia Web Drivers"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Non-Metal IOAccelerator Common": all_hardware_patchset["Graphics"]["Non-Metal IOAccelerator Common"]})
required_patches.update({"Non-Metal CoreDisplay Common": all_hardware_patchset["Graphics"]["Non-Metal CoreDisplay Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Web Drivers": all_hardware_patchset["Graphics"]["Nvidia Web Drivers"]})
required_patches.update({"Non-Metal Enforcement": all_hardware_patchset["Graphics"]["Non-Metal Enforcement"]})
if self.hardware_details["Graphics: Nvidia Kepler"] is True:
required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]})
required_patches.update({"Metal 3802 Common Extended": all_hardware_patchset["Graphics"]["Metal 3802 Common Extended"]})
required_patches.update({"Catalina GVA": all_hardware_patchset["Graphics"]["Catalina GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"Big Sur OpenCL": all_hardware_patchset["Graphics"]["Big Sur OpenCL"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"Nvidia Kepler": all_hardware_patchset["Graphics"]["Nvidia Kepler"]})
for gpu in self.constants.computer.gpus:
# Handle mixed GPU situations (ie. MacBookPro11,3: Haswell iGPU + Kepler dGPU)
if gpu.arch == device_probe.Intel.Archs.Haswell:
if "Catalina GVA" in required_patches:
del(required_patches["Catalina GVA"])
break
if self.hardware_details["Graphics: AMD TeraScale 1"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"AMD TeraScale Common": all_hardware_patchset["Graphics"]["AMD TeraScale Common"]})
required_patches.update({"AMD TeraScale 1": all_hardware_patchset["Graphics"]["AMD TeraScale 1"]})
if self.hardware_details["Graphics: AMD TeraScale 2"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Non-Metal IOAccelerator Common": all_hardware_patchset["Graphics"]["Non-Metal IOAccelerator Common"]})
required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]})
required_patches.update({"AMD TeraScale Common": all_hardware_patchset["Graphics"]["AMD TeraScale Common"]})
required_patches.update({"AMD TeraScale 2": all_hardware_patchset["Graphics"]["AMD TeraScale 2"]})
if self.constants.allow_ts2_accel is False or self.constants.detected_os not in self.constants.legacy_accel_support:
# TeraScale 2 MacBooks with faulty GPUs are highly prone to crashing with AMDRadeonX3000 attached
# Additionally, AMDRadeonX3000 requires IOAccelerator downgrade which is not installed without 'Non-Metal IOAccelerator Common'
del(required_patches["AMD TeraScale 2"]["Install"]["/System/Library/Extensions"]["AMDRadeonX3000.kext"])
if self.hardware_details["Graphics: AMD Legacy GCN"] is True or self.hardware_details["Graphics: AMD Legacy Polaris"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
if self.hardware_details["Graphics: AMD Legacy GCN"] is True:
required_patches.update({"AMD Legacy GCN": all_hardware_patchset["Graphics"]["AMD Legacy GCN"]})
else:
required_patches.update({"AMD Legacy Polaris": all_hardware_patchset["Graphics"]["AMD Legacy Polaris"]})
required_patches.update({"Revert GVA Downgrade": all_hardware_patchset["Graphics"]["Revert GVA Downgrade"]})
if "AVX2" not in self.constants.computer.cpu.leafs:
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if self.hardware_details["Graphics: AMD Legacy Vega"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"AMD Legacy Vega": all_hardware_patchset["Graphics"]["AMD Legacy Vega"]})
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if self.hardware_details["Graphics: AMD Legacy GCN"] is True:
required_patches.update({"AMD Legacy Vega Extended": all_hardware_patchset["Graphics"]["AMD Legacy Vega Extended"]})
else:
required_patches.update({"Revert GVA Downgrade": all_hardware_patchset["Graphics"]["Revert GVA Downgrade"]})
if self.hardware_details["Brightness: Legacy Backlight Control"] is True:
required_patches.update({"Legacy Backlight Control": all_hardware_patchset["Brightness"]["Legacy Backlight Control"]})
if self.hardware_details["Audio: Legacy Realtek"] is True:
if self.model in ["iMac7,1", "iMac8,1"]:
required_patches.update({"Legacy Realtek": all_hardware_patchset["Audio"]["Legacy Realtek"]})
else:
required_patches.update({"Legacy Non-GOP": all_hardware_patchset["Audio"]["Legacy Non-GOP"]})
if self.hardware_details["Networking: Legacy Wireless"] is True:
required_patches.update({"Legacy Wireless": all_hardware_patchset["Networking"]["Legacy Wireless"]})
required_patches.update({"Legacy Wireless Extended": all_hardware_patchset["Networking"]["Legacy Wireless Extended"]})
if self.hardware_details["Miscellaneous: Legacy GMUX"] is True:
required_patches.update({"Legacy GMUX": all_hardware_patchset["Miscellaneous"]["Legacy GMUX"]})
if self.hardware_details["Miscellaneous: Legacy Keyboard Backlight"] is True:
required_patches.update({"Legacy Keyboard Backlight": all_hardware_patchset["Miscellaneous"]["Legacy Keyboard Backlight"]})
if self.hardware_details["Miscellaneous: Legacy USB 1.1"] is True:
required_patches.update({"Legacy USB 1.1": all_hardware_patchset["Miscellaneous"]["Legacy USB 1.1"]})
if required_patches:
host_os_float = float(f"{self.constants.detected_os}.{self.constants.detected_os_minor}")
# Prioritize Monterey GVA patches
if "Catalina GVA" in required_patches and "Monterey GVA" in required_patches:
del(required_patches["Catalina GVA"])
for patch_name in list(required_patches):
patch_os_min_float = float(f'{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Minimum OS Support"]["OS Minor"]}')
patch_os_max_float = float(f'{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Major"]}.{required_patches[patch_name]["OS Support"]["Maximum OS Support"]["OS Minor"]}')
if (host_os_float < patch_os_min_float or host_os_float > patch_os_max_float):
del(required_patches[patch_name])
else:
if required_patches[patch_name]["Display Name"]:
logging.info(f" - {required_patches[patch_name]['Display Name']}")
else:
logging.info(" - No patch sets found for booted model")
return required_patches

View File

@@ -5,6 +5,8 @@ import plistlib
import os import os
import logging import logging
import subprocess import subprocess
from typing import Union
from pathlib import Path from pathlib import Path
from datetime import datetime from datetime import datetime
@@ -211,3 +213,58 @@ class SysPatchHelpers:
result = utilities.elevated([self.constants.rsrrepair_userspace_path, "--install"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) result = utilities.elevated([self.constants.rsrrepair_userspace_path, "--install"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0: if result.returncode != 0:
logging.info(f" - Failed to install RSRRepair: {result.stdout.decode()}") logging.info(f" - Failed to install RSRRepair: {result.stdout.decode()}")
def patch_gpu_compiler_libraries(self, mount_point: Union[str, Path]):
"""
Fix GPUCompiler.framework's libraries to resolve linking issues
On 13.3 with 3802 GPUs, OCLP will downgrade GPUCompiler to resolve
graphics support. However the binary hardcodes the library names,
and thus we need to adjust the libraries to match (31001.669)
Important portions of the library will be downgraded to 31001.669,
and the remaining bins will be copied over (via CoW to reduce waste)
Primary folders to merge:
- 31001.XXX: (current OS version)
- include:
- module.modulemap
- opencl-c.h
- lib (entire directory)
Parameters:
mount_point: The mount point of the target volume
"""
if self.constants.detected_os < os_data.os_data.ventura:
return
if self.constants.detected_os == os_data.os_data.ventura:
if self.constants.detected_os_minor < 4:
return
LIBRARY_DIR = f"{mount_point}/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang"
GPU_VERSION = "31001.669"
DEST_DIR = f"{LIBRARY_DIR}/{GPU_VERSION}"
if not Path(DEST_DIR).exists():
return
for file in Path(LIBRARY_DIR).iterdir():
if file.is_file():
continue
if file.name == GPU_VERSION:
continue
# Partial match as each OS can increment the version
if not file.name.startswith("31001."):
continue
logging.info(f"- Merging GPUCompiler.framework libraries to match binary")
src_dir = f"{LIBRARY_DIR}/{file.name}"
if not Path(f"{DEST_DIR}/lib").exists():
utilities.process_status(utilities.elevated(["cp", "-cR", f"{src_dir}/lib", f"{DEST_DIR}/"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT))
break

View File

@@ -96,7 +96,7 @@ class CheckBinaryUpdates:
if not network_handler.NetworkUtilities(REPO_LATEST_RELEASE_URL).verify_network_connection(): if not network_handler.NetworkUtilities(REPO_LATEST_RELEASE_URL).verify_network_connection():
return None return None
response = requests.get(REPO_LATEST_RELEASE_URL) response = network_handler.NetworkUtilities().get(REPO_LATEST_RELEASE_URL)
data_set = response.json() data_set = response.json()
self.remote_version = data_set["tag_name"] self.remote_version = data_set["tag_name"]

View File

@@ -451,6 +451,15 @@ def monitor_disk_output(disk):
return output return output
def get_preboot_uuid() -> str:
"""
Get the UUID of the Preboot volume
"""
args = ["ioreg", "-a", "-n", "chosen", "-p", "IODeviceTree", "-r"]
output = plistlib.loads(subprocess.run(args, stdout=subprocess.PIPE).stdout)
return output[0]["apfs-preboot-uuid"].strip(b"\0").decode()
def block_os_updaters(): def block_os_updaters():
# Disables any processes that would be likely to mess with # Disables any processes that would be likely to mess with
# the root volume while we're working with it. # the root volume while we're working with it.

View File

@@ -63,7 +63,7 @@ class PatcherValidation:
for model in model_array.SupportedSMBIOS: for model in model_array.SupportedSMBIOS:
logging.info(f"Validating predefined model: {model}") logging.info(f"Validating predefined model: {model}")
self.constants.custom_model = model self.constants.custom_model = model
build.build_opencore(self.constants.custom_model, self.constants).build_opencore() build.BuildOpenCore(self.constants.custom_model, self.constants)
result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0: if result.returncode != 0:
logging.info("Error on build!") logging.info("Error on build!")
@@ -83,7 +83,7 @@ class PatcherValidation:
self.constants.computer = model self.constants.computer = model
self.constants.custom_model = "" self.constants.custom_model = ""
logging.info(f"Validating dumped model: {self.constants.computer.real_model}") logging.info(f"Validating dumped model: {self.constants.computer.real_model}")
build.build_opencore(self.constants.computer.real_model, self.constants).build_opencore() build.BuildOpenCore(self.constants.computer.real_model, self.constants)
result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) result = subprocess.run([self.constants.ocvalidate_path, f"{self.constants.opencore_release_folder}/EFI/OC/config.plist"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if result.returncode != 0: if result.returncode != 0:
logging.info("Error on build!") logging.info("Error on build!")