This repository was archived by the owner on Dec 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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- 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
-
delete(path: string): remove the value identified located atpath -
set(path: string, value: any): set the value atpathtovalue -
append(path: string, value: any): appendvalueto the end of the array atpath
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)-
Debug: boolean.trueif the--debugflag was provided -
Product: string. The value provided to the--productargument -
MLB: string. The value provided to the--mlbargument -
ROM: string. The value provided to the--romargument -
SerialNumber: string. The value provided to the--serialargument -
UUID: string. The value provided to the--uuidargument
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"))-
ACPI(filename: string): returns anACPI.Addentry based on the provided file -
Driver(filename: string): returns aUEFI.Driversentry based on the provided file -
Kext(filename: string): returns aKernel.Addentry based on the provided file- If the kext has an Info.plist file, it is used to determine
MinKernelandExecutablePath.
- If the kext has an Info.plist file, it is used to determine
-
Tool(filename: string): returns aMisc.Toolsentry based on the provided file