diff options
Diffstat (limited to 'draklive')
-rwxr-xr-x | draklive | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -678,7 +678,7 @@ sub allocate_partition { } sub allocate_master { - my ($live, $media, $dest, $total_size) = @_; + my ($live, $media, $dest) = @_; mkdir_p(dirname($dest)); my $geom = { heads => 16, @@ -688,7 +688,7 @@ sub allocate_master { my $track_size = $sector_size * $geom->{sectors}; my $cylinder_size = $track_size * $geom->{heads}; - my $disk_size = $total_size + $track_size; + my $disk_size = $track_size + fold_left { $::a + $::b } map { $_->{size} * $common::SECTORSIZE } @{$live->{media}{partitions}}; $geom->{cylinders} = int($disk_size / $cylinder_size); MDV::Draklive::Utils::device_allocate_file($dest, $disk_size); @@ -729,9 +729,7 @@ sub create_disk_master { $live->{media}->supplement_partitions($slash_size); my $dest = get_disk_master_path($live); - my $disk_size = fold_left { $::a + $::b } map { $_->{size} * $common::SECTORSIZE } @{$live->{media}{partitions}}; - - my @loops = allocate_master($live, $live->{media}, $dest, $disk_size); + my @loops = allocate_master($live, $live->{media}, $dest); my $slash_idx = $live->{media}->find_partition_index('/'); local $opts->{device} = $loops[$slash_idx]; local $opts->{disk_device} = $dest; @@ -1124,7 +1122,7 @@ sub create_usb_replicator { my $size = fold_left { $::a + $::b } map { directory_usage($_, 'apparent') } keys(%files); $live->{replicator}{media}->supplement_partitions($size); - my @loops = allocate_master($live, $live->{replicator}{media}, $dest, $size); + my @loops = allocate_master($live, $live->{replicator}{media}, $dest); my $slash_idx = $live->{replicator}{media}->find_partition_index('/'); my $opts = { device => $loops[$slash_idx], disk_device => $dest, append => $live->{replicator}{append} }; record_usb_replicator($live, $opts); |