Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/kit/src/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ pub fn get_image_size(name: &str) -> Result<u64> {
Ok(info.size)
}

/// Check if image has a UKI (required for --composefs-backend)
pub fn has_uki(name: &str) -> Result<bool> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already code in this repo to parse the kernel state

let status = Command::new("podman")
.args(["run", "--rm", name, "sh", "-c", "ls /boot/EFI/Linux/*.efi >/dev/null 2>&1"])
.status()?;
Ok(status.success())
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
7 changes: 7 additions & 0 deletions crates/kit/src/to_disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,13 @@ EOF
/// Main entry point for the bootc installation process. See module-level documentation
/// for details on the installation workflow and architecture.
pub fn run(opts: ToDiskOpts) -> Result<()> {
if opts.install.composefs_backend && !images::has_uki(&opts.source_image)? {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @travier said this is strictly speaking not true, or to say it another way we definitely want to support it, but it is also true that we are not CI testing it or documenting it right now.

return Err(eyre!(
"Image '{}' has no UKI - not suitable for --composefs-backend",
opts.source_image
));
}

// Phase 0: Check for existing cached disk image
let would_reuse = if opts.target_disk.exists() {
debug!(
Expand Down