use std::path::Path;
use bootloader_boot_config::BootConfig;
use crate::DiskImageBuilder;
pub struct BiosBoot {
image_builder: DiskImageBuilder,
}
impl BiosBoot {
pub fn new(kernel_path: &Path) -> Self {
Self {
image_builder: DiskImageBuilder::new(kernel_path.to_owned()),
}
}
pub fn set_ramdisk(&mut self, ramdisk_path: &Path) -> &mut Self {
self.image_builder.set_ramdisk(ramdisk_path.to_owned());
self
}
pub fn set_boot_config(&mut self, config: &BootConfig) -> &mut Self {
self.image_builder.set_boot_config(config);
self
}
pub fn create_disk_image(&self, out_path: &Path) -> anyhow::Result<()> {
self.image_builder.create_bios_image(out_path)
}
}