Skip to content

Disable repatching a dirty root volume - #1179

Merged
dhinakg merged 5 commits into
dortania:mainfrom
crystall1nedev:repatching-block
Dec 19, 2025
Merged

Disable repatching a dirty root volume#1179
dhinakg merged 5 commits into
dortania:mainfrom
crystall1nedev:repatching-block

Conversation

@crystall1nedev

@crystall1nedev crystall1nedev commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

Due to the complexity and variability of the patches included in OpenCore Legacy Patcher, we cannot "trust" that an already-patched install will not break with updated patches.

A good example of this is in the wireless branch (#1177). The new wireless patchset will break existing Sequoia installations if the user decides to repatch the system volume without first restoring it to a sealed state.

This PR implements a block on repatching over an existing installation when:

  • All patches available are installed already.
  • Any non-wireless patch from the current commit of OCLP is already installed.
  • Any patch from a different commit of OCLP is already installed.
  • The system volume has been tampered with in any other way.

This should allow users to repatch over an existing install in only one scenario: to enable wireless functionality in order to download the KDK or MetallibSupportPkg.

@crystall1nedev crystall1nedev changed the title Disable repatching an dirty root volume Disable repatching a dirty root volume Dec 15, 2025
First, we check for the existence of OpenCore-Legacy-Patcher.plist.

If the file does not exist, checking for "Broken" in the diskutil
output for the "Sealed" key on the root volume will help continue -
if it's broken, unpatching is required to continue.

If the file does exist, checking for "Commit URL" will help determine
if the current copy of OCLP was used to install any patches. Should
the patches be from a different commit, unpatching is required to
continue.

With the commit matching, we then check for any non-wireless patches
that are currently installed on the system. This allows for users to
continue patching wireless first and everything else later, while also
ensuring that repatching is blocked when all patches are installed.
This is already handled elsewhere.
@crystall1nedev

Copy link
Copy Markdown
Collaborator Author

All of these changes have been tested with local builds of OpenCore Legacy Patcher (these commits cherry-picked onto the tahoe-patchset branch with internal patches on MacBook9,1.)

I have verified that the functionality is present and works in these scenarios:

  • Patches plist does not exist and root volume is sealed
    • Offers to install Wireless patches
  • Patches plist does not exist and root volume is broken
    • Presents REPATCHING_NOT_SUPPORTED message
  • Patches plist exists, wireless patches installed, other patches not installed, commit is different
    • Presents REPATCHING_NOT_SUPPORTED message
  • Patches plist exists, wireless patches installed, other patches not installed, commit is same
    • Offers to install other patches
  • Patches plist exists, wireless patches installed, other patches installed, commit is different
    • Presents REPATCHING_NOT_SUPPORTED message
  • Patches plist exists, wireless patches installed, other patches installed, commit is same
    • Presents REPATCHING_NOT_SUPPORTED message

@crystall1nedev
crystall1nedev marked this pull request as ready for review December 16, 2025 01:09
@dhinakg
dhinakg merged commit 806d47f into dortania:main Dec 19, 2025
2 checks passed
@crystall1nedev
crystall1nedev deleted the repatching-block branch December 27, 2025 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants