From 316a2a239446fe927e35b029b651cbeb08ff3f48 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Nov 2026 15:52:44 +0100 Subject: fs: /bin alias for the system volume MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADR 0006 deferred root-path unification because it "needs VFS bind/alias machinery". Implement the /bin half: paths whose first component is `bin` are rewritten to the first mounted volume whose root has a \bin directory, so `ls /bin/cli`, `cat /bin/cli/x.efi` and a binary's own fs_resolve("/bin/cli/x.efi") work without knowing the volume UID. The alias is transparent — it creates no node, so `ls /` keeps its old listing and /bin simply does not exist when no system volume is mounted — and allocates nothing for non-matching paths. exec::resolve keeps its per-file volume scan (stricter for multiple volumes). Update ADR 0006 to record the decision and what remains deferred (\etc and friends at the root). --- docs/adr/0006-executable-binaries-and-bin-tree.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/adr/0006-executable-binaries-and-bin-tree.md b/docs/adr/0006-executable-binaries-and-bin-tree.md index 17109c4..f3de95f 100644 --- a/docs/adr/0006-executable-binaries-and-bin-tree.md +++ b/docs/adr/0006-executable-binaries-and-bin-tree.md @@ -48,6 +48,14 @@ and so a launcher can enumerate launchable apps by listing a directory. - **Resolution rule.** For name N: run `\bin\\N` from the first mounted volume that has it; else the built-in N; else "unknown command". No volume is privileged; no boot-volume identity exists. +- **`/bin` is a VFS path alias.** User paths whose first component is + `bin` are rewritten (in `fs::resolve`) to the first mounted volume + whose root has `\bin` — so `ls /bin/cli`, `cat /bin/cli/x.efi` and a + binary's own `fs_resolve("/bin/cli/x.efi")` work without knowing the + volume UID. The alias is transparent: it creates no node (`ls /` does + not list `bin`), and without a system volume mounted `/bin` does not + exist. It covers `/bin` only — the rest of root-path unification + stays deferred, but the bind/alias machinery it needed now exists. - **Kind = launch surface.** `/bin/cli` holds programs that run inside a terminal session; `/bin/gui` holds programs launchable with no terminal (they own their windows). A future launcher enumerates `/bin/gui`. @@ -91,7 +99,9 @@ and so a launcher can enumerate launchable apps by listing a directory. through FAT write-back persists across reboots, and the image doubles as the distribution artifact. - **Boot-volume identity / root-path unification** (`\etc` visible at - `/etc`) — deferred; needs VFS bind/alias machinery. + `/etc`) — deferred; needed VFS bind/alias machinery. The `/bin` half + landed as a path alias (see the resolution-rule section); `\etc`, + `\bzImage` etc. at the root stay deferred. - **A third "TUI" binary kind for rsdosedit** — rejected; `edit` is classified CLI (it lives in a terminal session) and migrates only after the CLI ABI grows raw-mode surface access. Until then it stays a -- cgit v1.2.3