cargo_image_runner/bootloader/
none.rs1use super::{Bootloader, BootloaderFiles, ConfigFile};
2use crate::config::BootType;
3use crate::core::context::Context;
4use crate::core::error::Result;
5
6pub struct NoneBootloader;
11
12impl NoneBootloader {
13 pub fn new() -> Self {
15 Self
16 }
17}
18
19impl Default for NoneBootloader {
20 fn default() -> Self {
21 Self::new()
22 }
23}
24
25impl Bootloader for NoneBootloader {
26 fn prepare(&self, ctx: &Context) -> Result<BootloaderFiles> {
27 let mut files = BootloaderFiles::new();
28
29 if ctx.config.boot.boot_type.needs_uefi() {
31 files = files.add_uefi_file(
32 ctx.executable.clone(),
33 "efi/boot/bootx64.efi".into(),
34 );
35 }
36
37 Ok(files)
38 }
39
40 fn config_files(&self, _ctx: &Context) -> Result<Vec<ConfigFile>> {
41 Ok(Vec::new())
43 }
44
45 fn boot_type(&self) -> BootType {
46 BootType::Uefi
48 }
49
50 fn name(&self) -> &str {
51 "Direct Boot (no bootloader)"
52 }
53}