Skip to content

Commit

Permalink
blsctl: Detect systemd-bootx64 efi assets, pass to the manager
Browse files Browse the repository at this point in the history
Signed-off-by: Ikey Doherty <ikey@serpentos.com>
  • Loading branch information
ikeycode committed Jul 6, 2024
1 parent 5b2cf10 commit 15d8c89
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion blsctl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ fn inspect_root(config: &Configuration) -> color_eyre::Result<()> {
.filter_map(|f| f.ok());
let mut kernels = schema.discover_system_kernels(paths)?;

// Future: Include other potential bootloader asset paths
let booty_bits = glob::glob(&format!(
"{}/usr/lib*/systemd/boot/efi/*.efi",
config.root.path().display()
))?
.filter_map(|f| f.ok())
.collect::<Vec<_>>();

// If a boot JSON is provided, augment the records
for kernel in kernels.iter_mut() {
if let Some(json) = kernel
Expand All @@ -147,10 +155,14 @@ fn inspect_root(config: &Configuration) -> color_eyre::Result<()> {
log::info!("Kernels: {kernels:?}");

// Query the manager
let manager = Manager::new(config)?.with_kernels(kernels);
let manager = Manager::new(config)?
.with_kernels(kernels)
.with_bootloader_assets(booty_bits);
let _parts = manager.mount_partitions()?;
eprintln!("manager = {manager:?}");

manager.sync()?;

Ok(())
}

Expand Down

0 comments on commit 15d8c89

Please sign in to comment.