Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

Instruction scripts

Nick Miller edited this page Jul 6, 2023 · 2 revisions

An instruction script is a file containing operations perform on an OpenCore configuration property list file.

set("Misc.Debug.DisableWatchDog", true)
delete("Kernel.Add.2.Enabled") // index arrays with numeric keys
set("DeviceProperties.Add.PciRoot(0x0)/Pci(0x1f,0x3).layout-id", 21) // any character besides . is valid in a path

Syntax

  • Instructions cannot span multiple lines
  • Plist paths are dot-delimited (., U+002E FULL STOP) strings (supporting integer keys for array access)
  • Parentheses are required when calling instructions
  • Strings must be quoted
  • Commas separate arguments
  • Providing too few or too many arguments to an instruction is a compiler error

Full reference: https://expr.medv.io/docs/Language-Definition

Instructions

  • delete(path: string): remove the value identified located at path
  • set(path: string, value: any): set the value at path to value
  • append(path: string, value: any): append value to the end of the array at path

Variables

Access variables in a script via the vars object:

set("Misc.Debug.SysReport", vars.Debug)
set("Misc.Debug.Target", vars.Debug ? 0x47 : 0) // enable|console|file
set("PlatformInfo.Generic.MLB", vars.MLB)

Available variables

  • Debug: boolean. true if the --debug flag was provided
  • Product: string. The value provided to the --product argument
  • MLB: string. The value provided to the --mlb argument
  • ROM: string. The value provided to the --rom argument
  • SerialNumber: string. The value provided to the --serial argument
  • UUID: string. The value provided to the --uuid argument

Helpers

Call helpers in a script via the helpers object. All helpers return a value and are intended to facilitate creation of common OpenCore entities. For example, adding a Kext:

append("Kernel.Add", helpers.Kext("some/path/to/Lilu.kext"))

Available helpers

  • ACPI(filename: string): returns an ACPI.Add entry based on the provided file
  • Driver(filename: string): returns a UEFI.Drivers entry based on the provided file
  • Kext(filename: string): returns a Kernel.Add entry based on the provided file
    • If the kext has an Info.plist file, it is used to determine MinKernel and ExecutablePath.
  • Tool(filename: string): returns a Misc.Tools entry based on the provided file

Clone this wiki locally