Files
reims-vgpu/guest/Makefile
T
Anees Iqbal 76a7ad4d7b ⬆️ Take Graft 0.1.0, its first public release
Graft 0.1.0 (commit bb884fe, release zip sha256 2bea380e) is Graft's first
public release: bundle id ai.aneesiqbal.graft, serving only
ai.aneesiqbal.ReimsGraphics and ai.aneesiqbal.RgfxGate, with a C++17 SDK tool,
graft-kext, that consumer.mk builds from source with Xcode's clang++ in place
of the Python SDK. Its zip, copied by its own tools/vendor.py with the record
of all 156 files, puts Graft's source tree, the two kexts and the SDK in
guest/graft; the kexts sit at guest/graft/Graft.kext and Graft-arm64e.kext,
with no built/ any more, so the set's staging, its Graft check and the lane
gate read them there. The only binaries are the two kexts. AGENTS.md now says
guest/graft is Graft's release as vendor.py copies it.

RgfxGate depends on ai.aneesiqbal.graft 0.1.0, Graft's compatible version.
Graft hands an arm64e route's original back as a void * holds a function
pointer, discriminator 0, so RgfxGate keeps each AMFI original in a void * and
converts it to its mpo type at the call, which re-signs it; a typed variable
written through a void ** would authenticate with the type's discriminator and
fault. The static_asserts on the wrappers' discriminators stay. Graft's kernel
side refuses by name where it could have panicked, among them an arm64e AMFI
slot not signed with its operation's discriminator and a donor table that
differs from the live vtable.

set-check checks the prelinked collection with graft-kext check-prelinked,
which takes prelink.py's arguments and exit codes. Graft reports a bound
consumer as "bound: imports and vtables committed;" and either waiting for the
device or "activation gate open on the device nub"; the lane gate's graft-bind
passes only on the open gate, since only then does IOKit start ReimsGraphics.
Graft's own id moves in stage-config.py and docs/qemu.md, check-boot marks a
panic report naming ai.aneesiqbal as ours, and msi-appload posts its
measurement notification under the new prefix.

The prebuilt sets are rebuilt from these sources in their own commit.
2026-11-10 00:35:01 -08:00

96 lines
4.0 KiB
Makefile

# The guest side of the reims-graphics device (QEMU's reims-graphics-pci) for
# x86-64 macOS 11 to 26 guests, and the kext set their OpenCore image injects
# for it, and the arm64e set for the arm64 macOS 14 and later guests Ambrosia
# boots (prebuilt-arm64e/, which Ambrosia's config bundle places):
# Graft (graft/, vendored from Graft's repository with its record),
# ReimsGraphics (kext/), injected dormant for Graft to bind against the
# System kernel collection's libraries, and RgfxGate (rgfxgate/), a Graft
# client that carries the Metal bundle (bundle/). Builds on a Mac with Xcode
# alone: no KDK and nothing fetched.
#
# make set [OUT=build/set]
# build each part in build/set-work/ and write OUT: the set's bundles
# and set.toml, their Kernel > Add entries in order (tools/prebuilt.py)
# make prebuilt
# the set built afresh into prebuilt/, which the repository carries
# for hosts that cannot build it, and prebuilt/sources.toml, the
# record of the sources it was built from; commit prebuilt/ with the
# change to those sources
# make set-arm64e [OUT64=build/set-arm64e]
# the arm64e set: Graft's arm64e build, and ReimsGraphics and RgfxGate
# for arm64e, with the Metal bundle for arm64e and arm64 inside RgfxGate
# make prebuilt-arm64e
# that set built afresh into prebuilt-arm64e/ with its own sources.toml
# make prebuilt-check
# fail unless prebuilt/ and prebuilt-arm64e/ are each what their
# sources.toml records, the tree's sources are the ones they were built
# from, graft/ is the copy its source.toml records, and no kext leaves
# one of our own symbols undefined that no kext before it defines (which
# staging a set checks too); hashes and symbol tables only, on any host
# make set-check KEXTINJECT=<OpenCorePkg's TestKextInject binary>
# BOOT_KC=<the guest's x86_64 BootKernelExtensions.kc> [SET=prebuilt]
# link SET into BOOT_KC with OpenCore's linker, in user space, in
# Kernel > Add order; check every kext injects and every name
# resolves, and that ReimsGraphics stays bindable by Graft
# (tools/oc-link-set.sh)
# make test the parts' own tests: kext/, rgfxgate/ and bundle/
# make clean remove build/
#
# Everything but prebuilt/ lands in build/ or the parts' own build/, never
# committed. To take a new Graft, replace graft/ with Graft's
# tools/vendor.py and rebuild prebuilt/.
OUT ?= build/set
OUT64 ?= build/set-arm64e
SET ?= prebuilt
WORK = $(abspath build/set-work)
WORK64 = $(abspath build/set-work-arm64e)
BUNDLE = $(WORK)/bundle/package/reims-graphics.bundle
BUNDLE64 = $(WORK64)/bundle/package/reims-graphics.bundle
KEXTINJECT ?=
BOOT_KC ?=
# The parts' Makefiles get only the variables given them below, not this
# command line's (OUT would set theirs).
MAKEOVERRIDES =
.PHONY: set prebuilt set-arm64e prebuilt-arm64e prebuilt-check set-check test clean
set:
$(MAKE) -C kext BUILD=$(WORK)/kext
$(MAKE) -C bundle BUILD=$(WORK)/bundle package
$(MAKE) -C rgfxgate BUILD=$(WORK)/rgfxgate BUNDLE_DIR=$(BUNDLE)
ditto graft/Graft.kext $(WORK)/Graft.kext
python3 -I -B tools/prebuilt.py stage $(OUT) $(WORK)
prebuilt:
rm -rf $(WORK)
$(MAKE) set OUT=prebuilt
python3 -I -B tools/prebuilt.py record prebuilt
set-arm64e:
$(MAKE) -C kext ARCH_NAME=arm64e BUILD=$(WORK64)/kext
$(MAKE) -C bundle ARCH=arm64e PACKAGE_ARCHS="arm64e arm64" BUILD=$(WORK64)/bundle package
$(MAKE) -C rgfxgate ARCH_NAME=arm64e BUILD=$(WORK64)/rgfxgate BUNDLE_DIR=$(BUNDLE64)
ditto graft/Graft-arm64e.kext $(WORK64)/Graft-arm64e.kext
python3 -I -B tools/prebuilt.py stage-arm64e $(OUT64) $(WORK64)
prebuilt-arm64e:
rm -rf $(WORK64)
$(MAKE) set-arm64e OUT64=prebuilt-arm64e
python3 -I -B tools/prebuilt.py record prebuilt-arm64e
prebuilt-check:
python3 -I -B tools/prebuilt.py check
python3 -I -B tools/prebuilt.py check prebuilt-arm64e
set-check:
bash tools/oc-link-set.sh "$(KEXTINJECT)" "$(BOOT_KC)" $(SET) build/set-check
test:
$(MAKE) -C kext test
$(MAKE) -C rgfxgate test
$(MAKE) -C bundle test
clean:
rm -rf build