Skip to content

Commit 1fda5c3

Browse files
committed
install: Add more error contexts
I forgot to bind mount `-v /:/target` and got an unfriendly bare `ERROR No such file or directory (os error 2)` Add more error context. Signed-off-by: Colin Walters <[email protected]>
1 parent ac52673 commit 1fda5c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/src/install.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ fn installation_complete() {
10801080
}
10811081

10821082
/// Implementation of the `bootc install to-disk` CLI command.
1083+
#[context("Installing to disk")]
10831084
pub(crate) async fn install_to_disk(opts: InstallToDiskOpts) -> Result<()> {
10841085
let mut block_opts = opts.block_opts;
10851086
let target_blockdev_meta = block_opts
@@ -1196,11 +1197,14 @@ fn clean_boot_directories(rootfs: &Dir) -> Result<()> {
11961197
}
11971198

11981199
/// Implementation of the `bootc install to-filsystem` CLI command.
1200+
#[context("Installing to filesystem")]
11991201
pub(crate) async fn install_to_filesystem(opts: InstallToFilesystemOpts) -> Result<()> {
12001202
let fsopts = opts.filesystem_opts;
12011203
let root_path = &fsopts.root_path;
12021204

1203-
let st = root_path.symlink_metadata()?;
1205+
let st = root_path
1206+
.symlink_metadata()
1207+
.with_context(|| format!("Querying target filesystem {root_path}"))?;
12041208
if !st.is_dir() {
12051209
anyhow::bail!("Not a directory: {root_path}");
12061210
}

0 commit comments

Comments
 (0)