feat: do not display kernel logs with --kernel
This commit is contained in:
@@ -205,7 +205,7 @@ ecr --kernel /boot/vmlinuz debian -- /bin/sh -c "echo hello"
|
||||
4. Launch QEMU with:
|
||||
- `-kernel <path>` - 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>` - memory size (default 2G)
|
||||
- `-display none -serial mon:stdio` - console on stdio
|
||||
- `-netdev user,id=net0 -device virtio-net-pci,netdev=net0` - network
|
||||
|
||||
+3
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user