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:
@@ -372,18 +372,19 @@ pub fn build(b: *std.Build) void {
|
|||||||
"-device",
|
"-device",
|
||||||
"VGA,edid=on,xres=1280,yres=720",
|
"VGA,edid=on,xres=1280,yres=720",
|
||||||
});
|
});
|
||||||
// Capture the guest's serial0 (danos's machine-readable log) to the FHS log
|
// Capture the guest's serial0 (danos's machine-readable log) to the qemu-test
|
||||||
// location, /var/log/system — a stand-in for the kernel's own logging system,
|
// scratch area — a dev/host artifact, kept out of the FHS boot volume we mount.
|
||||||
// which will one day write here itself. One timestamped file per run.
|
// (/var/log/system is reserved for the kernel's own logging system later.) One
|
||||||
const log_dir = b.fmt("{s}/var/log/system", .{b.install_path});
|
// 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 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}) });
|
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(b.getInstallStep());
|
||||||
run_efi.step.dependOn(&make_log_dir.step);
|
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);
|
run_efi_step.dependOn(&run_efi.step);
|
||||||
|
|
||||||
// const run_cmd = b.addRunArtifact(exe);
|
// const run_cmd = b.addRunArtifact(exe);
|
||||||
|
|||||||
Reference in New Issue
Block a user