mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Bring OSDK's full support of QCOW2 booting
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
c6aa9f9ee8
commit
37e23a16a3
@ -2,6 +2,7 @@
|
||||
|
||||
mod bin;
|
||||
mod grub;
|
||||
mod qcow2;
|
||||
|
||||
use std::{
|
||||
ffi::OsString,
|
||||
@ -159,7 +160,7 @@ pub fn do_build(
|
||||
);
|
||||
|
||||
match boot.method {
|
||||
BootMethod::GrubRescueIso => {
|
||||
BootMethod::GrubRescueIso | BootMethod::GrubQcow2 => {
|
||||
info!("Building boot device image");
|
||||
let bootdev_image = grub::create_bootdev_image(
|
||||
&osdk_output_directory,
|
||||
@ -168,16 +169,18 @@ pub fn do_build(
|
||||
config,
|
||||
action,
|
||||
);
|
||||
bundle.consume_vm_image(bootdev_image);
|
||||
if matches!(boot.method, BootMethod::GrubQcow2) {
|
||||
let qcow2_image = qcow2::convert_iso_to_qcow2(bootdev_image);
|
||||
bundle.consume_vm_image(qcow2_image);
|
||||
} else {
|
||||
bundle.consume_vm_image(bootdev_image);
|
||||
}
|
||||
bundle.consume_aster_bin(aster_elf);
|
||||
}
|
||||
BootMethod::QemuDirect => {
|
||||
let qemu_elf = make_elf_for_qemu(&osdk_output_directory, &aster_elf, build.strip_elf);
|
||||
bundle.consume_aster_bin(qemu_elf);
|
||||
}
|
||||
BootMethod::GrubQcow2 => {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
bundle
|
||||
|
Reference in New Issue
Block a user