From 9b5d25b2be1f6f8f25a7c4deca11a993ab40d65c Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 24 Dec 2021 09:20:47 -0700 Subject: [PATCH 1/2] build.py: Resolve check_firewire() bug Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/842 --- resources/build.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/build.py b/resources/build.py index 2389a8f34..019cb4512 100644 --- a/resources/build.py +++ b/resources/build.py @@ -481,11 +481,13 @@ class BuildOpenCore: def check_firewire(model): # MacBooks never supported FireWire # Pre-Thunderbolt MacBook Airs as well - if model.startswith("MacBook"): - return False + if model.startswith("MacBookPro"): + return True elif model.startswith("MacBookAir"): if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.sandy_bridge.value: return False + elif model.startswith("MacBook"): + return False else: return True From 5ff1110e903a1c078a54542083124690dfd55bca Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Fri, 24 Dec 2021 09:37:09 -0700 Subject: [PATCH 2/2] Add NVRAM WriteFlash setting for degarded systems Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/831 --- CHANGELOG.md | 1 + resources/build.py | 3 +++ resources/cli_menu.py | 25 +++++++++++++++++++++++++ resources/constants.py | 5 +++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2816f234e..17bf60cea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Resolves `installer` failing to extract InstallAssistant in older OSes - Resolves certain Samsung NVMe drives appearing as external on Mac Pros - Add FeatureUnlock configurability +- Add NVRAM WriteFlash configurability for degarded/fragile systems ## 0.3.3 - Disable Asset Caching support with spoofless approach diff --git a/resources/build.py b/resources/build.py index 019cb4512..60288f35f 100644 --- a/resources/build.py +++ b/resources/build.py @@ -899,6 +899,9 @@ class BuildOpenCore: if self.constants.disable_connectdrivers is True: print("- Disabling ConnectDrivers") self.config["UEFI"]["ConnectDrivers"] = False + if self.constants.nvram_write is False: + print("- Disabling Hardware NVRAM Write") + self.config["NVRAM"]["WriteFlash"] = 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") diff --git a/resources/cli_menu.py b/resources/cli_menu.py index 03a7bd1fd..156c5168a 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -866,6 +866,30 @@ Supported Options: else: print("Invalid input, returning to previous menu") self.set_fu_settings() + + def set_nvram_write(self): + utilities.cls() + utilities.header(["Set NVRAM Write"]) + print( + """ +By default, OpenCore will write NVRAM variables to flash. This is +recommended for majority of systems however for extremely degraded +or fragile systems, you may wish to disable this. + +Supported Options: + +1. Enable NVRAM Write +2. Disable NVRAM Write + """ + ) + change_menu = input("Set NVRAM Write (ie. 1): ") + if change_menu == "1": + self.constants.nvram_write = True + elif change_menu == "2": + self.constants.nvram_write = False + else: + print("Invalid input, returning to previous menu") + self.set_nvram_write() def credits(self): utilities.TUIOnlyPrint( @@ -1089,6 +1113,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier' [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 FeatureUnlock: \tCurrently {self.constants.fu_status}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_fu_settings], + [f"Set NVRAM Write:\t\tCurrently {self.constants.nvram_write}", MenuOptions(self.constants.custom_model or self.constants.computer.real_model, self.constants).set_nvram_write], ] for option in options: diff --git a/resources/constants.py b/resources/constants.py index bf17f1d29..a0405dd23 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -106,8 +106,9 @@ class Constants: ## OpenCore Settings self.opencore_debug = False self.opencore_build = "RELEASE" - self.showpicker = True # Show or Hide OpenCore's Boot Picker - self.boot_efi = False # Use EFI/BOOT/BOOTx64.efi bootstrap + self.showpicker = True # Show or Hide OpenCore's Boot Picker + self.boot_efi = False # Use EFI/BOOT/BOOTx64.efi bootstrap + self.nvram_write = True # Write to hardware NVRAM ## Kext Settings self.kext_debug = False # Enables Lilu debug and DebugEnhancer