feat: do not display kernel logs with --kernel

This commit is contained in:
2026-06-16 22:07:28 +02:00
parent 931a6dcfd5
commit 8875bcc92a
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -205,7 +205,7 @@ ecr --kernel /boot/vmlinuz debian -- /bin/sh -c "echo hello"
4. Launch QEMU with: 4. Launch QEMU with:
- `-kernel <path>` - provided kernel - `-kernel <path>` - provided kernel
- `-initrd initramfs.cpio.gz` - rootfs as initramfs - `-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>` - memory size (default 2G) - `-m <memory>` - memory size (default 2G)
- `-display none -serial mon:stdio` - console on stdio - `-display none -serial mon:stdio` - console on stdio
- `-netdev user,id=net0 -device virtio-net-pci,netdev=net0` - network - `-netdev user,id=net0 -device virtio-net-pci,netdev=net0` - network
+3 -2
View File
@@ -56,15 +56,16 @@ 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
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 rdinit=/bin/sh -- -c \"{}\"", "console=ttyS0 quiet rdinit=/bin/sh -- -c \"{}\"",
cmd_str cmd_str
) )
} else { } else {
// Default to interactive shell // Default to interactive shell
"console=ttyS0 rdinit=/bin/sh".to_string() "console=ttyS0 quiet rdinit=/bin/sh".to_string()
}; };
veprintln!("Launching QEMU: {}", qemu_bin); veprintln!("Launching QEMU: {}", qemu_bin);