From 193fd71a50b8d59b23cff19e2671f6de65715653 Mon Sep 17 00:00:00 2001 From: Daniel Samson <12231216+daniel-samson@users.noreply.github.com> Date: Fri, 10 Jul 2026 14:12:05 +0100 Subject: [PATCH] Keep the QEMU serial log in qemu-test, not the FHS boot volume The serial capture is a dev/host artifact, so it lands in the qemu-test scratch area rather than inside zig-out (which we mount as the boot volume). /var/log/system stays reserved for the kernel's own logging system later. --- build.zig | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig index b9ee50b..f2bb3be 100644 --- a/build.zig +++ b/build.zig @@ -372,18 +372,19 @@ pub fn build(b: *std.Build) void { "-device", "VGA,edid=on,xres=1280,yres=720", }); - // Capture the guest's serial0 (danos's machine-readable log) to the FHS log - // location, /var/log/system — a stand-in for the kernel's own logging system, - // which will one day write here itself. One timestamped file per run. - const log_dir = b.fmt("{s}/var/log/system", .{b.install_path}); + // Capture the guest's serial0 (danos's machine-readable log) to the qemu-test + // scratch area — a dev/host artifact, kept out of the FHS boot volume we mount. + // (/var/log/system is reserved for the kernel's own logging system later.) One + // timestamped file per run. + const log_dir = b.fmt("{s}/qemu-test", .{b.install_path}); const make_log_dir = b.addSystemCommand(&.{ "mkdir", "-p", log_dir }); - const serial_log = b.fmt("{s}/serial0-{s}.log", .{ log_dir, timestamp(b) }); + const serial_log = b.fmt("{s}/run-x86-64-serial0-{s}.log", .{ log_dir, timestamp(b) }); run_efi.addArgs(&.{ "-serial", b.fmt("file:{s}", .{serial_log}) }); - // The whole FHS zig-out must be installed (and the log dir created) before we mount it. + // The whole FHS zig-out must be installed (and the scratch dir created) before we mount it. run_efi.step.dependOn(b.getInstallStep()); run_efi.step.dependOn(&make_log_dir.step); - const run_efi_step = b.step("run-x86-64", "Boot the x86-64 kernel in QEMU (UEFI/OVMF); serial0 is logged to zig-out/var/log/system/serial0-.log"); + const run_efi_step = b.step("run-x86-64", "Boot the x86-64 kernel in QEMU (UEFI/OVMF); serial0 is logged to zig-out/qemu-test/run-x86-64-serial0-.log"); run_efi_step.dependOn(&run_efi.step); // const run_cmd = b.addRunArtifact(exe);