Files
reims-util/Cargo.toml
T
Anees Iqbal 2686f02b38 🆕 Make OpenCore images and macOS installers for x86-64 VMs
reims-ctl and its docs send people to OSX-KVM or ULTMOS for two things: an
OpenCore boot image with OVMF, and a way to install macOS. This does both in
one program with no other tools to install, on Linux and macOS, so reims-ctl
can point at it instead. Each job writes one file that reims-ctl takes as it
is.

- opencore: a 128 MiB GPT disk (qcow2 or raw) whose FAT32 EFI partition holds
  OpenCore 1.0.8 with a config.plist made from the release's Sample.plist for
  a q35 VM on KVM (no kexts, one SSDT for EC and USBX, a fresh SMBIOS
  identity), plus OVMF from a pinned Arch edk2-ovmf package. Both downloads
  are pinned by SHA-256 and cached.
- online-installer VERSION: Apple's recovery image for High Sierra to Tahoe,
  as macOS-<name>-online-installer.dmg, checked chunk by chunk against its
  chunklist, whose RSA signature must be Apple's, since both come over plain
  HTTP. It installs the newest release of its macOS over the network.
- offline-installer VERSION: one exact release of macOS 11 to 26 for Intel
  Macs, from the software update catalog, as one raw GPT disk,
  macOS-<name>-<version>-<build>-offline-installer.img:
  - FAT32 RECOVERY: com.apple.recovery.boot/BaseSystem.dmg and its chunklist,
    which OpenCore boots, checking Apple's signature, as from a USB stick;
  - exFAT Installer: InstallAssistant.pkg (12 to 18 GB, past FAT32's 4 GiB
    limit), checked against its chunklist and the catalog's digest of its
    table of contents, and install-macos.sh, run from Recovery's Terminal.

The script installs the package onto the erased disk and starts the app's
startosinstall. The package's postinstall writes to $3Applications, which
for a volume lands beside it on Recovery's RAM disk, so a link sends it onto
the volume; it also sets CM_BUILD and fixes the app's modes, as mist-cli does.

Both of the offline installer's files are downloaded straight into their
places in the image, so the package is never on disk twice. A disk is built
as byte ranges, with a reserved place for each download, and the package's
volume first so its place stays put when Apple's recovery image changes size.
The FAT32, exFAT and GPT writers are our own (fatfs made volumes macOS's
fsck_msdos rejected); fsck_exfat and fsck_msdos pass the volumes. An image
already there is checked read-only, since a VM may be running from it, kept
when its package checks out, and repaired otherwise.

Downloads resume from a .part file (or the image's place) after checking what
is already there against Apple's chunklists, and carry on through slow or
dropped connections. The same jobs run from a small inline terminal
interface, from subcommands, and with --json for scripts.

Licensed GPL-2.0-or-later OR LGPL-3.0-or-later, as reims-vgpu is. The serial
number tables come from OpenCorePkg's macserial, so its BSD-3-Clause license
is kept beside ours for that file.
2026-10-12 17:57:06 +03:00

52 lines
1.6 KiB
TOML

# reims-util: makes the OpenCore boot image and OVMF firmware an x86-64 macOS VM boots through,
# and online and offline macOS installers from Apple's own files (README.md).
[package]
name = "reims-util"
version = "0.1.0"
edition = "2024"
rust-version = "1.98.1"
publish = false
license = "GPL-2.0-or-later OR LGPL-3.0-or-later"
description = "Make OpenCore boot images and macOS installers for x86-64 macOS VMs"
[dependencies]
anyhow = "1.0.104"
clap = { version = "4.6.7", features = ["derive", "wrap_help"] }
crc32fast = "1.5.2"
# The gzipped software update catalog (installer.rs).
flate2 = "1.1.10"
getrandom = "0.4.3"
# The RSA check of a recovery image's chunklist signature (chunklist.rs).
num-bigint = "0.5.1"
plist = "1.10.1"
# line_count: how many rows a wrapped summary takes in the scrollback (tui.rs). No default
# features: their underline-color names the termwiz and termina backends, which Cargo.lock then
# carries (with termwiz's old generic-array and psm) though nothing builds them.
ratatui = { version = "0.30.2", default-features = false, features = [
"crossterm",
"layout-cache",
"unstable-rendered-line-info",
] }
# The OVMF package's zstd archive (ovmf.rs).
ruzstd = "0.9.1"
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.154"
sha1 = "0.11.0"
sha2 = "0.11.0"
tar = "0.4.46"
ureq = "3.4.2"
# The OpenCore release (opencore/mod.rs): reading deflated entries only.
zip = { version = "9.0.2", default-features = false, features = ["deflate-flate2"] }
[lints.rust]
unsafe_code = "forbid"
[lints.clippy]
unwrap_used = "deny"
expect_used = "deny"
panic = "deny"
todo = "deny"
[profile.release]
debug = "line-tables-only"