Skip to content

Device configuration ​

Format 2 uses schema_version = 2 at the top of board.toml. Files without this field use format 1. See the device repository specification for profile ownership and examples.

Local build inputs ​

Copy unixnu.example.toml to unixnu.local.toml in the UniXNU checkout and fill in your device paths. The file is ignored by Git. Use --config /path/to/build.toml to select another file.

toml
[build]
device = "../UniXNU-<device>"
uefi = "../uefi-<device>"
dtb = "/path/to/firmware.dtb"
kernelcache = "/path/to/kernelcache"
trust_cache = "/path/to/trustcache.bundle"
data_ramdisk = "/path/to/data-seed.dbr"
unique_chip_id = "<hex>"
jobs = 8
target = "DEBUG"
kernel_args = ["-v", "serial=3", "debug=0x14e"]

Replace the placeholders with your port's inputs. Relative paths start at the configuration file's directory. Command-line flags take priority, followed by environment variables, then this file, then device defaults. kernel_args overrides board arguments by name; --kernel-arg overrides local arguments by name.

Supported path keys are device, out, uefi, edk2, clang_bin, kernel_sdk, kernel_tools, kernelcache, kernel, trust_cache, owner_trust_cache, data_ramdisk, gpu_addon, dtb, fd, ramdisk, and output. Other keys are ipsw (path or URL), unique_chip_id (hex string), jobs (positive integer), target (DEBUG or RELEASE), boot_menu_theme (default or oc-like, corresponding to --boot-menu-theme or UNIXNU_BOOT_MENU_THEME), and kernel_args (string array). ramdisk = "none" selects an empty boot-image ramdisk.

clang_bin selects the EDK II tool directory containing clang, lld-link, llvm-lib and llvm-rc (--clang-bin or CLANG_BIN). kernel_sdk and kernel_tools select an exported iPhoneOS SDK and toolchain bin directory for kernel compilation and prelink. Their command-line options are --kernel-sdk and --kernel-tools; their environment variables are UNIXNU_KERNEL_SDK and UNIXNU_KERNEL_TOOLS.

sh
./unixnu defconfig <device>_defconfig
./unixnu kernel
./unixnu firmware
./unixnu payload
./unixnu bootimg
./unixnu status --json

status reports the selected file as build_config. Build inputs use unixnu.local.toml; module source overrides use the device repository's local.toml.

The device enables the AppSync adapter with [payload.runtime] appsync = true and the matching kernel patches. It applies to all user application bundles without per-app build inputs.

Profile fields ​

TableKeyMeaning
boardsoc_sourceName of a pinned kind = "soc" source
boardos_profileDirectory under profiles/os/
componentsincludeCanonical component IDs; dependencies are resolved in build order
kernelconfig_fragmentsOrdered profile-relative configuration files
kernelpatch_seriesOrdered profile-relative series files
device_treesourceDTS entry point, such as device:dts/myboard.dts
device_treeinclude_dirsDTS include paths, such as soc:dts

Layers apply as ARM64, SoC, OS, device. Tables merge by key; arrays replace. The selected defconfig applies after config_fragments. File prefixes are arch:, soc:, os:, and device:. Series entries also accept component:<ID>/path. unixnu status --json reports the effective configuration.

board.toml [os_overrides."<profile>"] holds the board values that differ for one OS profile. The table of the selected profile merges over the board, and the others are dropped. Its remove array lists dotted keys, such as payload.runtime.appsync, that are deleted after the merge. A removed key is gone from the merged profile and board values together, so a board list that would replace a profile list belongs in the override of the profile that uses it.

board.toml ​

[board] ​

KeyTypeMeaning
namestringOutput directory name
socstringSoC identifier
descriptionstringHuman readable description
kitstringDevice package folder under kits/
examplebooleanMarks a sample. Build and bootimg refuse it

[ipsw] ​

KeyTypeMeaning
urlstringDefault remote IPSW
productstringProduct type, for example iPad7,1
versionstringProduct version
buildstringProduct build
device_classstringDevice class from the manifest
chip_idintegerApChipID
board_idintegerApBoardID
fetcharrayComponents extracted by ipsw fetch

[ipsw.sha256] ​

KeyTypeMeaning
member filestringExpected SHA-256 of the extracted member

[userdata] ​

KeyTypeMeaning
first_lbaintegerFirst LBA of the userdata GPT entry
last_lbaintegerLast LBA of the userdata GPT entry
lba_bytesintegerLogical block size
windowsarray{ name, component } entries

[kernel] ​

KeyTypeMeaning
defconfigstringFile name under configs/
archivesarrayArchive builder scripts of the build tree, run in order before the kernel link
KeyTypeMeaning
toolstringPrelink tool path in the build tree
kernelstringNative kernel path in the build tree
slidestringAddress slide
rootsarrayBundle identifiers kept from the kernelcache
early_security_initstringidentifier=address
kernelcachestringOptional path to a local kernelcache
kernelcache_sha256stringExpected kernelcache hash
extra_argsarrayExtra prelink arguments

[firmware] ​

KeyTypeMeaning
configstringMu-Silicium Resources/Configs/<name>.toml
dscstringDSC path in the checkout
fdstringFirmware volume path, {target} replaced
packagesarrayPACKAGES_PATH entries
preflightarrayPreflight scripts in the build tree
patchesarrayPatches applied to edk2 for the build
submodulesarrayMu-Silicium submodules to initialize

[firmware.defines] ​

KeyTypeMeaning
anystring-D NAME=VALUE for the EDK II build

[bootimg.image] ​

KeyTypeMeaning
baseintegerImage base address
kernel_offsetintegerKernel offset
tags_offsetintegerTags offset
pagesizeintegerImage page size
header_versionintegerAndroid boot image header version
kernel_compressionstringgzip (default) or none; selects how the kernel is stored in the boot image

[[bootimg.dtb_node]] ​

KeyTypeMeaning
pathstringDevice tree node path
propsarray{ name, type, value }

Types are s for string, x for hex cells, i for decimal cells, u for unsigned cells and empty.

[payload] ​

KeyTypeMeaning
volumestringFAT label, at most 11 characters
size_mibintegerVolume size
loaderstringfirmware or a driver path mode
titlestringMenu title
dram_sizestringDRAM size for the ADT
panic_screenbooleanPatch the panic screen into the payload kernel
trust_cache_sha256arrayAccepted trust cache hashes. An owner bundle passed with --owner-trust-cache skips this list
kernel_argsarrayDefault kernel arguments
toolsbooleanAdd Tools to the generated menu; configure plugins with log capture
timeoutintegerMenu timeout
skip_setup_toolstringScript used by --skip-setup

[payload.adt] ​

KeyTypeMeaning
toolstringADT generator path
chip_idstringChip ID for the ADT
owned_memory_sizestringContiguous window request
owned_memory_excluded_rangesintegerSize of the excluded-range table; the window may then span more than one run of free memory. Only for an OS profile whose XNU reads the table
loader_inputsbooleanReserve the records in which DarwinBoot reports where the payload RAM disk and the initrd buffer lie
owned_memory_outside_rangesintegerSize of the table in which DarwinBoot lists the free memory outside the window. A kernel with window-outside-memory-adoption.patch adopts it as VM memory, one probed page at a time; memory-outside=0 leaves it alone
owned_memory_outside_reservedarray of strings"BASE:SIZE" parts of that memory the kernel must not adopt: memory a board driver uses at a fixed address
root_match_volume_uuidstringRoot volume UUID
cpu_regsstringCPU MPIDR values, comma separated
psci_methodstringsmc or hvc
packed_data_ramdiskbooleanUse the packed Data format
ipad_identitybooleanWrite the Apple device identity properties
unique_chip_idstringrequired when the seed is mandatory

[payload.runtime] ​

Runtime inputs prepared before the kernel build. The Data seed's volume UUID is written to CONFIG_XNU_OWNER_DATA_VOLUME_UUID.

KeyTypeMeaning
toolstringRuntime builder in the build tree
targetstringUserspace target, such as ios27 or macos27
buildstringOS build the inputs were inspected against
data_gibintegerSize of a new Data seed
skip_setupbooleanMark Setup as done in a new Data seed
data_seed_toolstringSeed script that runs as root. A missing seed stops the build with the command to run
gpu_addonbooleanBuild the GPU addon (default true). With false, the trust bundle holds the original caches only
boot_shimsbooleanAdd the owner apfs_boot_util to the addon, for macOS with apfs-boot-shim=1
trust_componentsarrayIPSW trust cache components bundled for the owner trust cache
wallpapers, audio_tool, wifi_tool, bluetooth_tool, appsyncOptional userspace layers added to the addon

defconfig ​

CONFIG_NAME=y
CONFIG_NAME=n
CONFIG_NAME="text"
CONFIG_NAME=123
# CONFIG_NAME is not set

Each CONFIG_XNU_<NAME> becomes XNU_<NAME>. {tree} in a string becomes the build tree path.

feeds.toml ​

toml
[[source]]
name = "Name"
kind = "driver"          # driver, kit, patch, script, package, refer, soc
git = "https://github.com/ORG/REPO"
ref = "main"
path = "drivers/Name"
commit = "..."
local = "/path/to/local"
submodules = []
KeyMeaning
nameModule name
kindModule kind
gitSource repository
refBranch, tag or commit to fetch
pathOptional subdirectory, fetched sparse
commitOptional pin
localLocal directory instead of git
submodulesUpstream submodules to initialize

local.toml ​

An ignored file in the device repository:

toml
[local]
drivers = "/path/to/drivers"
kits = "/path/to/kits"
patches = "/path/to/patches"
scripts = "/path/to/scripts"
package = "/path/to/package"

unixnu.lock ​

toml
[source."Name"]
commit = "0123456789abcdef"

Written by unixnu fetch for Git sources. Format 2 gives an explicit source commit priority over the lock, including the selected OS XNU revision. Format 1 uses lock-first precedence. Official aliases can reuse lock entries recorded under their accepted source names.

Module resolution ​

  1. --local-module [KIND:]NAME=PATH
  2. --local-<kind> DIR
  3. --local DIR
  4. a local key in feeds.toml or local.toml
  5. the device repository
  6. the base repository
  7. a git source in feeds.toml

The first match wins.

Next steps ​

Released under the BSD-2-Clause-Patent License.