Configuration: Monterey - axivo/opencore GitHub Wiki

This wiki page will detail the required steps to generate a basic OpenCore tree and configuration for macOS Monterey operating system.

Configuration Setup

In the learning example listed below, we will create a setup file which implements the following customizations:

  • OpenCanopy implementation on a black boot screen
  • Pulse RX580 GPU hardware acceleration support, through Mac Pro hybridization (system specific device path)
  • NVMe external disks displayed as internal disks (system specific device path)
  • Night Shift enabled with FeatureUnlock Lilu plugin

The following components will be installed:

Clone Repo

See the global definition, for usage.

To clone the repository with Python 2 support (macOS Monterey 12.2.1 or earlier), run:

~$ git clone -b 1.2.6 --depth 1 https://github.com/axivo/opencore.git

To clone the repository with Python 3 support (macOS Monterey 12.3 or newer), run:

~$ git clone https://github.com/axivo/opencore.git

Create a working branch for your new setup:

~$ cd opencore
~$ git branch build/monterey
~$ git checkout build/monterey

File setup.py

See the global definition, for usage.

Start by editing the setup.py file into repo root:

Visual Studio Code

OpenCore 0.8.5 code example (for latest changes, see opencore/examples directory):

#!/usr/bin/env python3

from opencore.build import OpenCoreBuild


if __name__ == '__main__':
    build = OpenCoreBuild('Volumes/EFI')
    build.kexts = [
        {
            'project': 'ASPP-Override',
            'properties': {
                'ExecutablePath': '',
                'MinKernel': '21.4.0'
            },
            'repo': 'dortania',
            'version': '1.0.1'
        },
        {
            'project': 'Lilu',
            'repo': 'acidanthera',
            'version': '1.6.2'
        },
        {
            'project': 'FeatureUnlock',
            'repo': 'acidanthera',
            'version': '1.0.9'
        },
        {
            'project': 'WhateverGreen',
            'repo': 'acidanthera',
            'version': '1.6.1'
        }
    ]
    build.write_tree()

    settings = {
        'DeviceProperties': {
            'Add': {
                'PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)': {
                    'rebuild-device-tree': 0,
                    'unfairgva': 1
                },
                'PciRoot(0x0)/Pci(0x7,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)': {
                    'built-in': build.unhexlify('00')
                },
                'PciRoot(0x0)/Pci(0x7,0x0)/Pci(0x0,0x0)/Pci(0x8,0x0)/Pci(0x0,0x0)': {
                    'built-in': build.unhexlify('00')
                }
            }
        },
        'Kernel': {
            'Quirks': {
                'DisableLinkeditJettison': True,
                'SetApfsTrimTimeout': 0
            }
        },
        'Misc': {
            'Boot': {
                'HideAuxiliary': True,
                'LauncherOption': 'Full',
                'PollAppleHotKeys': True,
                'PickerMode': 'External',
                'PickerVariant': 'Default',
                'ShowPicker': True,
                'Timeout': 15
            },
            'Security': {
                'AllowSetDefault': True,
                'BlacklistAppleUpdate': True,
                'ExposeSensitiveData': 3,
                'ScanPolicy': 0,
                'Vault': 'Optional'
            }
        },
        'PlatformInfo': {
            'PlatformNVRAM': {
                'FirmwareFeatures': build.unhexlify('03 54 0C C0 08 00 00 00'),
                'FirmwareFeaturesMask': build.unhexlify('3F FF 1F FF 08 00 00 00')
            },
            'SMBIOS': {
                'BoardProduct': 'Mac-27AD2F918AE68F61'
            },
            'UpdateNVRAM': True,
            'UpdateSMBIOS': True
        },
        'UEFI': {
            'AppleInput': {
                'AppleEvent': 'Builtin'
            },
            'ConnectDrivers': True,
            'Drivers': [
                {
                    'Arguments': '',
                    'Comment': '',
                    'Enabled': True,
                    'LoadEarly': False,
                    'Path': 'OpenCanopy.efi'
                },
                {
                    'Arguments': '',
                    'Comment': '',
                    'Enabled': True,
                    'LoadEarly': False,
                    'Path': 'OpenRuntime.efi'
                }
            ],
            'Output': {
                'ProvideConsoleGop': True,
                'Resolution': 'Max'
            },
            'ProtocolOverrides': {
                'AppleUserInterfaceTheme': True
            },
            'Quirks': {
                'RequestBootVarRouting': True
            }
        }
    }
    build.write_plist(settings)
    build.run_misc_tasks()

Variable build.kexts

See the global definition, for usage.

For Monterey version 12.3+, the ASPP-Override kext is required:

    build.kexts = [
        {
            'project': 'ASPP-Override',
            'properties': {
                'ExecutablePath': '',
                'MinKernel': '21.4.0'
            },
            'repo': 'dortania',
            'version': '1.0.1'
        }
    ]
    build.write_tree()

For Monterey version 12.4+ zlib related kernel panics, add the optional NoAVXFSCompressionTypeZlib kext:

    build.kexts = [
        {
            'project': 'NoAVXFSCompressionTypeZlib',
            'properties': {
                'MinKernel': '21.5.0'
            },
            'repo': 'dortania',
            'version': '12.3.1'
        }
    ]
    build.write_tree()

Variable build.patches

See the global definition, for usage.

For any Monterey version prior 12.1, the SurPlus patches are required:

    build.patches = [
        {
            'Base': '_early_random',
            'Comment': 'SurPlus 1',
            'Find': build.unhexlify('00 74 23 48 8B'),
            'Identifier': 'kernel',
            'Limit': 800,
            'MinKernel': '20.4.0',
            'Replace': build.unhexlify('00 EB 23 48 8B')
        },
        {
            'Base': '_register_and_init_prng',
            'Comment': 'SurPlus 2',
            'Find': build.unhexlify('BA 48 01 00 00 31 F6'),
            'Identifier': 'kernel',
            'Limit': 256,
            'MinKernel': '20.4.0',
            'Replace': build.unhexlify('BA 48 01 00 00 EB 05')
        }
    ]
    build.write_tree()

Variable settings

See the global definition, for usage.