Add a qemu-uefi executable to start the UEFI disk image in QEMU

This commit is contained in:
Philipp Oppermann
2023-05-01 14:34:05 +02:00
parent ba8b0392b8
commit 2a49491fc7
3 changed files with 21 additions and 0 deletions

13
src/bin/qemu-uefi.rs Normal file
View File

@@ -0,0 +1,13 @@
use std::{
env,
process::{self, Command},
};
fn main() {
let mut qemu = Command::new("qemu-system-x86_64");
qemu.arg("-drive");
qemu.arg(format!("format=raw,file={}", env!("UEFI_IMAGE")));
qemu.arg("-bios").arg(ovmf_prebuilt::ovmf_pure_efi());
let exit_status = qemu.status().unwrap();
process::exit(exit_status.code().unwrap_or(-1));
}