Skip to content

Commit

Permalink
Fix OpenCanopy and enhance build detection
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Apr 6, 2021
1 parent 57713ab commit cc5d522
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# OpenCore Legacy Patcher changelog

## 0.0.21
- Fix botched images in OpenCanopy
- Add support for 3rd party OpenCore usage detection during building
- Mainly for users transtioning from Ausdauersportler's OpenCore configuration

## 0.0.20
- Fix CPU Calculation on early MCP79 chipsets (ie. iMac9,1, MacBook5,x)
Expand Down
14 changes: 14 additions & 0 deletions OpenCore-Patcher.command
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ class OpenCoreLegacyPatcher():
if self.current_model in ModelArray.NoAPFSsupport:
self.constants.serial_settings = "Moderate"

# Logic for when user runs custom OpenCore build and do not expose it
# Note: This logic currently only applies for iMacPro1,1 users, see below threads on the culprits:
# - https://forums.macrumors.com/threads/2011-imac-graphics-card-upgrade.1596614/post-17425857
# - https://forums.macrumors.com/threads/opencore-on-the-mac-pro.2207814/
# PLEASE FOR THE LOVE OF GOD JUST SET ExposeSensitiveData CORRECTLY!!!
if self.current_model == "iMacPro1,1":
serial: str = subprocess.run("system_profiler SPHardwareDataType | grep Serial".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
serial = [line.strip().split("Number (system): ", 1)[1] for line in serial.split("\n") if line.strip().startswith("Serial")][0]
true_model = subprocess.run([str(self.constants.macserial_path), "--info", str(serial)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
true_model = [i.partition(" - ")[2] for i in true_model.stdout.decode().split("\n") if "Model: " in i][0]
print(f"True Model: {true_model}")
if not true_model.startswith("Unknown"):
self.current_model = true_model

def build_opencore(self):
build.BuildOpenCore(self.constants.custom_model or self.current_model, self.constants).build_opencore()

Expand Down
Binary file modified payloads/Icon/Resources.zip
Binary file not shown.

0 comments on commit cc5d522

Please sign in to comment.