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:
+17
-10
@@ -1,8 +1,8 @@
|
||||
//! system/services/fat — the FAT filesystem server. Spawned as a boot service, it
|
||||
//! opens the block device (a USB stick via usb-storage) under `.block`, mounts the
|
||||
//! FAT filesystem on it (the pure engine in engine.zig), and mounts itself into
|
||||
//! the VFS at /mnt/usb. From then on the VFS forwards every open/read/write/
|
||||
//! status/readdir/close under /mnt/usb to this server, which serves the same
|
||||
//! the VFS at /volumes/usb. From then on the VFS forwards every open/read/write/
|
||||
//! status/readdir/close under /volumes/usb to this server, which serves the same
|
||||
//! vfs-protocol as a backend — turning block reads into file reads.
|
||||
//!
|
||||
//! The block data path never crosses IPC: a DMA bounce buffer is handed to the
|
||||
@@ -22,7 +22,7 @@ const engine = @import("engine.zig");
|
||||
const on_disk = @import("on-disk.zig");
|
||||
const vfs_protocol = @import("vfs-protocol");
|
||||
|
||||
const mount_point = "/mnt/usb";
|
||||
const mount_point = "/volumes/usb";
|
||||
|
||||
// The engine's BlockDevice, backed by the `.block` driver plus a DMA bounce
|
||||
// buffer the driver reads/writes by physical address.
|
||||
@@ -144,18 +144,25 @@ fn tryBringUp() void {
|
||||
};
|
||||
std.log.info("mounted FAT ({s}, {d} clusters, partition lba {d})", .{ @tagName(filesystem.geometry.fat_type), filesystem.geometry.cluster_count, filesystem.base_lba });
|
||||
|
||||
// Mount ourselves into the kernel VFS at /mnt/usb — and serve /var from the
|
||||
// volume's /var subtree, so FHS paths (the logger's /var/log) stay decoupled
|
||||
// from which volume carries them.
|
||||
// Mount ourselves into the kernel VFS at /volumes/usb — and serve
|
||||
// /system/configuration and /system/logs from the volume's identically-named
|
||||
// subtrees (the boot volume is hierarchy-shaped, so rewrite == prefix), so
|
||||
// hierarchy paths (the logger's /system/logs) stay decoupled from which
|
||||
// volume carries them.
|
||||
if (file_system.mount(mount_point, endpointForMount())) {
|
||||
std.log.info("mounted {s}", .{mount_point});
|
||||
} else {
|
||||
_ = logging.write("/system/services/fat: could not mount /mnt/usb\n");
|
||||
_ = logging.write("/system/services/fat: could not mount /volumes/usb\n");
|
||||
}
|
||||
if (file_system.mountRewritten("/var", endpointForMount(), "/var")) {
|
||||
std.log.info("mounted /var", .{});
|
||||
if (file_system.mountRewritten("/system/configuration", endpointForMount(), "/system/configuration")) {
|
||||
std.log.info("mounted /system/configuration", .{});
|
||||
} else {
|
||||
_ = logging.write("/system/services/fat: could not mount /var\n");
|
||||
_ = logging.write("/system/services/fat: could not mount /system/configuration\n");
|
||||
}
|
||||
if (file_system.mountRewritten("/system/logs", endpointForMount(), "/system/logs")) {
|
||||
std.log.info("mounted /system/logs", .{});
|
||||
} else {
|
||||
_ = logging.write("/system/services/fat: could not mount /system/logs\n");
|
||||
}
|
||||
mounted = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user