Compare commits

...

11 Commits

Author SHA1 Message Date
Mykola Grymalyuk
4632371437 Misc file cleanup 2021-03-02 17:22:39 -07:00
Mykola Grymalyuk
b21b10d00b Remove old SMBIOS content 2021-03-02 16:45:40 -07:00
Mykola Grymalyuk
f93b62160a Fix sleep for iMac12,x with upgraded GPUs 2021-03-02 14:35:57 -07:00
Mykola Grymalyuk
bde44fc830 Add extras notes 2021-03-02 09:00:02 -07:00
Mykola Grymalyuk
08731521ad Add Backlight patches for modded Nvidia GPUs 2021-03-02 07:30:59 -07:00
Dhinak G
6c74bfd862 Fix typo in previous commit 2021-03-02 00:03:17 -05:00
Dhinak G
6750bdf9f1 Fix typo 2021-03-02 00:02:12 -05:00
Dhinak G
f0d8399610 Merge branch 'main' of github.com:dortania/Opencore-Legacy-Patcher into main 2021-03-02 00:01:10 -05:00
Dhinak G
8271db0d26 Package as .app 2021-03-02 00:01:06 -05:00
Mykola Grymalyuk
de77968cdb Increment version 2021-03-01 21:15:46 -07:00
Dhinak G
7b0321be65 Fix typo 2021-03-01 23:06:39 -05:00
15 changed files with 116 additions and 10424 deletions

View File

@@ -24,17 +24,26 @@ jobs:
pip3 install pyinstaller
- run: pyinstaller Opencore-Patcher.spec
- run: cd dist; zip ../OpenCore-Patcher.zip OpenCore-Patcher
- run: ./after_pyinstaller.sh
- name: Upload to Artifacts
- run: cd dist; zip ../OpenCore-Patcher.zip OpenCore-Patcher; zip -r ../OpenCore-Patcher.app.zip OpenCore-Patcher.app
- name: Upload Binary to Artifacts
uses: actions/upload-artifact@v2
with:
name: OpenCore-Patcher
path: OpenCore-Patcher.zip
- name: Upload App to Artifacts
uses: actions/upload-artifact@v2
with:
name: OpenCore-Patcher.app
path: OpenCore-Patcher.app.zip
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: OpenCore-Patcher.zip
file: OpenCore-Patcher.app.zip
tag: ${{ github.ref }}
file_glob: true

View File

@@ -1,5 +1,10 @@
# OpenCore Legacy Patcher changelog
## 0.0.12
- Convert OpenCore-Patcher binary to OpenCore-Patcher.app
- Add Backlight patches for modded Nvidia GPUs in iMac10,x-12,x
- Fix sleep for iMac12,x with upgraded GPUs
## 0.0.11
- Re-add OpenCore GUI
- Rewrite in py3

View File

@@ -1,32 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>OpenCore-Patcher.command</string>
<key>CFBundleIconFile</key>
<string>OC-Patcher.icns</string>
<key>CFBundleIdentifier</key>
<string>com.dortania.OpenCore-Patcher</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>0.0</string>
<key>CFBundleName</key>
<string>OpenCore-Patcher</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.4</string>
<key>LSMultipleInstancesProhibited</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2021 Dortania</string>
</dict>
</plist>

View File

@@ -2,12 +2,10 @@
from __future__ import print_function
import subprocess
import subprocess, sys, time
from Resources import build, ModelArray, Constants, utilities
PATCHER_VERSION = "0.0.11"
class OpenCoreLegacyPatcher():
def __init__(self):
@@ -88,7 +86,8 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
response = menu.start()
print("Bye")
if getattr(sys, "frozen", False):
subprocess.run("""osascript -e 'tell application "Terminal" to close first window' & exit""", shell=True)
OpenCoreLegacyPatcher().main_menu()

View File

@@ -30,3 +30,12 @@ exe = EXE(pyz,
upx_exclude=[],
runtime_tmpdir=None,
console=True )
app = BUNDLE(exe,
name='OpenCore-Patcher.app',
icon="OC-Patcher.icns",
bundle_identifier=None,
info_plist={
"CFBundleShortVersionString": "0.0.12",
"CFBundleExecutable": "MacOS/Launcher",
"NSHumanReadableCopyright": "Copyright 2020-2021 Dortania"
})

View File

@@ -16,6 +16,8 @@ Note: Only clean-installs and upgrades are supported, installs already patched w
* You can however reinstall macOS with this patcher and retain your original data
Note 2: Currently OpenCore Legacy Patcher only supports macOS 11, Big Sur installs. For older OSes, please use [Dosdude1's patchers](http://dosdude1.com)
## How to use
To use, simply:
@@ -23,7 +25,7 @@ To use, simply:
1. Ensure your hardware is compatible(See [Supported SMBIOS](/docs/MODELS.md))
2. Download and build macOS Installer
3. Download the latest release: [OpenCore Legacy Patcher Releases](https://github.com/dortania/Opencore-Legacy-Patcher/releases)
4. Run the `OpenCore-Patcher` binary
4. Run the `OpenCore-Patcher.app`
5. Run `Build OpenCore`(if building for another machine, please select `Change Model`)
| First Run | Build EFI |
@@ -60,6 +62,15 @@ To remove OpenCore is actually quite simply:
2. Reset NVRAM
* [Reset NVRAM or PRAM on your Mac](https://support.apple.com/HT204063)
Know that if you are on Big Sur when you remove the EFI folder, your Mac will no longer boot and show the prohibited symbol. Be ready to install an older version of macOS before you uninstall Open Core.
Know that if you are on Big Sur when you remove the EFI folder, your Mac will no longer boot and show the prohibited symbol. Be ready to install an older version of macOS before you uninstall OpenCore.
## Patcher Warnings
Since this patcher tricks macOS into thinking you're running a newer Mac, certain functionality may be broken:
* Boot Camp Assistant.app
* We recommend running the assistant on a natively supported OS
* Legacy Windows Booting
* Currently OpenCore cannot boot MBR-based installs, so Ivy Bridge and older Machines may not be able to see Windows in OpenCore's Boot Picker
## [Troubleshooting](/docs/TROUBLESHOOTING.md)

View File

@@ -8,7 +8,7 @@ from pathlib import Path
class Constants:
def __init__(self):
self.patcher_version = "0.0.11"
self.patcher_version = "0.0.12"
self.opencore_commit = "cbd2fa3"
self.opencore_version = "0.6.7"
self.lilu_version = "1.5.1"
@@ -25,6 +25,7 @@ class Constants:
self.voodoohda_version = "296"
self.restrictevents_version = "1.0.0"
self.piixata_version = "1.0.0"
self.backlight_version = "1.0.0"
# Get resource path
self.current_path = Path(__file__).parent.parent.resolve()
@@ -32,6 +33,8 @@ class Constants:
self.custom_model: str = None
self.custom_mxm_gpu: str = None
self.current_gpuv: str = None
self.current_gpud: str = None
# Payload Location
# OpenCore
@property
@@ -78,6 +81,8 @@ class Constants:
def voodoohda_path(self): return self.payload_kexts_path / Path(f"Audio/VoodooHDA-v{self.voodoohda_version}.zip")
@property
def piixata_path(self): return self.payload_kexts_path / Path(f"Misc/AppleIntelPIIXATA-v{self.piixata_version}.zip")
@property
def backlight_path(self): return self.payload_kexts_path / Path(f"Misc/AppleBacklightFixup-v{self.backlight_version}.zip")
# Build Location
@property

View File

@@ -66,10 +66,10 @@ class BuildOpenCore:
self.config = plistlib.load(Path(self.constants.plist_path).open("rb"))
# Set revision in config
self.config["#Revision"]["Build-Date"] = f"{date.today()}"
self.config["#Revision"]["OpenCore-Version"] = f"{self.constants.opencore_version} {self.constants.opencore_commit}"
self.config["#Revision"]["Build-Version"] = f"{self.constants.patcher_version} - {date.today()}"
self.config["#Revision"]["OpenCore-Version"] = f"{self.constants.opencore_version} - {self.constants.opencore_commit}"
self.config["#Revision"]["Original-Model"] = self.model
self.config["#Revision"]["Patcher-Version"] = self.constants.patcher_version
#self.config["#Revision"]["Patcher-Version"] = self.constants.patcher_version
for name, version, path, check in [
# Essential kexts
@@ -153,22 +153,29 @@ class BuildOpenCore:
# Check GPU Vendor
if self.constants.custom_model == "None":
current_gpu: str = subprocess.run("system_profiler SPDisplaysDataType".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
current_gpuv = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Vendor"))][0]
current_gpud = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Device ID"))][0]
print(f"- Detected GPU: {current_gpuv} {current_gpud}")
if (current_gpuv == "AMD (0x1002)") & (current_gpud in ModelArray.AMDMXMGPUs):
self.constants.current_gpuv = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Vendor"))][0]
self.constants.current_gpud = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Device ID"))][0]
print(f"- Detected GPU: {self.constants.current_gpuv} {self.constants.current_gpud}")
if (self.constants.current_gpuv == "AMD (0x1002)") & (self.constants.current_gpud in ModelArray.AMDMXMGPUs):
self.constants.custom_mxm_gpu = True
print("- Adding AMD DRM patches")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " shikigva=80 unfairgva=1"
elif (current_gpuv == "NVIDIA (0x10de)") & (current_gpud in ModelArray.NVIDIAMXMGPUs):
if self.model in ["iMac12,1", "iMac12,2"]:
print("- Disabling unsupported iGPU")
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"name": binascii.unhexlify("23646973706C6179"), "IOName": "#display", "class-code": binascii.unhexlify("FFFFFFFF")}
elif (self.constants.current_gpuv == "NVIDIA (0x10de)") & (self.constants.current_gpud in ModelArray.NVIDIAMXMGPUs):
self.constants.custom_mxm_gpu = True
print("- Adding Brightness Control patches")
if self.model in ["iMac11,1", "iMac11,2", "iMac11,3"]:
backlight_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
self.config["DeviceProperties"]["Add"][backlight_path] = {"@0,backlight-control": binascii.unhexlify("01000000"), "@0,built-in": binascii.unhexlify("01000000")}
shutil.copy(self.constants.backlight_path, self.constants.kexts_path)
self.get_kext_by_bundle_path("AppleBacklightFixup.kext")["Enabled"] = True
elif self.model in ["iMac12,1", "iMac12,2"]:
backlight_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
self.config["DeviceProperties"]["Add"][backlight_path] = {"@0,backlight-control": binascii.unhexlify("01000000"), "@0,built-in": binascii.unhexlify("01000000")}
print("- Disabling unsupported iGPU")
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"name": binascii.unhexlify("23646973706C6179"), "IOName": "#display", "class-code": binascii.unhexlify("FFFFFFFF")}
# Add OpenCanopy
print("- Adding OpenCanopy GUI")
@@ -200,7 +207,12 @@ class BuildOpenCore:
spoofed_model = "Macmini7,1"
spoofed_board = "Mac-35C5E08120C7EEAF"
elif self.model in ModelArray.iMac151:
if self.constants.custom_mxm_gpu == True:
# Check for upgraded GPUs on iMacs
if (self.constants.current_gpuv == "AMD (0x1002)") & (self.constants.current_gpud in ModelArray.AMDMXMGPUs) & (self.constants.custom_model == "None"):
print("- Spoofing to iMacPro1,1")
spoofed_model = "iMacPro1,1"
spoofed_board = "Mac-7BA5B2D9E42DDD94"
elif (self.constants.current_gpuv == "NVIDIA (0x10de)") & (self.constants.current_gpud in ModelArray.NVIDIAMXMGPUs) & (self.constants.custom_model == "None"):
print("- Spoofing to iMacPro1,1")
spoofed_model = "iMacPro1,1"
spoofed_board = "Mac-7BA5B2D9E42DDD94"
@@ -216,11 +228,10 @@ class BuildOpenCore:
print("- Spoofing to MacPro7,1")
spoofed_model = "MacPro7,1"
spoofed_board = "Mac-27AD2F918AE68F61"
self.config["#Revision"]["Spoofed-Model"] = spoofed_model
macserial_output = subprocess.run([self.constants.macserial_path] + f"-g -m {spoofed_model} -n 1".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
macserial_output = macserial_output.stdout.decode().strip().split(" | ")
# Setup menu
smbios_mod = True
while smbios_mod == True:
@@ -244,7 +255,6 @@ class BuildOpenCore:
smbios_mod = True
# USB Map
usb_map_path = Path(self.constants.current_path) / Path(f"payloads/Kexts/Maps/Universal/Info.plist")
self.new_map_ls = Path(self.constants.map_contents_folder) / Path(f"Info.plist")
self.map_config = plistlib.load(Path(self.new_map_ls).open("rb"))

2
after_pyinstaller.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh
cp launcher.sh dist/OpenCore-Patcher.app/Contents/MacOS/Launcher

View File

@@ -5,6 +5,7 @@ Here are some common errors users may experience while using this patcher:
* [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)
* [Cannot boot macOS without the USB](#cannot-boot-macos-without-the-usb)
* [Infinite Recovery OS Booting](#infinite-recovery-os-reboot)
* [Reboot when entering Hibernation (`Sleep Wake Failure`)](#reboot-when-entering-hibernation-sleep-wake-failure)
## Stuck on `This version of Mac OS X is not supported on this platform`
@@ -14,10 +15,21 @@ Once you've booted OpenCore at least once, your hardware should now auto boot it
## Cannot boot macOS without the USB
At this time, the OpenCore Patcher won't install macOS onto the internal drive itself during installs. Instead, you'll need to either [manually transfer](https://dortania.github.io/OpenCore-Post-Install/universal/oc2hdd.html) OpenCore to the internal drive's EFI or run this patcher's Option 2 again but select your internal drive.
At this time, the OpenCore Patcher won't install OpenCore onto the internal drive itself during installs. Instead, you'll need to either [manually transfer](https://dortania.github.io/OpenCore-Post-Install/universal/oc2hdd.html) OpenCore to the internal drive's EFI or run this patcher's Option 2 again but select your internal drive.
Reminder that once this is done, you'll need to select OpenCore in the boot picker again for your hardware to remember this entry and auto boot from then on.
## Infinite Recovery OS Booting
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, 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, simply uninstall OpenCore and [reset NVRAM](https://support.apple.com/en-mide/HT201255).
* Note: Machines with modded root volumes will also result in infinite recovery until integrity is restored
## Reboot when entering Hibernation (`Sleep Wake Failure`)
Currently the patcher does not support hibernation for many machines, we recommend disabling hibernation for now:
```sh
sudo pmset -a hibernatemode 0
```

5
launcher.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
cd "$(dirname "$0")"
chmod +x OpenCore-Patcher
open OpenCore-Patcher

View File

@@ -4,14 +4,12 @@
<dict>
<key>#Revision</key>
<dict>
<key>Build-Date</key>
<key>Build-Version</key>
<string></string>
<key>OpenCore-Version</key>
<string></string>
<key>Original-Model</key>
<string></string>
<key>Patcher-Version</key>
<string></string>
</dict>
<key>ACPI</key>
<dict>
@@ -172,15 +170,7 @@
<key>DeviceProperties</key>
<dict>
<key>Add</key>
<dict>
<key>#PciRoot(0x0)/Pci(0x1C,0x1)/Pci(0x0,0x0)</key>
<dict>
<key>device-id</key>
<data>ukMAAA==</data>
<key>compatible</key>
<string>pci14e4,43ba</string>
</dict>
</dict>
<dict/>
<key>Delete</key>
<dict/>
</dict>
@@ -494,6 +484,24 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Comment</key>
<string>AppleBacklightFixup - Modded Nvidia GPUs</string>
<key>Enabled</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<key>BundlePath</key>
<string>AppleBacklightFixup.kext</string>
<key>ExecutablePath</key>
<string>Contents/MacOS/AppleBacklightFixup</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
@@ -862,7 +870,7 @@
<key>MaxBIOSVersion</key>
<true/>
<key>MLB</key>
<string>M0000000000000001</string>
<string></string>
<key>ProcessorType</key>
<integer>0</integer>
<key>ROM</key>
@@ -870,11 +878,11 @@
<key>SpoofVendor</key>
<true/>
<key>SystemProductName</key>
<string>iMac19,1</string>
<string></string>
<key>SystemSerialNumber</key>
<string>W00000000001</string>
<string></string>
<key>SystemUUID</key>
<string>00000000-0000-0000-0000-000000000000</string>
<string></string>
</dict>
<key>PlatformNVRAM</key>
<dict>
@@ -908,7 +916,7 @@
<key>BoardManufacturer</key>
<string></string>
<key>BoardProduct</key>
<string>Mac-AA95B1DDAB278B95</string>
<string></string>
<key>BoardSerialNumber</key>
<string></string>
<key>BoardType</key>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.