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.
This commit is contained in:
Daniel Samson
2026-07-10 14:12:05 +01:00
parent 1c2b3ae64d
commit 193fd71a50
+8 -7
View File
@@ -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-<timestamp>.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-<timestamp>.log");
run_efi_step.dependOn(&run_efi.step);
// const run_cmd = b.addRunArtifact(exe);