build: the unix paths retire — configuration, logs, and volumes move into the danos tree

/etc/init.csv and /etc/devices.csv become /system/configuration/*.csv (the
repo's etc/ moves to system/configuration/, mirroring the runtime tree),
/var/log becomes /system/logs, and /mnt/usb becomes /volumes/usb. The
kernel VFS gains a carve-out so FAT may serve exactly /system/configuration
and /system/logs beneath the initrd-backed /system while /system and /test
themselves stay unshadowable; FAT's single /var mount splits into those two
rewritten mounts. The kvfs readdir check learns /system's third child and
the ramdisk spawn sweep skips the configuration tree.

Suite 106/106.
This commit is contained in:
Daniel Samson
2026-07-31 19:41:35 +01:00
parent e4da4e0610
commit c4f16a5448
31 changed files with 161 additions and 128 deletions
+12 -10
View File
@@ -115,7 +115,8 @@ fn driverArtifact(comptime package: []const u8, comptime artifact: []const u8) S
/// The production ship table — what a plain `zig build` image contains,
/// beyond the specials the build fn adds around it (init, discovery, the
/// /etc data files; the /test fixtures join only under -Dtest-case).
/// /system/configuration data files; the /test fixtures join only under
/// -Dtest-case).
/// Selecting what goes into a build = selecting rows: a package in no row is
/// not just unshipped, its build file is never even loaded
/// (docs/build-packages-plan.md).
@@ -265,9 +266,9 @@ pub fn build(b: *std.Build) void {
// (receives the root's -Dserial as a dependency option — its liveness
// heartbeat is a serial/test-build diagnostic the QEMU harness asserts
// on; a flashable image leaves it out), discovery (the -Ddiscovery pick),
// and the /etc data files. Each binary builds itself against the domain
// packages via build-support's shared recipe; the root just takes
// artifacts (docs/build-packages-plan.md).
// and the /system/configuration data files. Each binary builds itself
// against the domain packages via build-support's shared recipe; the root
// just takes artifacts (docs/build-packages-plan.md).
var bundled_list: std.ArrayListUnmanaged(images.BundledBinary) = .empty;
bundled_list.append(b.allocator, .{
.path = "system/services/init",
@@ -300,15 +301,16 @@ pub fn build(b: *std.Build) void {
.binary = b.dependency(row.package, .{}).artifact(row.artifact).getEmittedBin(),
}) catch @panic("OOM");
}
// Data files, not binaries: packing them under /etc makes the kernel
// auto-mount /etc as a read-only initrd tree (system/kernel/vfs.zig
// Data files, not binaries: packing them under /system/configuration rides
// the kernel's read-only initrd mount of /system (system/kernel/vfs.zig
// setInitialRamdisk) — the device manager reads its registry and init its
// service list with no filesystem service running. -Ddiagnose selects the
// init.csv variant that omits the display stack (so the kernel's boot
// transcript stays on screen); both bundle at the same /etc/init.csv path.
const init_csv_source = if (diagnose) "etc/init-diagnose.csv" else "etc/init.csv";
bundled_list.append(b.allocator, .{ .path = "etc/devices.csv", .binary = b.path("etc/devices.csv") }) catch @panic("OOM");
bundled_list.append(b.allocator, .{ .path = "etc/init.csv", .binary = b.path(init_csv_source) }) catch @panic("OOM");
// transcript stays on screen); both bundle at the same
// /system/configuration/init.csv path.
const init_csv_source = if (diagnose) "system/configuration/init-diagnose.csv" else "system/configuration/init.csv";
bundled_list.append(b.allocator, .{ .path = "system/configuration/devices.csv", .binary = b.path("system/configuration/devices.csv") }) catch @panic("OOM");
bundled_list.append(b.allocator, .{ .path = "system/configuration/init.csv", .binary = b.path(init_csv_source) }) catch @panic("OOM");
// A no-option build assumes neither -Dtest-case nor -Ddiagnose: it ships the
// production set only. The userspace test fixtures under /test join in only
// for a test build — which the QEMU harness signals by passing