Merge pull request #485 from dortania/filevault-test

Allow FileVault on Root Patched Macs
This commit is contained in:
Mykola Grymalyuk
2021-09-12 22:37:18 -06:00
committed by GitHub
10 changed files with 70 additions and 23 deletions
+2
View File
@@ -33,6 +33,8 @@
- TeraScale 2 acceleration to be added in the future - TeraScale 2 acceleration to be added in the future
- Allow Trackpad gestures on MacBook4,1 and MacBook5,2 - Allow Trackpad gestures on MacBook4,1 and MacBook5,2
- System Preferences will not report settings however - System Preferences will not report settings however
- Allow Root Volume Patched Systems to use FileVault 2
- Requires macOS 11.3 (20E232) or newer
## 0.2.4 ## 0.2.4
+5 -4
View File
@@ -213,18 +213,19 @@ If you plan to create the USB for another machine, please select the "Change Mod
# self.constants.secure_status = True # Monterey # self.constants.secure_status = True # Monterey
self.constants.amfi_status = True self.constants.amfi_status = True
elif host_is_target: elif host_is_target:
self.constants.sip_status = False # Unsigned kexts self.constants.sip_status = False # Unsigned kexts
self.constants.secure_status = False # Root volume modified self.constants.secure_status = False # Root volume modified
self.constants.amfi_status = False # Unsigned binaries self.constants.amfi_status = False # Unsigned binaries
if model in ModelArray.ModernGPU: if model in ModelArray.ModernGPU:
if host_is_target and model in ["iMac13,1", "iMac13,3"] and self.computer.dgpu: if host_is_target and model in ["iMac13,1", "iMac13,3"] and self.computer.dgpu:
# Some models have a supported dGPU, others don't # Some models have a supported dGPU, others don't
print("- Detected Metal dGPU, overriding default configuration") print("- Detected Metal dGPU, overriding default configuration")
self.constants.sip_status = True self.constants.sip_status = True
elif host_is_target: elif host_is_target:
self.constants.sip_status = False # Unsigned kexts self.constants.sip_status = False # Unsigned kexts
self.constants.secure_status = False # Modified root volume self.constants.secure_status = False # Modified root volume
# self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently self.constants.allow_fv_root = True # Allow FileVault on broken seal
# self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently
if model == "MacBook8,1" and host_is_target: if model == "MacBook8,1" and host_is_target:
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing # MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
self.constants.serial_settings == "Moderate" self.constants.serial_settings == "Moderate"
+10 -11
View File
@@ -44,19 +44,21 @@ class OpenCoreLegacyPatcher:
# self.constants.secure_status = True # Monterey # self.constants.secure_status = True # Monterey
self.constants.amfi_status = True self.constants.amfi_status = True
else: else:
self.constants.sip_status = False # Unsigned kexts self.constants.sip_status = False # Unsigned kexts
self.constants.secure_status = False # Root volume modified self.constants.secure_status = False # Root volume modified
self.constants.amfi_status = False # Unsigned binaries self.constants.amfi_status = False # Unsigned binaries
self.constants.allow_fv_root = True # Allow FileVault on broken seal
if model in ModelArray.ModernGPU: if model in ModelArray.ModernGPU:
if host_is_target and model in ["iMac13,1", "iMac13,3"] and self.computer.dgpu: if host_is_target and model in ["iMac13,1", "iMac13,3"] and self.computer.dgpu:
# Some models have a supported dGPU, others don't # Some models have a supported dGPU, others don't
self.constants.sip_status = True self.constants.sip_status = True
# self.constants.secure_status = True # Monterey # self.constants.secure_status = True # Monterey
# self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently # self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently
else: else:
self.constants.sip_status = False # Unsigned kexts self.constants.sip_status = False # Unsigned kexts
self.constants.secure_status = False # Modified root volume self.constants.secure_status = False # Modified root volume
# self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently self.constants.allow_fv_root = True # Allow FileVault on broken seal
# self.constants.amfi_status = True # Signed bundles, Don't need to explicitly set currently
if model == "MacBook8,1": if model == "MacBook8,1":
# MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing # MacBook8,1 has an odd bug where it cannot install Monterey with Minimal spoofing
self.constants.serial_settings = "Moderate" self.constants.serial_settings = "Moderate"
@@ -289,8 +291,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
WARNING: Root Volume Patching is still in active development, please WARNING: Root Volume Patching is still in active development, please
have all important user data backed up. Note when the system volume have all important user data backed up. Note when the system volume
is patched, you can no longer have Delta updates or have FileVault is patched, you can no longer have Delta updates.
enabled.
Supported Options: Supported Options:
@@ -312,8 +313,7 @@ B. Exit
WARNING: Root Volume Patching is still in active development, please WARNING: Root Volume Patching is still in active development, please
have all important user data backed up. Note when the system volume have all important user data backed up. Note when the system volume
is patched, you can no longer have Delta updates or have FileVault is patched, you can no longer have Delta updates.
enabled.
Supported Options: Supported Options:
@@ -331,8 +331,7 @@ B. Exit
WARNING: Root Volume Patching is still in active development, please WARNING: Root Volume Patching is still in active development, please
have all important user data backed up. Note when the system volume have all important user data backed up. Note when the system volume
is patched, you can no longer have Delta updates or have FileVault is patched, you can no longer have Delta updates.
enabled.
Supported Options: Supported Options:
+7
View File
@@ -686,6 +686,13 @@ class BuildOpenCore:
if self.model in ModelArray.dGPU_switch: if self.model in ModelArray.dGPU_switch:
print("- Allowing GMUX switching in Windows") print("- Allowing GMUX switching in Windows")
self.config["Booter"]["Quirks"]["SignalAppleOS"] = True self.config["Booter"]["Quirks"]["SignalAppleOS"] = True
if self.constants.allow_fv_root is True:
# apfs.kext has an undocumented boot-arg that allows FileVault usage on broken APFS seals (-arv_allow_fv)
# This is however hidden behind kern.development, thus we patch _apfs_filevault_allowed to always return true
# Note this function was added in 11.3 (20E232, 20.4), older builds do not support this (ie. 11.2.3)
print("- Allowing FileVault on Root Patched systems")
self.get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.filesystems.apfs")["Enabled"] = True
def set_smbios(self): def set_smbios(self):
spoofed_model = self.model spoofed_model = self.model
+2 -2
View File
@@ -481,7 +481,7 @@ For iMac13,x systems with a Nvidia dGPU, the iGPU is disabled by default to
allow Delta Updates, FileVault, SIP and such on macOS Monterey. However due to allow Delta Updates, FileVault, SIP and such on macOS Monterey. However due to
this, DRM and QuickSync support may be broken. this, DRM and QuickSync support may be broken.
Users can choose to override this option but be aware SIP and FileVault must be Users can choose to override this option but be aware SIP must be
disabled to run root patches to fix DRM and QuickSync. disabled to run root patches to fix DRM and QuickSync.
Note: This does not apply for Big Sur, the iGPU can be renabled without Note: This does not apply for Big Sur, the iGPU can be renabled without
@@ -556,7 +556,7 @@ patches in Mojave and Catalina.
The main goal of this is to allow developers to better test patch sets as well The main goal of this is to allow developers to better test patch sets as well
as allow acceleration on TeraScale 2 machines. Not all features may be available as allow acceleration on TeraScale 2 machines. Not all features may be available
(ie. GPU switching may not work, FileVault is not supported, etc) (ie. GPU switching may not work, etc)
Note: for the average user, we recommend using dosdude1's legacy patcher: Note: for the average user, we recommend using dosdude1's legacy patcher:
+1
View File
@@ -118,6 +118,7 @@ class Constants:
self.os_support = 12.0 self.os_support = 12.0
self.detected_os = 0 # Major Kernel Version self.detected_os = 0 # Major Kernel Version
self.detected_os_minor = 0 # Minor Kernel Version self.detected_os_minor = 0 # Minor Kernel Version
self.allow_fv_root = False # Allow FileVault on broken sealed snapshots
## Boot Volume Settings ## Boot Volume Settings
self.firewire_boot = False # Allow macOS FireWire Boot self.firewire_boot = False # Allow macOS FireWire Boot
+11 -4
View File
@@ -135,13 +135,19 @@ def amfi_status():
return False return False
return True return True
def check_oclp_boot():
if get_nvram("OCLP-Version", "4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102", decode=False):
return True
else:
return False
def patching_status(os_sip, os): def patching_status(os_sip, os):
# Detection for Root Patching # Detection for Root Patching
sip_enabled = True # System Integrity Protection sip_enabled = True # System Integrity Protection
sbm_enabled = True # Secure Boot Status (SecureBootModel) sbm_enabled = True # Secure Boot Status (SecureBootModel)
amfi_enabled = True # Apple Mobile File Integrity amfi_enabled = True # Apple Mobile File Integrity
fv_enabled = True # FileVault fv_enabled = True # FileVault
dosdude_patched = True dosdude_patched = True
gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext" gen6_kext = "/System/Library/Extension/AppleIntelHDGraphics.kext"
@@ -155,7 +161,8 @@ def patching_status(os_sip, os):
if get_nvram("csr-active-config", decode=False) and csr_decode(get_nvram("csr-active-config", decode=False), os_sip) is False: if get_nvram("csr-active-config", decode=False) and csr_decode(get_nvram("csr-active-config", decode=False), os_sip) is False:
sip_enabled = False sip_enabled = False
if os > Constants.Constants().catalina: if os > Constants.Constants().catalina and not check_oclp_boot():
# Assume non-OCLP Macs do not have our APFS seal patch
fv_status: str = subprocess.run("fdesetup status".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode() fv_status: str = subprocess.run("fdesetup status".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
if "FileVault is Off" in fv_status: if "FileVault is Off" in fv_status:
fv_enabled = False fv_enabled = False
+1 -1
View File
@@ -7,7 +7,7 @@ With OpenCore Legacy Patcher we recommend users go through the below table to un
| Features | [OpenCore Legacy Patcher](https://github.com/dortania/OpenCore-Legacy-Patcher/) | [Patched Sur](https://github.com/BenSova/Patched-Sur) | | Features | [OpenCore Legacy Patcher](https://github.com/dortania/OpenCore-Legacy-Patcher/) | [Patched Sur](https://github.com/BenSova/Patched-Sur) |
| :--- | :--- | :--- | | :--- | :--- | :--- |
| Over The Air Updates | <span style="color:#30BCD5">Native System Preferences, additionally supports Deltas (~2GB) for Metal GPUs</span> | <span style="color:red">Inside Patcher Sur app (~12GB), only available when InstallAssistants release.</span> InstallAssistants generally available same day as System Preference updates, however developer betas will lag behind by 1 day compared to OTAs | | Over The Air Updates | <span style="color:#30BCD5">Native System Preferences, additionally supports Deltas (~2GB) for Metal GPUs</span> | <span style="color:red">Inside Patcher Sur app (~12GB), only available when InstallAssistants release.</span> InstallAssistants generally available same day as System Preference updates, however developer betas will lag behind by 1 day compared to OTAs |
| FileVault | <span style="color:#30BCD5">Supported on Metal GPUs</span> | <span style="color:red">Not supported</span> | | FileVault | <span style="color:#30BCD5">Fully supported on all machines</span> | <span style="color:red">Not supported</span> |
| System Integrity Protection | <span style="color:#30BCD5">Fully enabled on Metal GPUs</span> | <span style="color:red">Disabled for early 2013 and older during the patching process and first boot afterwards, otherwise enabled</span> | | System Integrity Protection | <span style="color:#30BCD5">Fully enabled on Metal GPUs</span> | <span style="color:red">Disabled for early 2013 and older during the patching process and first boot afterwards, otherwise enabled</span> |
| APFS Snapshots | <span style="color:#30BCD5">Fully enabled</span> | <span style="color:red">Disabled</span> | | APFS Snapshots | <span style="color:#30BCD5">Fully enabled</span> | <span style="color:red">Disabled</span> |
| User facing | <span style="color:red">TUI interface</span> | <span style="color:#30BCD5">SwiftUI interface, more user friendly</span> | | User facing | <span style="color:red">TUI interface</span> | <span style="color:#30BCD5">SwiftUI interface, more user friendly</span> |
+1 -1
View File
@@ -47,7 +47,7 @@ Below is a list of hardware that currently has issues with Monterey:
* Intel HD4000 iGPUs lost support * Intel HD4000 iGPUs lost support
* Re-introduced with OpenCore Legacy Patcher v0.1.7 * Re-introduced with OpenCore Legacy Patcher v0.1.7
By default these machines require root volume patches to gain graphics acceleration in Monterey. OpenCore Legacy Patcher supports readding support however SIP and FileVault can no longer be enabled due to root patching: By default these machines require root volume patches to gain graphics acceleration in Monterey. OpenCore Legacy Patcher supports readding support however SIP can no longer be enabled due to root patching:
* Macmini6,x * Macmini6,x
* MacBookAir5,x * MacBookAir5,x
+30
View File
@@ -1032,6 +1032,36 @@
<key>Skip</key> <key>Skip</key>
<integer>0</integer> <integer>0</integer>
</dict> </dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>Base</key>
<string>_apfs_filevault_allowed</string>
<key>Comment</key>
<string>Force FileVault on Broken Seal</string>
<key>Count</key>
<integer>0</integer>
<key>Enabled</key>
<false/>
<key>Find</key>
<data></data>
<key>Identifier</key>
<string>com.apple.filesystems.apfs</string>
<key>Limit</key>
<integer>0</integer>
<key>Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>20.4.0</string>
<key>Replace</key>
<data>uAEAAADD</data>
<key>ReplaceMask</key>
<data></data>
<key>Skip</key>
<integer>0</integer>
</dict>
</array> </array>
<key>Quirks</key> <key>Quirks</key>
<dict> <dict>