Skip to content

Commit

Permalink
Fix misc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Dec 3, 2020
1 parent 627bc81 commit b25fa91
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## 0.0.5
- Enable hibernation support
- Work around USB Map failing
- Add checks whether booting with OpenCore
- Fix MouSSE injection

## 0.0.4
- Add basic audio support for legacy chipsets
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@ Once you've booted OpenCore at least once, your hardware should now auto boot it

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.

Reminder that once this is done, you'll need to select OpenCore in the boot picker again for your hardware to remenber this entry and auto boot from then on.
Reminder that once this is done, you'll need to select OpenCore in the boot picker again for your hardware to remenber this entry and auto boot from then on.

### OpenCore won't show up in the boot picker

If OpenCore refuses to show up in the boot picker even with the above troubleshooting step, you can try to disable SIP and run this command(With your EFI drive mounted):

```sh
sudo bless --verbose --file /Volumes/EFI/EFI/OC/Bootstrap/Bootstrap.efi --folder /Volumes/EFI/EFI/OC/Bootstrap --setBoot
```

* Note: NVRAM write is disabled with SIP, so disables SIP first before running
19 changes: 16 additions & 3 deletions Resources/BuildOpenCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@
pass

# Find SMBIOS of machine
current_model = subprocess.Popen("system_profiler SPHardwareDataType".split(), stdout=subprocess.PIPE)
current_model = [line.strip().split(": ", 1)[1] for line in current_model.stdout.read().split("\n") if line.strip().startswith("Model Identifier")][0]
opencore_model = subprocess.Popen(["NVRAM", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-product"], stdout=subprocess.PIPE).communicate()[0]
if opencore_model not in ("NVRAM: Error getting variable - '4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-product': (iokit/common) data was not found"):
print("Detected OpenCore machine")
opencore_model = subprocess.Popen("nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:oem-product".split(), stdout=subprocess.PIPE)
opencore_model = [line.strip().split(":oem-product ", 1)[1] for line in opencore_model.stdout.read().split("\n") if line.strip().startswith("4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:")][0]
current_model = opencore_model
else:
print("No OpenCore detected")
current_model = subprocess.Popen("system_profiler SPHardwareDataType".split(), stdout=subprocess.PIPE)
current_model = [line.strip().split(": ", 1)[1] for line in current_model.stdout.read().split("\n") if line.strip().startswith("Model Identifier")][0]
print("Current Model: %s" % current_model)

OCExist = False

Expand Down Expand Up @@ -71,7 +80,7 @@ def BuildEFI():

if current_model in ModelArray.SSEEmulator:
print("- Adding AAAMouSSE v%s" % Versions.mousse_version)
copy(Versions.mousse_version, Versions.kext_path_build)
copy(Versions.mousse_path, Versions.kext_path_build)
Versions.plist_data = Versions.plist_data.replace(
"<false/><!--AAAMouSSE-->",
"<true/><!--AAAMouSSE-->"
Expand Down Expand Up @@ -208,6 +217,10 @@ def BuildEFI():
print("- Adding USB Map for %s" % current_model)
copy(usb_map_path, Versions.kext_path_build)
map_name = ("USB-Map-%s.kext" % current_model)
Versions.plist_data = Versions.plist_data.replace(
"<<false/><!--USBmap-->",
"<true/><!--USBmap-->"
)
Versions.plist_data = Versions.plist_data.replace(
"USB-Map-SMBIOS.kext",
map_name
Expand Down
4 changes: 2 additions & 2 deletions payloads/Config/v0.6.3/config.plist
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@
<key>Comment</key>
<string>USB Map</string>
<key>Enabled</key>
<true/>
<false/><!--USBmap-->
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
Expand Down Expand Up @@ -625,7 +625,7 @@
<key>EnablePassword</key>
<false/>
<key>ExposeSensitiveData</key>
<integer>6</integer>
<integer>15</integer>
<key>HaltLevel</key>
<integer>2147483648</integer>
<key>PasswordHash</key>
Expand Down
4 changes: 2 additions & 2 deletions payloads/Config/v0.6.4/config.plist
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
<key>Comment</key>
<string>USB Map</string>
<key>Enabled</key>
<true/>
<false/><!--USBmap-->
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
Expand Down Expand Up @@ -629,7 +629,7 @@
<key>EnablePassword</key>
<false/>
<key>ExposeSensitiveData</key>
<integer>6</integer>
<integer>15</integer>
<key>HaltLevel</key>
<integer>2147483648</integer>
<key>PasswordHash</key>
Expand Down

0 comments on commit b25fa91

Please sign in to comment.