mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 22:00:00 +10:00
build: Add APFS Trim configuration
This commit is contained in:
@@ -43,6 +43,8 @@
|
|||||||
- Implemented via:
|
- Implemented via:
|
||||||
- Userspace: [RSRRepair](https://github.com/flagersgit/RSRRepair) at `/etc/rc.server` (2b1c9e3)
|
- Userspace: [RSRRepair](https://github.com/flagersgit/RSRRepair) at `/etc/rc.server` (2b1c9e3)
|
||||||
- Kernelspace: [RSRHelper.kext](https://github.com/khronokernel/RSRHelper) (cbe1be9)
|
- Kernelspace: [RSRHelper.kext](https://github.com/khronokernel/RSRHelper) (cbe1be9)
|
||||||
|
- Add APFS Trim Configuration
|
||||||
|
- Settings -> Misc Settings -> APFS Trim
|
||||||
- Increment Binaries:
|
- Increment Binaries:
|
||||||
- OpenCorePkg 0.8.8 - release
|
- OpenCorePkg 0.8.8 - release
|
||||||
- PatcherSupportPkg 0.8.0 - release
|
- PatcherSupportPkg 0.8.0 - release
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class build_storage:
|
|||||||
self.pata_handling()
|
self.pata_handling()
|
||||||
self.misc_handling()
|
self.misc_handling()
|
||||||
self.pcie_handling()
|
self.pcie_handling()
|
||||||
|
self.trim_handling()
|
||||||
|
|
||||||
def ahci_handling(self):
|
def ahci_handling(self):
|
||||||
# MacBookAir6,x ship with an AHCI over PCIe SSD model 'APPLE SSD TS0128F' and 'APPLE SSD TS0256F'
|
# MacBookAir6,x ship with an AHCI over PCIe SSD model 'APPLE SSD TS0128F' and 'APPLE SSD TS0256F'
|
||||||
@@ -127,3 +128,9 @@ class build_storage:
|
|||||||
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
|
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] <= cpu_data.cpu_data.sandy_bridge.value:
|
||||||
if (self.constants.computer.sdxc_controller and not self.constants.custom_model) or (self.model.startswith("MacBookPro8") or self.model.startswith("Macmini5")):
|
if (self.constants.computer.sdxc_controller and not self.constants.custom_model) or (self.model.startswith("MacBookPro8") or self.model.startswith("Macmini5")):
|
||||||
support.build_support(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path)
|
support.build_support(self.model, self.constants, self.config).enable_kext("BigSurSDXC.kext", self.constants.bigsursdxc_version, self.constants.bigsursdxc_path)
|
||||||
|
|
||||||
|
|
||||||
|
def trim_handling(self):
|
||||||
|
if self.constants.apfs_trim_timeout is False:
|
||||||
|
print(f"- Disabling APFS TRIM timeout")
|
||||||
|
self.config["Kernel"]["Quirks"]["SetApfsTrimTimeout"] = 0
|
||||||
@@ -212,6 +212,7 @@ class Constants:
|
|||||||
self.commit_info = (None, None, None)
|
self.commit_info = (None, None, None)
|
||||||
self.set_vmm_cpuid = False # Set VMM bit inside CPUID
|
self.set_vmm_cpuid = False # Set VMM bit inside CPUID
|
||||||
self.oc_timeout = 5 # Set OpenCore timeout
|
self.oc_timeout = 5 # Set OpenCore timeout
|
||||||
|
self.apfs_trim_timeout = True # Set APFS Trim timeout
|
||||||
|
|
||||||
self.legacy_accel_support = [
|
self.legacy_accel_support = [
|
||||||
os_data.os_data.big_sur,
|
os_data.os_data.big_sur,
|
||||||
|
|||||||
@@ -2862,6 +2862,14 @@ class wx_python_gui:
|
|||||||
print("Wake on WLAN Disabled")
|
print("Wake on WLAN Disabled")
|
||||||
self.constants.enable_wake_on_wlan = False
|
self.constants.enable_wake_on_wlan = False
|
||||||
|
|
||||||
|
def apfs_trim_click(self, event=None):
|
||||||
|
if self.apfs_trim_checkbox.GetValue():
|
||||||
|
print("APFS Trim Enabled")
|
||||||
|
self.constants.apfs_trim_timeout = True
|
||||||
|
else:
|
||||||
|
print("APFS Trim Disabled")
|
||||||
|
self.constants.apfs_trim_timeout = False
|
||||||
|
|
||||||
def content_caching_click(self, event=None):
|
def content_caching_click(self, event=None):
|
||||||
if self.content_caching_checkbox.GetValue():
|
if self.content_caching_checkbox.GetValue():
|
||||||
print("Content Caching Enabled")
|
print("Content Caching Enabled")
|
||||||
@@ -3550,12 +3558,19 @@ OpenCore Legacy Patcher by default knows the most ideal
|
|||||||
self.content_caching_checkbox.SetPosition(wx.Point(self.wake_on_wlan_checkbox.GetPosition().x, self.wake_on_wlan_checkbox.GetPosition().y + self.wake_on_wlan_checkbox.GetSize().height))
|
self.content_caching_checkbox.SetPosition(wx.Point(self.wake_on_wlan_checkbox.GetPosition().x, self.wake_on_wlan_checkbox.GetPosition().y + self.wake_on_wlan_checkbox.GetSize().height))
|
||||||
self.content_caching_checkbox.SetToolTip(wx.ToolTip("Enables content caching support in macOS"))
|
self.content_caching_checkbox.SetToolTip(wx.ToolTip("Enables content caching support in macOS"))
|
||||||
|
|
||||||
|
# APFS Trim
|
||||||
|
self.apfs_trim_checkbox = wx.CheckBox(self.frame_modal, label="APFS Trim")
|
||||||
|
self.apfs_trim_checkbox.SetValue(self.constants.apfs_trim_timeout)
|
||||||
|
self.apfs_trim_checkbox.Bind(wx.EVT_CHECKBOX, self.apfs_trim_click)
|
||||||
|
self.apfs_trim_checkbox.SetPosition(wx.Point(self.content_caching_checkbox.GetPosition().x, self.content_caching_checkbox.GetPosition().y + self.content_caching_checkbox.GetSize().height))
|
||||||
|
self.apfs_trim_checkbox.SetToolTip(wx.ToolTip("Enables APFS Trim support in macOS"))
|
||||||
|
|
||||||
# Button: return to main menu
|
# Button: return to main menu
|
||||||
self.return_to_main_menu_button = wx.Button(self.frame_modal, label="Return to Settings")
|
self.return_to_main_menu_button = wx.Button(self.frame_modal, label="Return to Settings")
|
||||||
self.return_to_main_menu_button.Bind(wx.EVT_BUTTON, self.settings_menu)
|
self.return_to_main_menu_button.Bind(wx.EVT_BUTTON, self.settings_menu)
|
||||||
self.return_to_main_menu_button.SetPosition(wx.Point(
|
self.return_to_main_menu_button.SetPosition(wx.Point(
|
||||||
self.content_caching_checkbox.GetPosition().x,
|
self.apfs_trim_checkbox.GetPosition().x,
|
||||||
self.content_caching_checkbox.GetPosition().y + self.content_caching_checkbox.GetSize().height + 10))
|
self.apfs_trim_checkbox.GetPosition().y + self.apfs_trim_checkbox.GetSize().height + 10))
|
||||||
self.return_to_main_menu_button.Center(wx.HORIZONTAL)
|
self.return_to_main_menu_button.Center(wx.HORIZONTAL)
|
||||||
|
|
||||||
# set frame_modal size below return to main menu button
|
# set frame_modal size below return to main menu button
|
||||||
|
|||||||
Reference in New Issue
Block a user