feat: add --kernel flag for QEMU system emulation mode

Add --kernel <PATH> option to boot extracted rootfs in a QEMU virtual
machine instead of namespace/chroot mode. The rootfs is converted to an
ext4 disk image using mke2fs and booted with the provided kernel.
This commit is contained in:
2026-06-16 19:16:34 +02:00
parent c163f89cb2
commit 4f44af4449
7 changed files with 526 additions and 9 deletions
+8
View File
@@ -33,6 +33,14 @@ pub struct Args {
#[arg(short = 'v', long)]
pub verbose: bool,
/// Boot with QEMU system emulation using specified kernel (extracts rootfs as disk image)
#[arg(long, value_name = "KERNEL_PATH")]
pub kernel: Option<PathBuf>,
/// Memory size for QEMU VM (only used with --kernel, e.g., 512M, 2G)
#[arg(short = 'm', long, default_value = "2G", value_name = "SIZE")]
pub memory: String,
/// Command to run inside the chroot (default: interactive shell)
#[arg(
trailing_var_arg = true,