Lines Matching refs:disk_image_path

9     let disk_image_path = ctx.disk_image_path();  in create()  localVariable
10 if disk_image_path.exists() { in create()
16 disk_image_path.display() in create()
20 disk_path_safety_check(&disk_image_path)?; in create()
24 create_raw_img(&disk_image_path, image_size).expect("Failed to create raw disk image"); in create()
29 create_partitioned_image(ctx, &disk_image_path) in create()
31 create_unpartitioned_image(ctx, &disk_image_path) in create()
35 std::fs::remove_file(&disk_image_path).expect("Failed to remove disk image"); in create()
41 let disk_image_path = ctx.disk_image_path(); in delete() localVariable
42 if !disk_image_path.exists() { in delete()
48 disk_image_path.display() in delete()
51 disk_path_safety_check(&disk_image_path)?; in delete()
53 std::fs::remove_file(&disk_image_path) in delete()
59 let disk_image_path = ctx.disk_image_path(); in mount() localVariable
60 if !disk_image_path.exists() { in mount()
63 disk_image_path.display() in mount()
75 mount_partitioned_image(ctx, &disk_image_path, &disk_mount_path)? in mount()
77 mount_unpartitioned_image(ctx, &disk_image_path, &disk_mount_path)? in mount()
85 disk_image_path: &PathBuf, in mount_partitioned_image()
90 .img_path(disk_image_path.clone()) in mount_partitioned_image()
107 disk_image_path: &PathBuf, in mount_unpartitioned_image()
111 .arg(disk_image_path) in mount_unpartitioned_image()
125 let disk_img_path = ctx.disk_image_path(); in umount()
180 fn disk_path_safety_check(disk_image_path: &PathBuf) -> Result<()> { in disk_path_safety_check()
183 let path = disk_image_path.to_str().ok_or(anyhow!( in disk_path_safety_check()
195 fn create_partitioned_image(ctx: &DADKExecContext, disk_image_path: &PathBuf) -> Result<()> { in create_partitioned_image()
197 DiskPartitioner::create_partitioned_image(disk_image_path, part_type)?; in create_partitioned_image()
200 .img_path(disk_image_path.clone()) in create_partitioned_image()
214 fn create_unpartitioned_image(ctx: &DADKExecContext, disk_image_path: &PathBuf) -> Result<()> { in create_unpartitioned_image()
217 DiskFormatter::format_disk(disk_image_path, &fs_type) in create_unpartitioned_image()
221 fn create_raw_img(disk_image_path: &PathBuf, image_size: usize) -> Result<()> { in create_raw_img()
222 log::trace!("Creating raw disk image: {}", disk_image_path.display()); in create_raw_img()
224 if let Some(parent) = disk_image_path.parent() { in create_raw_img()
229 let mut file = File::create(disk_image_path)?; in create_raw_img()
248 let disk_image_path = ctx.disk_image_path(); in check_disk_image_exists() localVariable
249 if disk_image_path.exists() { in check_disk_image_exists()
264 let disk_image_path = ctx.disk_image_path(); in show_loop_device() localVariable
265 let mut loop_device = LoopDeviceBuilder::new().img_path(disk_image_path).build()?; in show_loop_device()
277 fn create_partitioned_image(disk_image_path: &PathBuf, part_type: PartitionType) -> Result<()> { in create_partitioned_image()
285 Self::create_mbr_partitioned_image(disk_image_path)?; in create_partitioned_image()
289 Self::create_gpt_partitioned_image(disk_image_path)?; in create_partitioned_image()
295 fn create_mbr_partitioned_image(disk_image_path: &PathBuf) -> Result<()> { in create_mbr_partitioned_image()
296 let disk_image_path_str = disk_image_path.to_str().expect("Invalid path"); in create_mbr_partitioned_image()
337 fn format_disk(disk_image_path: &PathBuf, fs_type: &FsType) -> Result<()> { in format_disk()
339 FsType::Fat32 => Self::format_fat32(disk_image_path), in format_disk()
343 fn format_fat32(disk_image_path: &PathBuf) -> Result<()> { in format_fat32()
347 .arg(disk_image_path.to_str().unwrap()) in format_fat32()
369 let disk_image_path = temp_file.path().to_path_buf(); in test_create_raw_img_functional() localVariable
373 create_raw_img(&disk_image_path, disk_image_size)?; in test_create_raw_img_functional()
376 let metadata = fs::metadata(&disk_image_path)?; in test_create_raw_img_functional()
380 let mut file = File::open(&disk_image_path)?; in test_create_raw_img_functional()
402 let disk_image_path = temp_file.path().to_path_buf(); in test_format_fat32() localVariable
406 create_raw_img(&disk_image_path, image_size).expect("Failed to create raw disk image"); in test_format_fat32()
409 DiskFormatter::format_disk(&disk_image_path, &FsType::Fat32) in test_format_fat32()
416 .arg(&disk_image_path) in test_format_fat32()
431 let disk_image_path = temp_file.path().to_path_buf(); in test_create_mbr_partitioned_image() localVariable
433 eprintln!("Disk image path: {:?}", disk_image_path); in test_create_mbr_partitioned_image()
436 create_raw_img(&disk_image_path, disk_image_size)?; in test_create_mbr_partitioned_image()
439 DiskPartitioner::create_mbr_partitioned_image(&disk_image_path)?; in test_create_mbr_partitioned_image()
446 .arg(&disk_image_path) in test_create_mbr_partitioned_image()