Skip to content

Commit

Permalink
stage1/block_device_info: Improve failure logs for partitions without…
Browse files Browse the repository at this point in the history
… filesystems

If the system contains an empty partition, one that has no filesystem
or for which blkid returns an empty output or error, let's log
that.

This can be reproduced by trying to provision with a balenaOS
flasher image which has no filesystem on /dev/sda5.

Change-type: patch
Signed-off-by: Alexandru Costache <[email protected]>
  • Loading branch information
acostach committed May 8, 2024
1 parent 949ed1b commit 2062c29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stage1/block_device_info/partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ impl PartitionInfo {
} else {
Err(Error::with_context(
ErrorKind::InvParam,
&format!("Could not parse blkid output: '{}'", cmd_res),
&format!(
"Empty or unexpected blkid output '{}' for path '{}'",
cmd_res,
&*device.as_ref().to_string_lossy()
),
))
}
}
Expand Down

0 comments on commit 2062c29

Please sign in to comment.