1use std::path::Path;
2
3use bootloader_boot_config::BootConfig;
4
5use crate::DiskImageBuilder;
6
7pub struct UefiBoot {
9 image_builder: DiskImageBuilder,
10}
11
12impl UefiBoot {
13 pub fn new(kernel_path: &Path) -> Self {
15 Self {
16 image_builder: DiskImageBuilder::new(kernel_path.to_owned()),
17 }
18 }
19
20 pub fn set_ramdisk(&mut self, ramdisk_path: &Path) -> &mut Self {
22 self.image_builder.set_ramdisk(ramdisk_path.to_owned());
23 self
24 }
25
26 pub fn set_boot_config(&mut self, config: &BootConfig) -> &mut Self {
28 self.image_builder.set_boot_config(config);
29 self
30 }
31
32 pub fn create_disk_image(&self, out_path: &Path) -> anyhow::Result<()> {
34 self.image_builder.create_uefi_image(out_path)
35 }
36
37 pub fn create_pxe_tftp_folder(&self, out_path: &Path) -> anyhow::Result<()> {
43 self.image_builder.create_uefi_tftp_folder(out_path)
44 }
45}