Skip to content

Requirements ​

Procedure ​

  1. Choose the host toolchain for the steps you will run. Complete the macOS or Linux instructions and confirm the required tools are available.
  2. Collect the external inputs for the selected OS profile: IPSW/kernelcache, trust cache, Data seed and driver ABI inputs where required. Record their paths and versions.
  3. Check the device inputs: device repository, firmware repository and target DTB. Save paths in local configuration.
  4. Continue with Build and boot. Run ./unixnu status --json after selecting the defconfig; the device, OS profile and source paths must match the inputs above.

Host ​

The build driver supports macOS and Linux. On macOS, the kernel step uses Xcode and the iphoneos SDK. On Linux, use the Linux toolchain. --skip-setup and Data seed resizing use macOS image tools.

ToolUsed byInstall
macOS with Xcodekernel, skip-setup, seed-data-growApp Store or developer.apple.com
Python 3.11 or newerevery steppython.org or Homebrew
git, makefetch, firmwareXcode command line tools or Homebrew
cmake, ninjakernel referencesbrew install cmake ninja
unifdeflibdispatch headersbrew install unifdef
LLVM with lldkernel, firmware, boot imagebrew install llvm
Rust 1.98.0 with rust-srcMetal bridgerustup toolchain install 1.98.0 --profile minimal --component rust-src
mtoolspayload volumebrew install mtools
dtcdevice tree propertiesbrew install dtc
fastbootseed-data-grow --auto, userdata flashAndroid platform tools
QEMU and AAVMFoptional smoke testsbrew install qemu

The driver finds the keg-only Homebrew LLVM at /opt/homebrew/opt/llvm/bin without PATH changes. Other tools must be on PATH.

Network access is required for unixnu fetch, which updates the module submodules and fetches Apple source references and a Mu_Basecore tree.

Without a Mac, the macOS build workflow runs the Mac-only steps on a GitHub macOS runner. See Build.

Linux ​

On Linux the kernel step builds with upstream clang and an open source Mach-O toolchain instead of Xcode. scripts/linux/setup-toolchain.py installs it once, as root, under /opt/unixnu-linux (or the prefix given as its argument or in UNIXNU_TOOLCHAIN):

ToolSource
clang with the __builtin_xnu_type_* builtins that xnu's kalloc.h needsllvm-project with scripts/linux/llvm-xnu-builtin-type.patch
ld64, libtool, nm, lipocctools-port 1030.6.3-ld64-956.6
mig, iigbootstrap_cmds-138, iig-port
xcrun, plutil, codesign, Command Line Tools layoutshims in scripts/linux
lzfselzfse, for the kernelcache

The installer runs on glibc Linux hosts. It detects the distribution through /etc/os-release and installs dependencies with its package manager:

Package managerDistribution family
aptDebian, Ubuntu and derivatives
dnfFedora and RHEL derivatives
pacmanArch Linux and derivatives
zypperopenSUSE and SUSE

Use the distribution's enabled repositories for Clang, LLVM development files, libclang, libbsd, UUID, OpenSSL and zlib development packages. The installer also installs mtools and dtc for payload and device-tree commands. Package availability depends on the configured repositories. Keep the system and package databases current through the distribution's normal update procedure.

sh
# Preview the dependency commands.
scripts/linux/setup-toolchain.py --print-packages
# Install dependencies and build the toolchain.
sudo scripts/linux/setup-toolchain.py
# Check installed tools, headers and library linking.
scripts/linux/setup-toolchain.py --check

--package-manager apt|dnf|pacman|zypper selects an installer explicitly. For another distribution or an environment with dependencies prepared separately, use:

sh
scripts/linux/setup-toolchain.py --package-manager pacman --print-packages
sudo scripts/linux/setup-toolchain.py --package-manager none --llvm-config /path/to/llvm-config

--llvm-config FILE or LLVM_CONFIG selects the host LLVM installation. Its clang, clang++, libclang and resource headers are resolved together. XNU's patched Clang is built from the pinned LLVM source. -j N sets the build parallelism. The optional positional argument selects the install prefix, which defaults to /opt/unixnu-linux or UNIXNU_TOOLCHAIN.

The script writes xcrun, plutil and codesign shims to /usr/bin, where XNU's makefiles call them. Mach-O archives, libdispatch and BlocksRuntime live under the toolchain prefix. Building Clang takes most of the setup time. The userdata step runs on Linux; --skip-setup and seed-data-grow require macOS.

External inputs ​

These inputs live outside the UniXNU repositories.

InputUsed byOptionEnvironment
Mu-Silicium checkout for the devicefirmware, boot image--uefi DIRUNIXNU_UEFI
Target IPSW, local file or HTTPS URLkernel prelink, userdata--ipsw PATH_OR_URLUNIXNU_IPSW
Decompressed kernelcachekernel prelink--kernelcache FILEUNIXNU_KERNELCACHE
Compiled device treeboot image--dtb FILEUNIXNU_DTB
Trust cache bundlepayload--trust-cache FILE
Owner trust cache bundlepayload--owner-trust-cache FILE
Data ramdisk seedpayload--data-ramdisk FILE
Platform seedpayload--unique-chip-id HEXUNIXNU_UNIQUE_CHIP_ID
Prebuilt static archiveskernel--kernel FILE for the payload, archives in the build tree
edk2 or Mu_Basecore treepackage, firmware--edk2 DIRUNIXNU_EDK2

Target IPSW ​

An OS profile targets an iOS, iPadOS or macOS restore image. The image family must match the device identity (MobileGestalt). The arm64 targets are iOS 16 and iPadOS 17; the arm64e targets are iOS 27, iPadOS 27 and macOS 27.

ArchitectureTargetVersionBuildRestore image
arm64iOS, iPhone X (iPhone10,3, iPhone10,6)16.7.1620H392iPhone10,3,iPhone10,6_16.7.16_20H392_Restore.ipsw
arm64iPadOS, iPad Pro 12.9-inch 2nd generation (iPad7,1)17.7.1121H461iPad_Pro_HFR_17.7.11_21H461_Restore.ipsw
arm64eiOS, iPhone 16 Pro (iPhone17,1)27.0.124A446iPhone17,1_27.0.1_24A446_Restore.ipsw
arm64eiPadOS, iPad Pro M5 (iPad17,1 to iPad17,4)27.0.124A446iPad17,1,iPad17,2,iPad17,3,iPad17,4_27.0.1_24A446_Restore.ipsw

iOS 16 and iPadOS 17 are both arm64 images and share the arm64 patch series (profiles/arch/arm64); a fix to one applies to the other. The links come from ipsw.me and point to Apple's servers.

The macOS profile targets UniversalMac_27.3_26C5035r_Restore.ipsw (Mac17,11). Its URL is [ipsw] url of the profile, and its further inputs are in macOS profile.

[ipsw] url in the device repository is the default. --ipsw or UNIXNU_IPSW overrides it. Download the image outside the repository.

The device repository supplies the board description, the kernel defconfig and the archive builders listed in [kernel] archives.

Device ​

The device needs:

  • An unlockable bootloader that accepts fastboot boot.
  • A UEFI port that provides a framebuffer, input, block I/O and file system access.
  • A UART or USB transport for logs during bring-up.
  • Enough RAM for the kernel window, the payload and the userdata image.
  • The target OS restore image and a matching device identity.

Next steps ​

  • Build describes the commands that consume these inputs.
  • Device repository describes the board file.
  • Devices lists device repositories and their specific inputs.

Review the ABI, SDK, firmware, and image input inventory before starting the full build.

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