File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ use cap_std_ext::prelude::CapStdExtDirExt;
26
26
use chrono:: prelude:: * ;
27
27
use clap:: ValueEnum ;
28
28
use ostree_ext:: oci_spec;
29
+ use rustix:: fs:: FileTypeExt ;
29
30
use rustix:: fs:: MetadataExt ;
30
31
31
32
use fn_error_context:: context;
@@ -1024,6 +1025,13 @@ fn installation_complete() {
1024
1025
/// Implementation of the `bootc install to-disk` CLI command.
1025
1026
pub ( crate ) async fn install_to_disk ( opts : InstallToDiskOpts ) -> Result < ( ) > {
1026
1027
let block_opts = opts. block_opts ;
1028
+ let target_blockdev_meta = block_opts
1029
+ . device
1030
+ . metadata ( )
1031
+ . with_context ( || format ! ( "Querying {}" , & block_opts. device) ) ?;
1032
+ if !target_blockdev_meta. file_type ( ) . is_block_device ( ) {
1033
+ anyhow:: bail!( "Not a block device: {}" , block_opts. device) ;
1034
+ }
1027
1035
let state = prepare_install ( opts. config_opts , opts. target_opts ) . await ?;
1028
1036
1029
1037
// This is all blocking stuff
You can’t perform that action at this time.
0 commit comments