Skip to content

Fix kexts to block#12

Closed
YBronst wants to merge 6 commits intomasterfrom
fix-kexts-to-block
Closed

Fix kexts to block#12
YBronst wants to merge 6 commits intomasterfrom
fix-kexts-to-block

Conversation

@YBronst
Copy link
Owner

@YBronst YBronst commented Feb 7, 2026

Description

  • Removed BlockSkywalk support and UI field and added a new KextsToBlock plist array example to config-sample.plist with the requested fields (Comment, Disabled, MatchOS, Name).
  • Added KernelAndKextPatches_KextsToBlock_Class to the XML config schema and integrated KextsToBlock into the config parser so entries are validated and accessible via the settings model.
  • Introduced KEXT_TO_BLOCK model with takeValueFrom(...) and a ShouldBlock(const MacOsVersion&) method implementing the Disabled/MatchOS/Name logic and case-insensitive all handling.
  • Replaced the old hardcoded OpenCore Kernel.Block generation for BlockSkywalk with a loop that builds Kernel.Block entries from all KextsToBlock entries that return true from ShouldBlock, preserving safety for absent or empty arrays and avoiding crashes.
  • Moved FilterKextsToBlock() call in LOADER_ENTRY::StartLoader() to an earlier point. It must be called before the OpenCore integration block that populates mOpenCoreConfiguration.Kernel.Block, otherwise it builds the OC config using stale values.

Type of change

  • Bugfix
  • New functionality
  • Code improvements
  • Documentation update

Checklist

  • Tested my changes locally
  • Added relevant comments to the code
  • Updated the relevant documentation

Additional information

Motivation

  • Remove the obsolete single-flag BlockSkywalk and provide a flexible KextsToBlock array that can list zero-or-more kexts to block with per-entry MatchOS and Disabled semantics.
  • Allow blocking behavior to be conditional on macOS version(s) and support multiple entries without hardcoding any kext identifiers.

Testing

  • Tested that Clover builds and boots with the proposed changes, and both the config and the menu ways to specify KextsToBlock work, providing identical capabilities to block kexts to what OpenCore is capable of. Does not provide ability to block nested kexts included as plugins (WiP to fix later, OpenCore cannot do this either).

YBronst and others added 6 commits February 5, 2026 19:35
…nd-add-kextstoblock

Replace legacy BlockSkywalk with KextsToBlock array and implement blocking logic
Modified KEXT_TO_BLOCK::ShouldBlock to rely solely on MenuItem.BValue.
Previously, if a kext block entry was marked as Disabled in the
configuration file, it could not be re-enabled via the GUI because
ShouldBlock would return false immediately. Now, MenuItem.BValue acts
as the master switch, which is initialized from the config's Disabled
state but can be overridden by the user in the Options menu.
This commit fixes two issues preventing the KextsToBlock GUI from working:
1. Logic: KEXT_TO_BLOCK::ShouldBlock now relies only on MenuItem.BValue.
   Previously it also checked the Disabled flag from config.plist,
   which prevented re-enabling a kext that was initially disabled.
2. Timing: Moved FilterKextsToBlock() call in LOADER_ENTRY::StartLoader()
   to an earlier point. It must be called before the OpenCore integration
   block that populates mOpenCoreConfiguration.Kernel.Block, otherwise
   it builds the OC config using stale values.
@YBronst YBronst marked this pull request as ready for review February 7, 2026 16:18
@YBronst YBronst added the enhancement New feature or request label Feb 7, 2026
@YBronst YBronst deleted the branch master February 7, 2026 21:06
@YBronst YBronst closed this Feb 7, 2026
@YBronst YBronst deleted the fix-kexts-to-block branch February 7, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant