From e1d69eaed6a20db936186ea61bbdb1d1cc2cc9e5 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Fri, 19 Jun 2026 16:51:24 +0200 Subject: [PATCH] fix: make kernel verbose with --kernel -v --- src/qemu_vm.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/qemu_vm.rs b/src/qemu_vm.rs index 9f85cf3..0b9e438 100644 --- a/src/qemu_vm.rs +++ b/src/qemu_vm.rs @@ -88,18 +88,24 @@ 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 + // 'quiet' suppresses kernel log messages for a cleaner console (removed with -v) // The init script (added to initramfs) handles hostname, shell, and poweroff + let quiet_flag = if crate::verbose::is_verbose() { + "" + } else { + " quiet" + }; + let kernel_append = if let Some(ref cmd) = config.command { let cmd_str = cmd.join(" "); format!( - "console=ttyS0 quiet ECR_SHELL={} ECR_CMD=\"{}\" ECR_HOSTNAME={}", - shell, cmd_str, hostname + "console=ttyS0{} ECR_SHELL={} ECR_CMD=\"{}\" ECR_HOSTNAME={}", + quiet_flag, shell, cmd_str, hostname ) } else { format!( - "console=ttyS0 quiet ECR_SHELL={} ECR_HOSTNAME={}", - shell, hostname + "console=ttyS0{} ECR_SHELL={} ECR_HOSTNAME={}", + quiet_flag, shell, hostname ) };