diff options
-rwxr-xr-x | draklive | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -744,12 +744,12 @@ sub set_part_real_device { } sub allocate_master { - my ($live, $media, $dest) = @_; + my ($live, $media, $opts) = @_; - my $hd = get_hd_from_layout($media, $dest); + my $hd = get_hd_from_layout($media, $opts->{device}); - mkdir_p(dirname($dest)); - MDV::Draklive::Utils::device_allocate_file($dest, $hd->{totalsectors} * $common::SECTORSIZE); + mkdir_p(dirname($opts->{device})); + MDV::Draklive::Utils::device_allocate_file($opts->{device}, $hd->{totalsectors} * $common::SECTORSIZE); partition_table::raw::zero_MBR($hd); @@ -784,10 +784,10 @@ sub create_disk_master { $live->{media}->supplement_partitions($slash_size); - my $dest = get_disk_master_path($live); - allocate_master($live, $live->{media}, $dest); - my $slash_idx = $live->{media}->find_partition_index('/'); $opts->{device} ||= get_disk_master_path($live); + allocate_master($live, $live->{media}, $opts); + + my $slash_idx = $live->{media}->find_partition_index('/'); record_master($live, $opts); } @@ -1203,14 +1203,13 @@ sub get_disk_replicator_files { sub create_usb_replicator { my ($live) = @_; - my $dest = get_disk_replicator_path($live); my %files = get_disk_replicator_files($live); my $size = fold_left { $::a + $::b } map { directory_usage($_, 'apparent') } keys(%files); $live->{replicator}{media}->supplement_partitions($size); - allocate_master($live, $live->{replicator}{media}, $dest); my $opts = { device => get_disk_replicator_path($live) }; + allocate_master($live, $live->{replicator}{media}, $opts); record_usb_replicator($live, $opts); } |