Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Quick update, I removed SecureBootModel from example setup.py, it will automatically revert to Default which is currently set to x86legacy:

1628727649373.png
 

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Plistlib Generator 1.1.5 was released with support for OC 0.7.3 (see notable changes), you will need to perform several minor changes to your current setup.py file (note the Drivers format changed in 0.7.3), prior executing the usual upgrade process.
 
  • Like
Reactions: dabotsonline

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Quick update, I finished coding the Patch feature, allowing an user to easily insert patches, see #116 in progress. This is related to the SurPlus fix, thank you @Syncretic for your great findings. I linked your repo into documentation.

I'm waiting for OC 0.7.4 to be released, so I can also add the new release settings. You can take a peak how the new setup.py file will look with @Syncretic's patches applied.
 
Last edited:

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Plistlib Generator 1.2.0 was released with support for OC 0.7.4 (see notable changes), you will need to perform several minor changes to your current setup.py file (note the Drivers format changed again in 0.7.4), prior executing the usual upgrade process.

With the introduction of SurPlus patches, a new patch routine was implemented into OpenCore Plistlib Generator. The changes are quite simple.

OC 0.7.3 version:
Code:
if __name__ == '__main__':
    kexts = [
        {
            'project': 'latebloom',
            'repo': 'macrumors',
            'version': '0.20'
        },
        {
            'project': 'Lilu',
            'repo': 'acidanthera',
            'version': '1.5.6'
        },
        {
            'project': 'FeatureUnlock',
            'repo': 'acidanthera',
            'version': '1.0.3'
        },
        {
            'project': 'WhateverGreen',
            'repo': 'acidanthera',
            'version': '1.5.3'
        }
    ]
    build = OpenCoreBuild('Volumes/EFI', kexts)
    build.write_tree()
...
            'Drivers': [
                {
                    'Path': 'OpenCanopy.efi',
                    'Enabled': True,
                    'Arguments': ''
                },
                {
                    'Path': 'OpenRuntime.efi',
                    'Enabled': True,
                    'Arguments': ''
                }
            ],

OC 0.7.4 version:
Code:
if __name__ == '__main__':
    build = OpenCoreBuild('Volumes/EFI')
    build.kexts = [
        {
            'project': 'Lilu',
            'repo': 'acidanthera',
            'version': '1.5.6'
        },
        {
            'project': 'FeatureUnlock',
            'repo': 'acidanthera',
            'version': '1.0.3'
        },
        {
            'project': 'WhateverGreen',
            'repo': 'acidanthera',
            'version': '1.5.4'
        }
    ]
    build.patches = [
        {
            'Base': '_early_random',
            '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',
            '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()
...
            'Drivers': [
                {
                    'Arguments': '',
                    'Comment': '',
                    'Enabled': True,
                    'Path': 'OpenCanopy.efi'
                },
                {
                    'Arguments': '',
                    'Comment': '',
                    'Enabled': True,
                    'Path': 'OpenRuntime.efi'
                }
            ],
 
  • Like
Reactions: iMac-iPad

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
All Monterey changes are applied inside OC 0.7.5 upgrade branch, you can use that setup.py example. The way I plan to upgrade is to build the new EFI and update it following the configuration instructions, without rebooting. Once I get the Monterey OTA notification, I start the upgrade process, as the new EFI is already in place.

As discussed with @cdf, we are both moving away from FeatureUnlock plugin, because the performance issues and forced non-required patching on a Mac 5,1. We will use instead NightShiftEnabler.

There is a new Monterey Wiki page I created also. The OTA update:

1635184572005.png


I upgraded successfully with the above procedure:

Screen Shot 2021-10-25 at 3.24.39 PM.png


If you experience Bluetooth issues, just reboot again your Mac. You will also need to re-install the command line developer tools:
Code:
xcode-select --install
 
Last edited:
  • Like
Reactions: iMac-iPad

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
For these interested to try the new Monterey 12.1 Beta, here is the patches configuration:
Code:
    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')
        },
        {
            'Base': '_work_interval_port_type_render_server',
            'Comment': 'MonteRand 1',
            'Find': build.unhexlify('0F C7 F1 73 FB 21 F1 39 D1 73 F5 89 C9 48 8B 94 CD D0 FD FF FF'),
            'Identifier': 'kernel',
            'Limit': 3900,
            'MinKernel': '21.2.0',
            'Replace': build.unhexlify('31 C9 90 90 90 21 F1 39 D1 73 F5 89 C9 48 8B 94 CD D0 FD FF FF')
        },
        {
            'Base': '_panic_with_thread_context',
            'Comment': 'MonteRand 2',
            'Find': build.unhexlify('0F C7 F2 73 FB 83 E2 0F 83 FA 07 77 F3 0F B7 34 41'),
            'Identifier': 'kernel',
            'Limit': 10100,
            'MinKernel': '21.2.0',
            'Replace': build.unhexlify('31 D2 90 90 90 83 E2 0F 83 FA 07 77 F3 0F B7 34 41')
        }
    ]
As discussed with @Syncretic, you should wait trying the Beta as he believes new patch changes might be required.
 
  • Like
Reactions: iMac-iPad

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Plistlib Generator 1.2.1 was released with support for OC 0.7.5 (see notable changes), you will need to perform several minor changes to your current setup.py file, prior executing the usual upgrade process. The new configuration is reduced, with several settings being removed, making it even easier to perform future upgrades.
 
  • Like
Reactions: iMac-iPad

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Sorry for the late update, I was in vacation. Plistlib Generator 1.2.2 was released with support for OC 0.7.6 (see notable changes), the only change needed to your configuration is the Lilu plugin version.
 
Last edited:
  • Like
Reactions: Steve_Jones

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Plistlib Generator 1.2.4 was released with support for OC 0.7.8 (see notable changes). No changes are required to the setup.py file, except the new software versions.
 
  • Like
Reactions: Steve_Jones

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Plistlib Generator 1.2.6 was released with support for macOS Monterey 12.3 (see notable changes).

You will need to add the following kext into your setup.py:
Code:
    build.kexts = [
        {
            'project': 'ASPP-Override',
            'properties': {
                'ExecutablePath': '',
                'MinKernel': '21.4.0'
            },
            'repo': 'dortania',
            'version': '1.0.1'
        },

For some reason, the original zip file present into Dortania repo would add an empty __MACOSX directory inside OC/Kexts directory, so I re-zipped the .kext file with a standard command. See details into README.

Another release will be posted soon to fix the Python version changes, as Python2 is not supported anymore in macOS 12.3+.
 
Last edited:
  • Like
Reactions: Steve_Jones

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Monterey 12.3 introduces Python 3 as default libraries, making Python 2 obsolete. Therefore, for future macOS upgrade, a new Plistlib Generator library was written with Python 3 support (see notable changes).

To upgrade your OS from Monterey 12.2.1 version (or less), to Monterey 12.3, run:

Code:
~$ git clone -b 1.2.6 --depth 1 https://github.com/axivo/opencore.git
~$ cd opencore
~$ python -B setup.py

Look at the setup.py example settings to see how the required ASPP-Override kext is implemented.

Once you upgraded to Monterey 12.3, you can use the new Python 3 library to generate your EFI directory:

Code:
~$ git clone https://github.com/axivo/opencore.git
~$ cd opencore
~$ python3 -B setup.py

Visit the configuration wiki page for detailed instructions.
 
Last edited:

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
Plistlib Generator 2.0.1 was released with support for OC 0.8.0 (see notable changes). Update the versions and change SetApfsTrimTimeout to 0, in your setup.py file.
 
  • Like
Reactions: Steve_Jones

flaubert

macrumors 6502
Jun 16, 2015
485
200
Portland, Oregon
Hi @TECK, I finally got around to trying to figure out your tool. Thank you for creating it. Of course, I have a couple questions:

1. I am running a previous version of OpenCore that seems to work, and thus I originally went through the process from the first post in the OpenCore thread to get my PCI parameters. I assume that I just transfer those working strings into my setup.py file in the appropriate places. I only had two PCI strings, one for a third party NVME drive, and one for a graphics card in my old config.plist; the default setup.py has what looks like two NVME drive strings, am I interpreting that right? I can just delete the unused one?

2. I have an RX560 graphics card, pretty close cousin to the RX580; is there anything you know of that I need to change for that in setup.py?

3. I'm confused about AppleMCEReporterDisabler: it doesn't appear in the example setup.py, yet I still see it being processed when setup.py is run.

4. Does anyone have a working example of how to integrate AVXpel into setup.py? That looks seriously complicated and error prone to process all those custom strings into setup.py! Or is everyone just doing a manual copy/paste from the @cdf first post in the OpenCore thread into the output from the plist generator? That's probably what I'm going to end up doing unless someone has already done the work for setup.py.

5. When it comes to maintenance... doing a git operation for a new release will overwrite my oh-so-carefully crafted setup.py unless I save it away somewhere other than the opencore directory, correct? So I should save it away somewhere else before pulling down fresh code and files from git?

Once again, thanks @TECK for creating this amazing tool.

Kurt
 

Attachments

  • setup.txt
    3.9 KB · Views: 63

TECK

macrumors 65816
Original poster
Nov 18, 2011
1,129
478
@flaubert see the answers below.
1. I am running a previous version of OpenCore that seems to work
You can always run safely the latest pull from GitHub repo, this will upgrade everything to latest OC version. That's the purpose of this tool, to have everything easy for the end-user.

2. I have an RX560 graphics card, pretty close cousin to the RX580; is there anything you know of that I need to change for that in setup.py?
All you need is to set the correct GPU path, easiest way to get the correct path is with Hackintool. Right-click on device and select Copy Device Path, this is what I have in my Mac Pro for Radeon RX580: PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)

1665435328127.png


3. I'm confused about AppleMCEReporterDisabler: it doesn't appear in the example setup.py, yet I still see it being processed when setup.py is run.
That's an automated process, the generator will detect if you have single or dual processors and if you have dual, it will automatically inject the AppleMCEReporterDisabler.kext for you. Keeping things simple for end-user, you only need that kext for dual processors.

4. Does anyone have a working example of how to integrate AVXpel into setup.py?
There are two approaches used for optional AVXpel implementation: the patch created by @Syncretic or the NoAVXFSCompressionTypeZlib library created by @khronokernel. He extracts the 12.3.1 library from previous OS, to be injected as kext. The end result is identical and to simplify the setup process, my generator uses the library. End-user does not have to do anything, beside adding the instructions into setup.py:
Code:
    build.kexts = [
        {
            'project': 'NoAVXFSCompressionTypeZlib',
            'properties': {
                'MinKernel': '21.5.0'
            },
            'repo': 'dortania',
            'version': '12.3.1'
        }
    ]
For a detailed example, visit the wiki page. I personally don't have it installed in my Mac as I don't use the features required to have that library present.

I've build this mechanism because it allows end-user to implement any custom kext they want to use, in OC. See the Custom Kext Build section into wiki.

5. When it comes to maintenance...
Think of setup.py as your commander, you tell with that file to OC how to build the /EFI and configuration file. If you leave the setup.py the way it is with no customizations, the generator will build the /EFI and configuration file with default OC values.

The goal is to set your customized options in setup.py, so you never have to worry about typing them again. The hard work will be done by the generator builder, replacing the default OC settings with your custom settings present into setup.py file.

You can name setup.py to whatever name you like, for example:
Code:
$ python3 -B flaubert.py

See the detailed instructions how to properly upgrade your Mac, into wiki. The latest current OC release setup.py configuration is present into repo. Every time a new OC version is released, the example setup.py is updated, if changes are required. But these changes never occur (beside versions), so you will always be safe to keep your setup.py unchanged. Keep in mind that the example setup.py includes all settings suggested by @cdf and will work out of the box, the only customizations required are the insertion of correct PciRoot for your GPU and NVMe.

Is up to you how you save your setup.py file. If you are familiar with GitHub, you can fork the repo and save the setup.py the way you want, into main branch or a custom branch.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.