Skip to content
Draft
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
2 changes: 2 additions & 0 deletions crates/lib/src/bootc_composefs/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use cap_std_ext::cap_std::fs::Dir;
use composefs::dumpfile;
use composefs::fsverity::FsVerityHashValue;
use composefs_boot::BootOps as _;
use fn_error_context::context;
use tempfile::TempDir;

use crate::store::ComposefsRepository;
Expand Down Expand Up @@ -49,6 +50,7 @@ pub(crate) fn new_temp_composefs_repo() -> Result<(TempDir, Arc<ComposefsReposit
/// * The path is "/" (cannot operate on active root filesystem)
/// * The filesystem cannot be read
/// * The transform or digest computation fails
#[context("Computing composefs digest")]
pub(crate) fn compute_composefs_digest(
path: &Utf8Path,
write_dumpfile_to: Option<&Utf8Path>,
Expand Down
2 changes: 2 additions & 0 deletions crates/lib/src/bootc_kargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use cap_std_ext::cap_std::fs::Dir;
use cap_std_ext::cap_std::fs_utf8::Dir as DirUtf8;
use cap_std_ext::dirext::CapStdExtDirExt;
use cap_std_ext::dirext::CapStdExtDirExtUtf8;
use fn_error_context::context;
use ostree::gio;
use ostree_ext::ostree;
use ostree_ext::ostree::Deployment;
Expand Down Expand Up @@ -107,6 +108,7 @@ pub(crate) fn compute_new_kargs(

/// Load and parse all bootc kargs.d files in the specified root, returning
/// a combined list.
#[context("Getting kargs in root")]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The context message "Getting kargs in root" is a bit generic. A more descriptive message that details what the function is doing would be more helpful in an error chain. Based on the function's documentation ("Load and parse all bootc kargs.d files in the specified root"), a more specific context would improve debuggability.

Suggested change
#[context("Getting kargs in root")]
#[context("Loading and parsing kargs.d files from root")]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes but these should be pretty terse since they get strung together into the final error message which can be pretty long by the end of it.

pub(crate) fn get_kargs_in_root(d: &Dir, sys_arch: &str) -> Result<CmdlineOwned> {
// If the directory doesn't exist, that's OK.
let Some(d) = d.open_dir_optional(KARGS_PATH)?.map(DirUtf8::from_cap_std) else {
Expand Down
2 changes: 2 additions & 0 deletions crates/lib/src/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use anyhow::Result;
use camino::Utf8PathBuf;
use cap_std_ext::cap_std::fs::Dir;
use cap_std_ext::dirext::CapStdExtDirExt;
use fn_error_context::context;
use serde::Serialize;

use crate::bootc_composefs::boot::EFI_LINUX;
Expand Down Expand Up @@ -63,6 +64,7 @@ impl From<KernelInternal> for Kernel {
/// layout with `/usr/lib/modules/<version>/vmlinuz`.
///
/// Returns `None` if no kernel is found.
#[context("Finding kernel")]
pub(crate) fn find_kernel(root: &Dir) -> Result<Option<KernelInternal>> {
// First, try to find a UKI
if let Some(uki_path) = find_uki_path(root)? {
Expand Down
Loading