Skip to main content

Bootloader

Trait Bootloader 

Source
pub trait Bootloader: Send + Sync {
    // Required methods
    fn prepare(&self, ctx: &Context) -> Result<BootloaderFiles>;
    fn config_files(&self, ctx: &Context) -> Result<Vec<ConfigFile>>;
    fn boot_type(&self) -> BootType;
    fn name(&self) -> &str;

    // Provided methods
    fn process_templates(
        &self,
        content: &str,
        vars: &HashMap<String, String>,
    ) -> Result<String> { ... }
    fn validate_config(&self, ctx: &Context) -> Result<()> { ... }
}
Expand description

Bootloader trait for preparing boot files and configuration.

Required Methods§

Source

fn prepare(&self, ctx: &Context) -> Result<BootloaderFiles>

Prepare bootloader files (download, extract, etc.).

Returns the files that need to be included in the image.

Source

fn config_files(&self, ctx: &Context) -> Result<Vec<ConfigFile>>

Get bootloader configuration files to include in image.

These files may need template processing.

Source

fn boot_type(&self) -> BootType

Get required boot type (BIOS/UEFI/both).

Source

fn name(&self) -> &str

Get a human-readable name for this bootloader.

Provided Methods§

Source

fn process_templates( &self, content: &str, vars: &HashMap<String, String>, ) -> Result<String>

Process template variables in content.

Supports both {{VAR}} and $VAR syntax.

Source

fn validate_config(&self, ctx: &Context) -> Result<()>

Validate configuration for this bootloader.

Implementors§