From 2ca02f5802e0c1716e19e628250bb0d2537b4f7a Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 24 Jan 2022 20:35:47 -0700 Subject: [PATCH] Limit Content Caching to Desktops by default --- resources/build.py | 2 +- resources/constants.py | 1 + resources/defaults.py | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/build.py b/resources/build.py index edc21e1ba..11b844418 100644 --- a/resources/build.py +++ b/resources/build.py @@ -902,7 +902,7 @@ class BuildOpenCore: 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: + if self.get_item_by_kv(self.config["Kernel"]["Patch"], "Comment", "Reroute kern.hv_vmm_present patch (1)")["Enabled"] is True and self.constants.set_content_caching is True: # Add Content Caching patch print("- Fixing Content Caching support") if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False: diff --git a/resources/constants.py b/resources/constants.py index ef01496a7..fc6248c41 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -182,6 +182,7 @@ class Constants: self.walkthrough = False # Enable Walkthrough self.disable_connectdrivers = False # Disable ConnectDrivers (hibernation) self.allow_3rd_party_drives = True # Allow ThridPartyDrives quirk + self.set_content_caching = False # Set Content Caching self.legacy_accel_support = [ os_data.os_data.mojave, diff --git a/resources/defaults.py b/resources/defaults.py index ffc3385e1..6f1e186b9 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -84,6 +84,11 @@ class generate_defaults: settings.secure_status = False # Modified root volume settings.allow_fv_root = True # Allow FileVault on broken seal # settings.amfi_status = True # Signed bundles, Don't need to explicitly set currently + + if "Book" in model: + settings.set_content_caching = False + else: + settings.set_content_caching = True custom_cpu_model_value = utilities.get_nvram("revcpuname", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=True) if custom_cpu_model_value is not None: