Skip to content

Commit

Permalink
install: Add some more error context
Browse files Browse the repository at this point in the history
`sgdisk` dropped out of my image when I was changing things.
In retrospect the error message was relatively clear, but
here's some error context I added while debugging.

Signed-off-by: Colin Walters <walters@verbum.org>
  • Loading branch information
cgwalters committed Sep 5, 2023
1 parent 0fc8252 commit bca8fa4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/src/blockdev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ impl Device {
}
}

#[context("Failed to wipe {dev}")]
pub(crate) fn wipefs(dev: &Utf8Path) -> Result<()> {
Task::new_and_run(
format!("Wiping device {dev}"),
Expand Down
1 change: 1 addition & 0 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ async fn prepare_install(
reexecute_self_for_selinux_if_needed(&source, config_opts.disable_selinux)?;

let install_config = config::load_config()?;
tracing::debug!("Loaded install configuration");

// Create our global (read-only) state which gets wrapped in an Arc
// so we can pass it to worker threads too. Right now this just
Expand Down
3 changes: 2 additions & 1 deletion lib/src/install/baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ pub(crate) fn install_create_rootfs(
"root",
Some("0FC63DAF-8483-4772-8E79-3D69D8477DE4"),
);
sgdisk.run()?;
sgdisk.run().context("Failed to run sgdisk")?;
tracing::debug!("Created partition table");

// Reread the partition table
{
Expand Down

0 comments on commit bca8fa4

Please sign in to comment.