From 4a6e89707f9bca7cd5af6a59d0e4613ee4646b5e Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 5 Sep 2023 07:26:24 -0400 Subject: [PATCH] install: Add some more error context `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. --- lib/src/blockdev.rs | 1 + lib/src/install.rs | 1 + lib/src/install/baseline.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/blockdev.rs b/lib/src/blockdev.rs index 7e2b3b81..51e4cdbf 100644 --- a/lib/src/blockdev.rs +++ b/lib/src/blockdev.rs @@ -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}"), diff --git a/lib/src/install.rs b/lib/src/install.rs index 41a99ee9..32d7d2cb 100644 --- a/lib/src/install.rs +++ b/lib/src/install.rs @@ -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 diff --git a/lib/src/install/baseline.rs b/lib/src/install/baseline.rs index 60cb79d0..9dd9be02 100644 --- a/lib/src/install/baseline.rs +++ b/lib/src/install/baseline.rs @@ -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 {