Allow disabling of ConnectDrivers

Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/742
This commit is contained in:
Mykola Grymalyuk
2021-11-17 12:22:57 -07:00
parent 9a4085ca50
commit 1486859d79
4 changed files with 52 additions and 13 deletions

View File

@@ -18,6 +18,8 @@
- Resolve rare memory corruption due to FeatureUnlock
- Raise SurPlus MaxKernel to 21.99.99
- Fix Content Caching with spoofless usage
- Allow disabling of ConnectDrivers
- Aid with Hibernation on MacBookPro9,1/MacBookPro10,1
## 0.3.1
- Increment Binaries:

View File

@@ -796,6 +796,9 @@ class BuildOpenCore:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.nehalem.value:
# Nehalem and newer MacBooks force firmware throttling via MSR_POWER_CTL
self.enable_kext("SimpleMSR.kext", self.constants.simplemsr_version, self.constants.simplemsr_path)
if self.constants.disable_connectdrivers is True:
print("- Disabling ConnectDrivers")
self.config["UEFI"]["ConnectDrivers"] = False
if self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True:
# Add Content Caching patch
print("- Fixing Content Caching support")

View File

@@ -772,6 +772,37 @@ the event there's issues.
else:
self.set_surplus()
def set_hibernation_workaround(self):
utilities.cls()
utilities.header(["Set Hibernation Workaround"])
print(
"""
For users with Hibernation issues, you can flip this option to disable certain
OpenCore settings that may affect the stability of Hibernation. Namely
OpenCore's ConnectDrivers option.
Flipping this setting will disable automatic loading of additional drives in
OpenCore's boot menu other than what was booted.
Note: This option should only be flipped under the following circumstances:
- You are experincing wake failures from hibernation
- You are only using 1 disk in your system for booting (ie. no RAID)
- OpenCore is installed on the same disk as the OS
- Your system has an Intel iGPU and Nvidia dGPU
- You have no need to boot external media through OpenCore
"""
)
change_menu = input("Disable ConnectDrivers?(y/n/q): ")
if change_menu in {"y", "Y", "yes", "Yes"}:
self.constants.disable_connectdrivers = True
elif change_menu in {"n", "N", "no", "No"}:
self.constants.disable_connectdrivers = False
elif change_menu in {"q", "Q", "Quit", "quit"}:
print("Returning to previous menu")
else:
self.set_hibernation_workaround()
def set_custom_sip_value(self):
utilities.cls()
utilities.header(["Set Custom SIP Value"])
@@ -1013,8 +1044,10 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
f"Set Windows GMUX support:\tCurrently {self.constants.dGPU_switch}",
MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).dGPU_switch_support,
],
[f"Set Software Demux:\t\tCurrently {self.constants.software_demux}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_software_demux],
[f"Set Hibernation Workaround:\tCurrently {self.constants.disable_connectdrivers}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_hibernation_workaround],
[f"Disable Battery Throttling:\tCurrently {self.constants.disable_msr_power_ctl}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_battery_throttle],
[f"Set Software Demux:\tCurrently {self.constants.software_demux}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_software_demux],
]
for option in options:

View File

@@ -150,18 +150,19 @@ class Constants:
self.allow_ts2_accel = True # Set TeraScale 2 Acceleration support
## Miscellaneous
self.disallow_cpufriend = False # Disable CPUFriend
self.enable_wake_on_wlan = False # Allow Wake on WLAN for modern Broadcom
self.disable_tb = False # Disable Thunderbolt Controller
self.set_alc_usage = True # Set AppleALC usage
self.dGPU_switch = True # Set Display GPU Switching for Windows
self.force_surplus = False # Force SurPlus patch in newer OSes
self.force_latest_psp = False # Force latest PatcherSupportPkg
self.disable_msr_power_ctl = False # Disable MSR Power Control (missing battery throttling)
self.software_demux = False # Enable Software Demux patch set
self.force_vmm = False # Force VMM patch
self.custom_sip_value = None # Set custom SIP value
self.walkthrough = False # Enable Walkthrough
self.disallow_cpufriend = False # Disable CPUFriend
self.enable_wake_on_wlan = False # Allow Wake on WLAN for modern Broadcom
self.disable_tb = False # Disable Thunderbolt Controller
self.set_alc_usage = True # Set AppleALC usage
self.dGPU_switch = True # Set Display GPU Switching for Windows
self.force_surplus = False # Force SurPlus patch in newer OSes
self.force_latest_psp = False # Force latest PatcherSupportPkg
self.disable_msr_power_ctl = False # Disable MSR Power Control (missing battery throttling)
self.software_demux = False # Enable Software Demux patch set
self.force_vmm = False # Force VMM patch
self.custom_sip_value = None # Set custom SIP value
self.walkthrough = False # Enable Walkthrough
self.disable_connectdrivers = False # Disable ConnectDrivers (hibernation)
self.legacy_accel_support = [
os_data.os_data.mojave,