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§
Sourcefn prepare(&self, ctx: &Context) -> Result<BootloaderFiles>
fn prepare(&self, ctx: &Context) -> Result<BootloaderFiles>
Prepare bootloader files (download, extract, etc.).
Returns the files that need to be included in the image.
Sourcefn config_files(&self, ctx: &Context) -> Result<Vec<ConfigFile>>
fn config_files(&self, ctx: &Context) -> Result<Vec<ConfigFile>>
Get bootloader configuration files to include in image.
These files may need template processing.
Provided Methods§
Sourcefn process_templates(
&self,
content: &str,
vars: &HashMap<String, String>,
) -> Result<String>
fn process_templates( &self, content: &str, vars: &HashMap<String, String>, ) -> Result<String>
Process template variables in content.
Supports both {{VAR}} and $VAR syntax.
Sourcefn validate_config(&self, ctx: &Context) -> Result<()>
fn validate_config(&self, ctx: &Context) -> Result<()>
Validate configuration for this bootloader.