Add FeatureUnlock configurability

This commit is contained in:
Mykola Grymalyuk
2021-12-21 18:12:11 -07:00
parent 7e29758fea
commit 118853cd46
5 changed files with 56 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
- Resolves Install USB Creation using incorrect installer - Resolves Install USB Creation using incorrect installer
- Resolves `installer` failing to extract InstallAssistant in older OSes - Resolves `installer` failing to extract InstallAssistant in older OSes
- Resolves certain Samsung NVMe drives appearing as external on Mac Pros - Resolves certain Samsung NVMe drives appearing as external on Mac Pros
- Add FeatureUnlock configurability
## 0.3.3 ## 0.3.3
- Disable Asset Caching support with spoofless approach - Disable Asset Caching support with spoofless approach

BIN
payloads/Tools/OCLP-Helper Executable file

Binary file not shown.

View File

@@ -139,12 +139,6 @@ class BuildOpenCore:
# IDE patch # IDE patch
("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: "PATA" in smbios_data.smbios_dictionary[self.model]["Stock Storage"]), ("AppleIntelPIIXATA.kext", self.constants.piixata_version, self.constants.piixata_path, lambda: "PATA" in smbios_data.smbios_dictionary[self.model]["Stock Storage"]),
# Misc # Misc
(
"FeatureUnlock.kext",
self.constants.featureunlock_version,
self.constants.featureunlock_path,
lambda: smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake.value,
),
("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True), ("DebugEnhancer.kext", self.constants.debugenhancer_version, self.constants.debugenhancer_path, lambda: self.constants.kext_debug is True),
("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path, lambda: self.model in ["MacBook4,1", "MacBook5,2"]), ("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path, lambda: self.model in ["MacBook4,1", "MacBook5,2"]),
]: ]:
@@ -175,6 +169,14 @@ class BuildOpenCore:
# Required for Lilu in 11.0+ # Required for Lilu in 11.0+
self.config["Kernel"]["Quirks"]["DisableLinkeditJettison"] = True self.config["Kernel"]["Quirks"]["DisableLinkeditJettison"] = True
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.kaby_lake.value:
if self.constants.fu_status is True:
# Enable FeatureUnlock.kext
self.enable_kext("FeatureUnlock.kext", self.constants.featureunlock_version, self.constants.featureunlock_path)
if self.constants.fu_arguments is not None:
print(f"- Adding additional FeatureUnlock args: {self.constants.fu_arguments}")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += self.constants.fu_arguments
if self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1", "MacBookPro10,1"]: if self.model in ["MacBookPro6,1", "MacBookPro6,2", "MacBookPro9,1", "MacBookPro10,1"]:
# Modded RestrictEvents with displaypolicyd blocked to fix dGPU switching # Modded RestrictEvents with displaypolicyd blocked to fix dGPU switching
self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_mbp_version, self.constants.restrictevents_mbp_path) self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_mbp_version, self.constants.restrictevents_mbp_path)

View File

@@ -831,7 +831,41 @@ To disable SIP outright, set it to 0xFEF
except ValueError: except ValueError:
print("Invalid input, returning to previous menu") print("Invalid input, returning to previous menu")
self.set_custom_sip_value() self.set_custom_sip_value()
def set_fu_settings(self):
utilities.cls()
utilities.header(["Set FeatureUnlock Settings"])
print(
"""
By default OCLP will add a kext called FeatureUnlock to enable
features locked out from older models. Including:
- AirPlay to Mac
- SideCar
- Night Shift
However for systems experiencing memory instability, disabling this
kext can help.
Supported Options:
1. Enable FeatureUnlock and all patches
2. Enable FeatureUnlock and disable AirPlay to Mac and SideCar
3. Disable FeatureUnlock
"""
)
change_menu = input("Set FeatreUnlock (ie. 1): ")
if change_menu == "1":
self.constants.fu_status = True
self.constants.fu_arguments = ""
elif change_menu == "2":
self.constants.fu_status = True
self.constants.fu_arguments = " -disable_sidecar_mac"
elif change_menu == "3":
self.constants.fu_status = False
else:
print("Invalid input, returning to previous menu")
self.set_fu_settings()
def credits(self): def credits(self):
utilities.TUIOnlyPrint( utilities.TUIOnlyPrint(
@@ -1054,7 +1088,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
[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"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"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], [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],
[f"Set FeatureUnlock: \tCurrently {self.constants.fu_status}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_fu_settings],
] ]
for option in options: for option in options:

View File

@@ -120,6 +120,10 @@ class Constants:
self.serial_settings = "None" # Set SMBIOS level used self.serial_settings = "None" # Set SMBIOS level used
self.override_smbios = "Default" # Set SMBIOS model used self.override_smbios = "Default" # Set SMBIOS model used
## FeatureUnlock Settings
self.fu_status = True # Enable FeatureUnlock
self.fu_arguments = "" # Set FeatureUnlock arguments
## Latebloom Settings ## Latebloom Settings
self.latebloom_status = False # Latebloom Enabled self.latebloom_status = False # Latebloom Enabled
self.latebloom_delay = 0 # Delay between each PCIe Probe self.latebloom_delay = 0 # Delay between each PCIe Probe
@@ -224,6 +228,10 @@ class Constants:
@property @property
def list_txt_path(self): def list_txt_path(self):
return self.payload_path / Path("List.txt") return self.payload_path / Path("List.txt")
@property
def installer_sh_path(self):
return self.payload_path / Path("Installer.sh")
# Kexts # Kexts
@property @property
@@ -479,6 +487,10 @@ class Constants:
@property @property
def ocvalidate_path(self): def ocvalidate_path(self):
return self.payload_path / Path(f"Tools/ocvalidate-{self.opencore_version}") return self.payload_path / Path(f"Tools/ocvalidate-{self.opencore_version}")
@property
def oclp_helper_path(self):
return self.payload_path / Path("Tools/OCLP-Helper")
# Icons # Icons
@property @property