Configuration: Build Options - axivo/opencore GitHub Wiki

This wiki page will detail various examples and settings required to generate a custom OpenCore tree and configuration.

OpenCore Release Build

See the configuration for RELEASE builds.

OpenCore Debug Build

By default, RELEASE packages are used to build your OpenCore EFI tree. If you prefer to use DEBUG packages, set the write_tree debug variable to True into setup.py configuration file:

build = OpenCoreBuild('Volumes/EFI')
build.write_tree(True)

Setting debug variable to True will force the usage of DEBUG packages for OpenCore and any kexts defined into build.kexts variable.

OpenCore Master Branch Build

There are cases where advanced users want to experiment with new OpenCore features available only in master branch. To build the latest OpenCore release from master branch, you will need to install the following dependencies:

  • acpica
  • mtoc
  • nasm

You can install them with Homebrew:

~$ brew install acpica mtoc nasm

If current OpenCore release is 0.7.4, the master branch build version will be the next scheduled release, for example 0.7.5.

To rebuild an already released OpenCore version, use the following clone command:

~$ git clone -b 0.7.4 --depth 1 https://github.com/acidanthera/OpenCorePkg.git

Otherwise, clone the OpenCore master branch and build the binaries:

~$ git clone https://github.com/acidanthera/OpenCorePkg.git
~$ cd OpenCorePkg
~$ IGNORE_MTOC_VERSION=1 sh build_oc.tool

~$ ls -lh Binaries
total 13168
-rw-r--r--  1 floren  staff   3.6M 10 Oct 13:41 OpenCore-0.7.5-DEBUG.zip
-rw-r--r--  1 floren  staff   2.8M 10 Oct 13:42 OpenCore-0.7.5-RELEASE.zip

To generate a basic OpenCore tree and configuration using the new binaries, execute the following steps:

  • Create a new branch:
    ~$ git clone https://github.com/axivo/opencore.git
    ~$ cd opencore
    ~$ git branch build/oc-0.7.5
    ~$ git checkout build/oc-0.7.5
  • Copy the new binaries into opencore/files directory
  • Update the OpenCoreBuild version variable from 0.7.4 to 0.7.5
  • Run the python setup.py command

setup.py configuration file example with build.version set to 0.7.5:

#!/usr/bin/env python3

from opencore.build import OpenCoreBuild


if __name__ == '__main__':
    build = OpenCoreBuild('Volumes/EFI')
    build.kexts = []
    build.patches = []
    build.version = '0.7.5'
    build.write_tree()

    settings = {}
    build.write_plist(settings)
    build.run_misc_tasks()

Custom Kext Build

Custom kexts can be created and used by adding them into opencore/files directory. The Acidanthera file naming convention must be respected with a <name>-<version>-<releasetype>.zip format. Both RELEASE and DEBUG packages should be generated, in case end-users enable the debug build.

To install a custom kext named LiluBeta-5.0.0-RELEASE.zip, place the compressed file into opencore/files directory and define it into setup.py configuration file:

#!/usr/bin/env python

from opencore.build import OpenCoreBuild


if __name__ == '__main__':
    build = OpenCoreBuild('Volumes/EFI')
    build.kexts = [
        {
            'project': 'LiluBeta',
            'repo': 'acidanthera',
            'version': '5.0.0'
        }
    ]
    build.patches = []
    build.write_tree()

    settings = {}
    build.write_plist(settings)
    build.run_misc_tasks()

The project, repo and version keys define the Github download link for each specified kext. In case of a custom kext, the file is local, therefore repo key is ignored.

See the global definition, for build.kexts variable usage.

⚠️ **GitHub.com Fallback** ⚠️