From 8875bcc92a8a9ad0d3558f86e2321e92322483a6 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Tue, 16 Jun 2026 22:07:28 +0200 Subject: [PATCH] feat: do not display kernel logs with --kernel --- SPEC.md | 2 +- src/qemu_vm.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SPEC.md b/SPEC.md index 6026d57..4d9d067 100644 --- a/SPEC.md +++ b/SPEC.md @@ -205,7 +205,7 @@ ecr --kernel /boot/vmlinuz debian -- /bin/sh -c "echo hello" 4. Launch QEMU with: - `-kernel ` - provided kernel - `-initrd initramfs.cpio.gz` - rootfs as initramfs - - `-append "console=ttyS0 rdinit=/bin/sh"` - kernel command line + - `-append "console=ttyS0 quiet rdinit=/bin/sh"` - kernel command line - `-m ` - memory size (default 2G) - `-display none -serial mon:stdio` - console on stdio - `-netdev user,id=net0 -device virtio-net-pci,netdev=net0` - network diff --git a/src/qemu_vm.rs b/src/qemu_vm.rs index a3f998f..f384ee9 100644 --- a/src/qemu_vm.rs +++ b/src/qemu_vm.rs @@ -56,15 +56,16 @@ pub fn launch_qemu(config: QemuConfig) -> Result<()> { // Build kernel command line // For initramfs boot, use rdinit= instead of init= // No root= needed as initramfs becomes the rootfs + // 'quiet' suppresses kernel log messages for a cleaner console let kernel_append = if let Some(ref cmd) = config.command { let cmd_str = cmd.join(" "); format!( - "console=ttyS0 rdinit=/bin/sh -- -c \"{}\"", + "console=ttyS0 quiet rdinit=/bin/sh -- -c \"{}\"", cmd_str ) } else { // Default to interactive shell - "console=ttyS0 rdinit=/bin/sh".to_string() + "console=ttyS0 quiet rdinit=/bin/sh".to_string() }; veprintln!("Launching QEMU: {}", qemu_bin);