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);