Skip to content

Commit f69a079

Browse files
committed
research: freebsd-livecd-gunion-reroot — experimental architecture plan
Plans a clean-sheet experimental livecd architecture that combines gunion (block-level RAM overlay) with reboot -r reroot, sidestepping the chroot pattern that breaks kernel-context firmware loading on all our existing livecd variants. Marked EXPERIMENTAL — not yet built. Intended as a separate sibling repo (freebsd-livecd-gunion-reroot) so we can iterate without disturbing freebsd-livecd-gunion / freebsd-livecd-unionfs / freebsd-launchd, all of which work today using a chroot pattern. Key technical content: - The kernel-vs-userspace namespace split that breaks firmware loading on all three current livecds (verified empirically on Lenovo with iwlwifi-8000C-36.ucode "File size way too small!"). - The naive gunion+reroot pattern fails because mdconfig holds the rootfs.uzip vnode busy on cd9660; vfs_unmountall() can't unmount, vfs_mountroot() lands in inconsistent state, panic risk. - Two ways to dodge: (A) loader-preload rootfs.uzip into RAM-backed memdisk via loader.conf mfs_load="YES" — mfsBSD canonical pattern; or (B) in-init.sh malloc-md copy + vnode-md detach. A is preferred, B is fallback if loader has size limits. - Why gunion specifically: it's the only writable-everywhere overlay that can be a reroot target. unionfs can't (per unionfs(8) "it is meaningless to mount unionfs over a root mount point"). tmpfs root burns RAM. RO UFS + tmpfs subdirs is the mfsBSD pattern but loses the "everything writable" semantic. - 6 phases: scaffold, loader preload, gunion+reroot in init.sh, firmware-load verification on real hw, CI boot-test extension, comparison vs the symlink trick in freebsd-launchd commit 51e1b80. - 5 documented risks: boot-path regression, loader size limits, gunion perf, RAM floor (600-800MB), half-rerooted state. - 6 open questions, including: does loader preload 400MB cleanly? does shell-as-PID-1 calling reboot -r work? symlink trick vs reroot — which wins on the head-to-head? Linked into FreeBSD Research as a sibling of freebsd-livecd-plan (not nested under launchd subtree — this is a livecd architecture exploration, parallel to existing livecd plans). Whether this gets adopted depends on Phase 5 comparison with the symlink trick. If symlink solves the firmware problem with much less effort, this stays as a reference document. If reroot has meaningful additional benefits, freebsd-launchd may eventually migrate to the same model.
1 parent e080b96 commit f69a079

2 files changed

Lines changed: 444 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)