fix: make kernel verbose with --kernel -v

This commit is contained in:
2026-06-19 16:51:24 +02:00
parent 3188566b6e
commit e1d69eaed6
+11 -5
View File
@@ -88,18 +88,24 @@ pub fn launch_qemu(config: QemuConfig) -> Result<()> {
// Build kernel command line // Build kernel command line
// For initramfs boot, use rdinit= instead of init= // For initramfs boot, use rdinit= instead of init=
// No root= needed as initramfs becomes the rootfs // 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 // 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 kernel_append = if let Some(ref cmd) = config.command {
let cmd_str = cmd.join(" "); let cmd_str = cmd.join(" ");
format!( format!(
"console=ttyS0 quiet ECR_SHELL={} ECR_CMD=\"{}\" ECR_HOSTNAME={}", "console=ttyS0{} ECR_SHELL={} ECR_CMD=\"{}\" ECR_HOSTNAME={}",
shell, cmd_str, hostname quiet_flag, shell, cmd_str, hostname
) )
} else { } else {
format!( format!(
"console=ttyS0 quiet ECR_SHELL={} ECR_HOSTNAME={}", "console=ttyS0{} ECR_SHELL={} ECR_HOSTNAME={}",
shell, hostname quiet_flag, shell, hostname
) )
}; };