The storage layer gains its policy home (storage-architecture.md): a new system/services/volume-manager, spawned by init, that acquires the mass- storage block channel through the device manager (the same lineage a filesystem uses), reads block 0, and parses the first volume out of it. The partition-table walk that lived in the FAT engine moves here, above the driver where it belongs (partition.zig, host-tested: MBR entry, bare-FAT, no-signature). Identity is the MBR disk signature + partition index — the weak rung of the ladder; GPT GUID and FAT serial refine identityOf without changing shape. This increment is discovery + probe + log only, additive: the FAT service still acquires its own volume, so nothing changes for it. Confining each filesystem to its partition and spawning one per volume (the flip) lands next, keeping fat working throughout. Grants + wiring: init.csv spawns it after the device manager; protocol.csv grants bind volume-manager + open device-manager. Verified: volume-probe asserts the parse (bare-FAT volume at lba 0), neutral 10/10 across storage, restart, display, logging, confinement — the volume manager now runs in every boot and disturbs nothing.
31 lines
1.2 KiB
Zig
31 lines
1.2 KiB
Zig
//! The volume-manager service as a binary package (docs/build-packages-plan.md):
|
|
//! this file names the binary and EXACTLY the modules its source imports —
|
|
//! build-support resolves each name from the domains this zon declares.
|
|
|
|
const std = @import("std");
|
|
const build_support = @import("build-support");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const exe = build_support.userBinary(b, .{
|
|
.name = "volume-manager",
|
|
.root_source_file = b.path("volume-manager.zig"),
|
|
.imports = &.{
|
|
"block", "channel", "device-manager-protocol", "driver",
|
|
"envelope", "ipc", "logging", "memory",
|
|
"process", "service", "time",
|
|
},
|
|
});
|
|
b.installArtifact(exe);
|
|
|
|
// Standalone `zig build test` for the partition parser; the root build keeps
|
|
// its aggregate test step.
|
|
const test_step = b.step("test", "Run the partition-parser unit tests");
|
|
const tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("partition.zig"),
|
|
.target = b.resolveTargetQuery(.{}),
|
|
}),
|
|
});
|
|
test_step.dependOn(&b.addRunArtifact(tests).step);
|
|
}
|