freebsd-apple-userland-cmds — v3 plan

Porting Apple userland onto freebsd-launchd-mach. Revised 2026-05-26 (v3): the per-tool "port if Apple has integration advantage, skip otherwise" rule is retired. New rule: vendor every Apple userland repo we have open-source for, port all of its binaries, modify as needed to fit FreeBSD. Rationale: anything we don't port from Apple still has to be built from source on the live ISO (FreeBSD-runtime + FreeBSD-utilities are not installed); we'd rather the source live in our src/ tree than be fetched from /usr/src at build time. The same modify-to-fit approach already proved out on OpenPAM (PAM port plan) — vendor + shim layer + patched config.h.

v3 scope at a glance.

Contents

  1. v3 Decisions
  2. Transitional /usr/src gap-filler manifest
  3. Sequencing — when this lands
  4. Scoreboard
  5. bootstrap_cmds
  6. file_cmds audit
  7. shell_cmds audit
  8. system_cmds audit
  9. network_cmds audit
  10. text_cmds audit
  11. adv_cmds audit (NEW in v3)
  12. PowerManagement audit (NEW in v3)
  13. DiskArbitration audit (NEW in v3)
  14. Aggregated port list
  15. Install order in build.sh
  16. Deferred scoping tickets
  17. Risks & known sharp edges
  18. Out of scope

1. v3 Decisions

2. Transitional /usr/src gap-filler manifest

Under v3 the manifest contracts from ~40 entries to the irreducible FreeBSD-kernel-tied set plus the items deferred to scoping tickets. Built per-tool from /usr/src/<dir>/ in the FreeBSD-15 builder chroot via (cd /usr/src/$DIR && make obj && make && make install DESTDIR=$WORK/rootfs MK_MAN=no MK_TESTS=no). Manifest at pkglist-fbsdsrc-manifest.txt in the freebsd-launchd-mach repo.

Category/usr/src directoriesWhy no Apple-vendored replacement (yet)
Kernel module managementsbin/kldload, sbin/kldunload, sbin/kldstat, sbin/kldconfig, usr.sbin/kldxrefApple's equivalents (kextload/kextunload/kextstat from IOKitTools) drive a different loader (IOKit OSKext + kernelmanagerd) and parse .kext bundles, not .ko files. Real port requires vendoring XNU OSKext into mach.ko — see §13.
Memory disksbin/mdconfig, sbin/mdmfsApple's hdiutil/hdik + DiskImages.framework are closed-source. Real port = darling-dmg-style fresh-write — see §13.
GEOM stacksbin/geom (gpart/glabel/gnop/gmirror/graid/geli/gjournal/gcache/…)No Apple analogue exists at any level. CoreStorage was Apple's vaguely-similar block-composition layer but it was never open-sourced and is deprecated for APFS. Future option: vendor FreeBSD source into src/freebsd-vendored/geom/.
devfs rules toolsbin/devfsBoth OSes have devfs; only FreeBSD has a ruleset subsystem (devfs.rules(5)). Apple has no equivalent tool to vendor. Future option: vendor FreeBSD source.
Kernel dumpsbin/dumpon, sbin/savecoreApple kernel cores go through CrashReporter, not a dump device. No equivalent binary or model.
Swapsbin/swapon (installs swapoff)Apple's swap is file-based via dynamic_pager (which IS in system_cmds — we port it). Decommissioning swapon means redesigning the install around swap files + dynamic_pager, not partition swap in /etc/fstab. Deferred until the install-model redesign is scoped.
Filesystem mount & check (deferred — scoping ticket §13)sbin/mount, sbin/umount, sbin/mount_nullfs, sbin/mount_unionfs, sbin/mount_tmpfs, sbin/mount_msdosfs, sbin/mount_cd9660, sbin/fsck, sbin/fsck_ffs, sbin/fsck_msdosfs, sbin/newfs, sbin/newfs_msdos, sbin/tunefsApple historically open-sourced these in diskdev_cmds (~2009 era, pre-UFS-removal). Not yet vendored locally; needs Apple OSS archive fetch + UFS2/SU+J forward-port. Sequenced separately from this plan.
Boot & init (transitional until Phase I3)sbin/initReplaced by launchd-842 as PID 1 at Phase I3; not separately ported from Apple. Drops out once launchd-842 takes over.
Tracing / introspection FreeBSD does its own way(not in manifest — ktrace/kdump/top/vmstat/iostat/ps/pstat/systat/dtrace/dmesg ship via other pkgbase pkgs or are out of scope)Apple's analogues (fs_usage, sc_usage, latency) DO port from system_cmds under v3 (with kdebug stubs). FreeBSD dtrace stays in parallel for the kernel-tracing role.

* FreeBSD-rc is dropped separately — from pkglist-base.txt on 2026-05-16 (launchd replaces /etc/rc); not in the manifest.

Bottom line under v3: manifest entries that are FreeBSD-kernel-tied stay (~13 lines, plus the deferred-pending diskdev_cmds rows ~13 more = ~26 lines transitional). All POSIX-equivalent CLI work that v1/v2 had in the manifest (POSIX file ops, POSIX shell tools, sysctl/login/getty) leaves the manifest and gets covered by Apple-vendored repo ports below.

3. Sequencing — when this lands

The Apple-userland-cmds port list + the transitional gap-filler manifest are deferred until the high-iteration daemon ports inside freebsd-launchd-mach stabilize. The daemon ports iterate heavily (often 4–6 CI rounds per iter); adding 9-repo userland-cmds churn on top is unnecessary drag.

Order of operations:

  1. Finish the daemon roadmap. Configd remaining iters, IPConfiguration iter 7+ (RA/SLAAC, DHCPv6, ipconfig(8) CLI), mDNSResponder port, notifyd, ASL, DiskArbitration daemon side, any other Phase K daemon work.
  2. Bootstrap MIG. Build + install Apple's mig + migcom from bootstrap_cmds (zero conflict; pure addition).
  3. Drop FreeBSD-runtime + FreeBSD-utilities from pkglist-base.txt. One PR. Boot will break until step 4 lands.
  4. Land pkglist-fbsdsrc-manifest.txt + the build.sh iteration step (the contracted v3 manifest, ~26 lines). Boot green at the end of this step.
  5. Iterate through the 9-repo Apple port list per §15, in the order in §15. Per-repo PR; per-tool CI smoke marker. Each binary either compiles + tests clean at its canonical path or doesn't — no overwrite dance.
  6. Deferred scoping tickets (hdiutil, diskdev_cmds, kext substrate; §16) land in later phases. Manifest shrinks further as each lands.

4. Scoreboard

RepoBinariesv3 verdictKey Apple-specific integration to preserve / shim
bootstrap_cmds~4 filesPORT allMIG. Pre-req for every MIG-using daemon.
file_cmds27PORT allACL + xattr + clonefile + fcopyfile preservation across cp/mv/ls/install/gzip/pax.
shell_cmds~45PORT allOpen Directory (id, libopendirectory shim), BSM audit (su), KERN_PROCARGS2 (killall).
system_cmds~50PORT allMach IPC introspection (lsmp/hostinfo/stackshot), IOKit NVRAM (nvram), launchd-coordinated reboot/shutdown, BSM audit (login), kdebug stubs (fs_usage/sc_usage/latency), dynamic_pager swap, getty, sysctl, dmesg.
network_cmds15PORT allSystemConfiguration parity (configd consumes this output), IFSCOPE routing, LQM, IPv6 secure ND, kdumpd launchd-managed-socket-activation worked example.
text_cmds34PORT allsort uses Mach semaphores for parallelism. Rest are POSIX stream processors (pure vendor).
adv_cmds15PORT allNEW in v3. pkill/ps with macOS proc-info layout, stty/tty, locale tools, finger/last/whois, lsvfs, cap_mkdb, gencat, tabs.
PowerManagement~6PORT allNEW in v3. pmset/pmtool/caffeinate/pmconfigd/ioupsd/swd. Drives IOPMLib (which reboot/shutdown also use). Heavy IOKit stubs.
DiskArbitration~4PORT allNEW in v3. diskarbitrationd, autodiskmount, DiskArbitrationAgent, datest. DiskArbitration.framework is the system-service consumer for hdiutil/diskutil events — daemon-side port is independent of those userland tools.
Total~155

Per-binary audit detail follows in §5–§13. The audit columns ("Apple-stack integration", "Apple-specific feature", file:line citations) are still authoritative as the rationale for what to preserve / shim in each port; the SKIP / PARTIAL pills in those tables are historical (v1/v2 verdicts) and superseded by the all-PORT scoreboard above.

5. bootstrap_cmds — install table

Apple binarySource pathFreeBSD path todayInstall pathConflict
migxcodescripts/install-mig.sh(not present)/usr/bin/mignone
migcommigcom.tproj/(not present)/usr/libexec/migcomnone
mig.1, migcom.1migcom.tproj/*.1(not present)/usr/share/man/man1/none

Zero conflicts; pure addition. Smoke marker: MIG-BUILD-OKmig --help exits 0, migcom emits help on stderr.

6. file_cmds audit

Note: SKIP / PARTIAL pills below are v1/v2 audit verdicts; v3 ports all binaries. Audit-rationale columns still apply as porting context.

BinaryApple-stack integrationApple-specific featureFreeBSD pathv1/v2 verdict
cpfcopyfile, clonefile, ACL + xattr (cp/utils.c:138-491)APFS clonefile COW; resource-fork + ACL preservation/bin/cpPORT
chmodApple libacl (chmod_acl.c:121-854)Extended ACL manipulation/bin/chmodPORT
lsgetxattr, acl_get_link_np, SF_DATALESSACL display (-e), xattr count, dataless-file awareness/bin/lsPORT
mvfcopyfile for ACL+xattrCross-FS move preserves permissions+xattr/bin/mvPORT
installfcopyfile ACL+xattrACL preservation in install(1)/usr/bin/installPORT
gzipfgetattrlist, fsetattrlist, fcopyfilePreserves ACLs+xattrs across compression/usr/bin/gzipPORT
paxfcopyfile, setattrlistPrecise timestamp + ACL+xattr in archives/bin/paxPORT
dfgetattrlist for ATTR_VOL_SPACEUSEDVolume metadata without traversal/bin/dfPARTIAL
dugetattrlist for SF_DATALESSAccurate dataless-file accounting/usr/bin/duPARTIAL
mtreelibdispatchGCD-parallel hashing/usr/sbin/mtreePARTIAL
17 others
chflags, chown, cksum, compress, dd, ipcrm, ipcs, ln, mkdir, mkfifo, mknod, pathchk, rm, rmdir, shar, stat, touch, truncate, xattr
None — pure POSIXStandard POSIXvariousSKIP

Driver: Apple's cp/mv/ls/install/gzip/pax preserve ACLs + extended attributes + APFS clonefile semantics through file operations. clonefile(2) is APFS-only; on FreeBSD UFS/ZFS it falls back to byte-copy — benign. xattr: Apple's xattr(2) API diverges from FreeBSD's extattr(2); shim layer maps the calls in our libSystem.

Risks: libacl + libdispatch dependencies. We already ship libdispatch (/usr/lib/system/libdispatch.so); libacl shim needed.

7. shell_cmds audit

Note: SKIP / PARTIAL pills below are v1/v2 audit verdicts; v3 ports all binaries.

BinaryApple-stack integrationApple-specific featureFreeBSD pathv1/v2 verdict
idCoreFoundation + Open DirectoryOD-backed identity lookups for enterprise LDAP/NIS/usr/bin/idPORT
suBSM audit sessionAudit-session-aware privilege escalation/usr/bin/suPORT
path_helperNone (file I/O only)Reads /etc/paths + /etc/paths.d/ to build PATH(not present)PARTIAL
killallKERN_PROCARGS2 sysctlFull-argv match vs FreeBSD's truncated ki_comm/usr/bin/killallPARTIAL
~40 others
basename, chroot, date, dirname, echo, env, expr, false, find, getopt, hexdump, hostname, jot, kill, lastcomm, lockf, logname, mktemp, nice, nohup, printenv, printf, pwd, realpath, renice, script, seq, sh, shlock, sleep, stdbuf, tee, test, time, true, tty, uname, w, who, xargs, yes, …
NoneStandard POSIXvariousSKIP

Risk callout: Apple id requires libopendirectory, which has no FreeBSD equivalent. Ship a no-op libopendirectory shim and let id fall back to /etc/passwd. Real OD work is a separate, far-future phase.

8. system_cmds audit

Note: SKIP / PARTIAL pills below are v1/v2 audit verdicts; v3 ports all binaries.

This is the most Mach-IPC-heavy of the in-scope repos. Many ports depend on new mach.ko traps (see callout below).

BinaryApple-stack integrationApple-specific featureFreeBSD pathv1/v2 verdict
lsmpMach IPC introspection (task_read_for_pid, mach_port_space_info)Mach port enumeration — no FreeBSD equivalent(not present)PORT
hostinfoMach: host_info HOST_BASIC_INFO, processor setsReports Mach kernel version, processor-set state(not present)PORT
nvramIOKit (IORegistry, IORegistryEntryCreateCFProperty)Firmware-parameter R/W via IOKit(not present)PORT
stackshotMach + stackshot syscallKernel stack snapshots(not present)PORT
lskqEVFILT_MACHPORT in kqueueMach-aware kqueue analysis/usr/bin/lskqPARTIAL
rebootBootstrap + IOKit kextmanagerlaunchd-coordinated reboot, kext locking/sbin/rebootPARTIAL
shutdownIOKit IOPMLib + BSM auditPower-management-aware shutdown, audit-logged/sbin/shutdownPARTIAL
haltIOPMLib stubsPower-management-aware halt/sbin/haltSKIPnow PORT
gcoreMach-image introspectionCore dumps with Mach thread-state notes/usr/bin/gcorePARTIAL
loginBSM auditAudit-aware session creation/bin/loginPARTIAL
taskpolicyMach task_policy_set/getQoS + CPU-limit management/usr/bin/taskpolicyPARTIAL
gettyBSM audit (modest)Audit-aware tty login spawn/usr/libexec/gettySKIPnow PORT
sysctlNone significantPOSIX-style sysctl(8); Apple-shape options/sbin/sysctlSKIPnow PORT
dmesgNone significantkmsg buffer reader/sbin/dmesgSKIPnow PORT
dynamic_pagerMach + vnode pagerSwap-file pager (Apple's swap model)(not present)SKIPnow PORT (also unlocks future swapon retirement)
fs_usage, sc_usage, latencykdebug + Mach timingkdebug-based tracingvariousSKIPnow PORT (with no-op kdebug stubs)
kpgo, memory_pressure, vm_stat, vm_purgeable_statApple-only kernel features (PGO, jetsam, purgeable VM)n/a on FreeBSDvariousSKIPnow PORT (stub returns “feature not available” gracefully)
~20 others
ac, accton, arch, at, atrun, chkpasswd, chpass, cpuctl, getconf, iosim, iostat, ltop, mean, mkfile, mslutil, newgrp, nologin, pagesize, passwd, proc_uuid_policy, purge, pwd_mkdb, sa, sync, vifs, vipw, wait4path, wordexp-helper, zdump, zic
None or trivialStandard POSIX / BSD heritagevariousSKIPnow PORT

Kernel-side mach.ko work this implies.

The trap-based items fit our existing multiplexer slot 219 pattern. IOKit NVRAM and dynamic_pager are separate, much bigger tracks.

9. network_cmds audit

Note: SKIP / PARTIAL pills below are v1/v2 audit verdicts; v3 ports all binaries.

Highest port ratio in v1/v2 (10/15); under v3 all 15. These tools are the system-of-record for network state that configd reads. Apple-shaped output is required for the SC store.

BinaryApple-stack integrationApple-specific featureFreeBSD pathv1/v2 verdict
ifconfigIFEF_* flags, LQMAWDL/cellular/companion interface types, LQM quality state/sbin/ifconfigPORT
routeRTF_IFSCOPE parsingInterface-scoped routes, RTF_PINNED/RTF_IFREF/sbin/routePORT
arpIFSCOPE, IFNET_LQM_THRESH_*Interface-scoped ARP for multi-homed mDNS/usr/sbin/arpPORT
ndpND6_IFF_* flags, prefix list sysctlSEND (secure ND), proxy prefixes, NUD state machine/usr/sbin/ndpPORT
pingIP_NO_IFT_CELLULAR, DSCP markingCellular exclusion, QoS class/sbin/pingPORT
ping6IPV6_NO_IFT_CELLULAR, DSCP markingIPv6 variant of ping with cellular/QoS/sbin/ping6 (symlink)PORT
rtadvdRDNSS/DNSSL + PVD configIPv6 prefix advertisement with Apple extras/usr/sbin/rtadvdPORT
rtsolIPv6 router-solicitation daemonAuto IPv6 prefix solicitation/usr/sbin/rtsoldPORT
kdumpdlaunchd plist + socket activationEstablishes launchd-managed-daemon pattern(not present)PORT
netstatLQM thresholds, NSTAT cellular link statusLQM + cellular display/usr/bin/netstatPARTIAL
tracerouteNoneNone Apple-specific/usr/sbin/tracerouteSKIPnow PORT
traceroute6NoneNone Apple-specific/usr/sbin/traceroute6SKIPnow PORT
dnctlApple dummynet controlApple-specific QoS scheduling(not present)SKIPnow PORT (FreeBSD has its own ipfw-dummynet; Apple's dnctl ships as a separate diagnostic tool)
rarpdNoneLegacy RARP server(not present)SKIPnow PORT
sprayNoneSun-RPC bandwidth measurement(not present)SKIPnow PORT

Driver: SystemConfiguration parity. configd's job is to read ifconfig -a, route -n get, ndp -pr, arp -a, netstat -i output and turn it into the SC store. kdumpd's launchd plist is the worked example for launchd-managed-socket-activation we copy when adding ntpd, mDNSResponder, etc.

10. text_cmds audit

Note: SKIP pill below is v1/v2 audit verdict; v3 ports all binaries.

BinaryApple-stack integrationApple-specific featureFreeBSD pathv1/v2 verdict
sortMach semaphoresMulti-threaded sort via Mach IPC/usr/bin/sortPORT
33 others
banner, bintrans, cat, col, colrm, column, comm, csplit, cut, ed, expand, fmt, fold, grep, head, jq, join, lam, look, md5, nl, paste, pr, rev, rs, sed, split, tail, tr, ul, unexpand, uniq, unvis, vis, wc, …
None — POSIX stream processorsLocale and encoding edge cases onlyvariousSKIPnow PORT

11. adv_cmds audit (NEW in v3)

Not in v1/v2 plan; added in v3. Sister repo to shell_cmds containing 15 more userland tools, several with Apple-specific integration.

BinaryApple-stack integration / noteFreeBSD pathv3 verdict
pkillMach + macOS proc-info layout/bin/pkillPORT
psMach + macOS proc-info layout; -Z for sandbox label/bin/psPORT
sttyBSD; Apple keeps minor option additions/bin/sttyPORT
ttyPOSIX/usr/bin/ttyPORT
fingerBSD heritage/usr/bin/fingerPORT
lastBSD; reads /var/log/wtmp/usr/bin/lastPORT
whoisBSD/usr/bin/whoisPORT
localeApple locale database layout/usr/bin/localePORT
localedefApple locale database layout/usr/bin/localedefPORT
cap_mkdbBSD termcap-style DB/usr/bin/cap_mkdbPORT
gencatPOSIX catopen(3)/usr/bin/gencatPORT
genwrapApple build helper/usr/bin/genwrapPORT
lsvfsVFS-mount-table introspection (Apple-shape)/usr/sbin/lsvfsPORT
tabsPOSIX terminal control/usr/bin/tabsPORT
colldefLocale collation-rule compiler/usr/bin/colldefPORT

Driver: consistency with the other "shell-like" repos. ps/pkill matter most — they read macOS-shape kinfo_proc layout; FreeBSD's layout differs, so without these the rest of the userland gets confused-looking ps output. locale/localedef matter for the locale database to match Apple's expected paths.

12. PowerManagement audit (NEW in v3)

Not in v1/v2 plan; added in v3. Daemon (pmconfigd) + CLIs that drive IOPMLib.

BinaryApple-stack integrationInstall pathv3 verdict
pmsetIOPMLib (config R/W); SCDynamicStore/usr/bin/pmsetPORT
pmtoolIOPMLib diagnostics / scheduling/usr/bin/pmtoolPORT
caffeinateIOPMAssertion API (prevent-sleep)/usr/bin/caffeinatePORT
pmconfigdLong-running daemon, IOKit notification consumer/usr/libexec/pmconfigdPORT
ioupsdUPS protocol over HID/usr/libexec/ioupsdPORT
swdSystem watchdog / panic handler/usr/libexec/swdPORT

Driver: reboot and shutdown (from system_cmds) both link IOPMLib; we already need IOPMLib stubs for those. Porting the PowerManagement repo's CLIs costs little extra given the shared dep, and gives us Apple-shape power UX.

Risk: IOPMLib stubs need to cover the breadth of pmset commands (sleep schedules, hibernate modes, display assertions). Mostly stub-to-no-op acceptable on FreeBSD; real power management can come later as a separate phase.

13. DiskArbitration audit (NEW in v3)

Not in v1/v2 plan; added in v3. Daemon + agent + test tool. Independent of hdiutil/diskutil (those are the CLI consumers; this is the framework + daemon).

BinaryApple-stack integrationInstall pathv3 verdict
diskarbitrationdIOKit disk-arrival events → mount dispatcher; launchd-managed/usr/libexec/diskarbitrationdPORT
autodiskmountAuto-mounter (consumes DA events)/usr/sbin/autodiskmountPORT
DiskArbitrationAgentPer-user agent for DA events/System/Library/CoreServices/DiskArbitrationAgentPORT
datestDA test harness/usr/bin/datestPORT

Driver: DiskArbitration is the framework Apple-shape userland consumers (Finder, hdiutil, diskutil, etc.) use for mount/unmount/eject coordination. Porting it now means we have the framework ready when hdiutil/diskutil scoping tickets land later.

Risk: needs IOKit disk-arrival events from mach.ko — or a FreeBSD-devd bridge that emits the same notifications. Bridge work is meaningful but tractable.

14. Aggregated port list

~155 binaries across 9 repos, ordered for build pipeline integration (full per-binary list in source-tree manifest; summary here):

PhaseRepo (count)What lands
1bootstrap_cmds (4)mig + migcom + man pages. Zero conflict.
2network_cmds (15)All 15. Heavy ABI-drift risk on ifconfig/route/netstat — Apple struct fields not in FreeBSD will fail gracefully.
3file_cmds (27)All 27. libdispatch + libacl shims.
4shell_cmds (~45)All ~45. libopendirectory shim for id.
5adv_cmds (15)All 15. ps/pkill need kinfo_proc shim layer.
6text_cmds (34)All 34. sort needs Mach semaphores; others are pure POSIX.
7system_cmds (~50)All ~50. Heaviest Mach trap dependency — some tools wait on mach.ko traps landing first (lsmp/hostinfo/stackshot/dynamic_pager). IOPMLib shim covers reboot/shutdown/halt.
8PowerManagement (~6)All ~6. IOPMLib already shimmed from system_cmds work.
9DiskArbitration (~4)All ~4. Daemon + agent + autodiskmount. Needs IOKit disk-arrival event bridge.

15. Install order in build.sh

Pre-req: all freebsd-launchd-mach daemon ports (configd remaining iters, IPConfiguration iter 7+, mDNSResponder, notifyd, ASL, …) shipped.

  1. pkg install the trimmed pkgbase set (FreeBSD-runtime + FreeBSD-utilities removed; FreeBSD-clibs, FreeBSD-rescue, FreeBSD-ufs, FreeBSD-geom, … remain).
  2. Build the v3 contracted gap-filler manifest from /usr/src (~13 lines + ~13 deferred = ~26 lines transitional). Marker FBSDSRC-MANIFEST-OK. Boot test green at this point.
  3. Build bootstrap_cmds; install mig + migcom. Marker MIG-BUILD-OK. May move earlier if a daemon port needs it — pure addition, zero conflict.
  4. Run mig against launchd-842's seven .defs files; cache output.
  5. Build + install network_cmds (15 binaries). Per-tool smoke markers: NETCMD-IFCONFIG-OK, …
  6. Build + install file_cmds (27). Markers FILECMD-CP-OK, …
  7. Build + install shell_cmds (~45). Ship libopendirectory shim; id falls back to /etc/passwd.
  8. Build + install adv_cmds (15). Ship kinfo_proc-shape shim; ps/pkill read FreeBSD's layout via the shim.
  9. Build + install text_cmds (34).
  10. Build + install system_cmds (~50). Defer lsmp/hostinfo/stackshot binaries that need new mach.ko traps; everything else lands now.
  11. Build + install PowerManagement (~6). IOPMLib shim already in place from system_cmds.
  12. Build + install DiskArbitration (~4). Needs IOKit disk-arrival event bridge (or stub).
  13. Backfill mach.ko traps for the Mach-IPC-deep system_cmds binaries (lsmp, hostinfo, stackshot); rebuild those.

16. Deferred scoping tickets

Three workstreams the v3 plan explicitly defers. Each gets its own scoping ticket in the repo, sequenced after the 9-repo port roadmap stabilizes.

WorkstreamApple-source statusWhat deferral meansScoping ticket scope
hdiutil / hdik / DiskImages.frameworkClosed-source. Apple never published.Live ISO uses mdconfig from /usr/src. No hdiutil-shape CLI shipped.Compare three paths: (a) fresh-write Apple-shape CLI in src/hdiutil/ matching man-page semantics, drives md(4); (b) vendor darling-dmg (GPL-3.0, read-only, FUSE-based); (c) hybrid — fresh-write front-end + darling-dmg-shaped DMG parser. License + scope tradeoff.
diskdev_cmds (mount/fsck/newfs family)Apple-open, not vendored locally. Need fetch from Apple OSS archive (~2009 era, pre-UFS-removal).Live ISO uses FreeBSD mount/fsck/newfs from /usr/src. Manifest carries ~13 transitional rows.Fetch + vendor + UFS2/SU+J/snapshot forward-port. Largest port of the three. Maybe additionally include Apple's mount(8) front-end with FreeBSD mount_<fs> back-ends as a smaller intermediate step.
kextload / kext loader substrateApple-open (IOKitTools, needs fetching); kernel substrate is XNU OSKext.Live ISO uses kldload from /usr/src to load mach.ko and all FreeBSD modules.Vendor XNU OSKext + IOCatalogue + IOKextLib into mach.ko. Vendor kextload/kextunload/kextstat/kmutil from IOKitTools. Decide whether to also repackage existing FreeBSD .ko modules (if_em, ums, …) as .kext bundles, or keep kldload as a parallel loader.

17. Risks & known sharp edges

ABI drift between Apple and FreeBSD kernel structs

Worst in ifconfig, netstat, route, arp, ndp, ps, pkill. Apple extends struct ifreq, struct ifmediareq, struct rt_msghdr, kinfo_proc; some Apple ioctls don't exist on FreeBSD. Apple-only feature paths fail gracefully (ioctl returns -1, flag never set).

Stub libraries we'll need to ship

Aggregated across the 9 repos: libopendirectory (no-op fallback to /etc/passwd; id), IOPMLib (mostly no-op stubs; reboot/shutdown/halt/pmset/caffeinate/pmconfigd), libacl (BSD POSIX.1e bridge; chmod/ls/cp/install/mtree), BSM audit (no-op stub; su/login/shutdown/getty), kdebug (no-op stub; fs_usage/sc_usage/latency), kinfo_proc shim (Apple-shape over FreeBSD's; ps/pkill). Most are <100 LOC each; lean on the OpenPAM-style shim pattern.

Mach traps needed before system_cmds Tier B lands

4 new traps for lsmp + hostinfo + stackshot (port-space introspection, host info flavors, stackshot syscall). All fit the multiplexer slot 219 pattern; ~600 LOC of mach.ko work. nvram needs an IOKit NVRAM driver — separate track. dynamic_pager needs vnode-pager hooks — another separate track.

IOKit disk-arrival event bridge for DiskArbitration

diskarbitrationd consumes IOKit disk-arrival/removal events. On FreeBSD this needs either (a) a real IOKit event source from mach.ko, or (b) a devd bridge that translates FreeBSD devd events into IOKit-shape notifications. Stub-first: ship the daemon, get it running, file follow-up for the event bridge.

CI time impact of the 9-repo port pass

Per-repo build + per-tool smoke marker adds substantially to CI run time once the workstream is active. Mitigation is sequencing (§3): land after the daemon roadmap, not during. Inside the workstream, group per-repo PRs so CI runs full-marker pass once per repo, not per binary.

/usr/src availability on the builder

The transitional manifest assumes /usr/src on the builder chroot. Already there for kmod compiles; just adding new directories.

Sequencing fragility around deferred items

If we never get to the deferred-scoping tickets, the transitional manifest stays. That's OK — the 9-repo port is independently valuable; deferred items are quality-of-life rather than blocking.

18. Out of scope (truly)

Drafted 2026-05-13 (v1). Revision 2026-05-23 (v2): Option C (drop FreeBSD-runtime + FreeBSD-utilities, build per-tool from /usr/src). Revision 2026-05-26 (v3): retired the per-binary "port if Apple has integration advantage, skip otherwise" rule; new rule is "vendor every Apple userland repo we have open-source for, port all binaries, modify as needed." Scope expanded from 6 to 9 repos (adv_cmds, PowerManagement, DiskArbitration added). Apple-closed-source items (hdiutil/diskutil) and Apple-open-but-not-vendored items (diskdev_cmds, IOKitTools kext loader) split off to §16 scoping tickets. Per-tool SKIP / PARTIAL pills in §6–§10 audit tables are historical (v1/v2) and superseded by the §4 all-PORT scoreboard.