diff options
Diffstat (limited to 'draklive')
-rwxr-xr-x | draklive | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -691,15 +691,16 @@ sub allocate_master { sectors => 63, # sectors per track }; - my $disk_sectors = fold_left { $::a + $::b } map { $_->{size} } @{$live->{media}{partitions}}; - $disk_sectors += $geom->{sectors}; # keep one more track - $geom->{cylinders} = int($disk_sectors / ($geom->{sectors} * $geom->{heads})); + my $required_sectors = fold_left { $::a + $::b } map { $_->{size} } @{$live->{media}{partitions}}; + $required_sectors += $geom->{sectors}; # keep one more track + $geom->{cylinders} = int($required_sectors / ($geom->{sectors} * $geom->{heads})); + my $total_sectors = $geom->{cylinders} * $geom->{heads} * $geom->{sectors}; mkdir_p(dirname($dest)); - MDV::Draklive::Utils::device_allocate_file($dest, $disk_sectors * $common::SECTORSIZE); + MDV::Draklive::Utils::device_allocate_file($dest, $total_sectors * $common::SECTORSIZE); my $hd = bless { - totalsectors => $geom->{cylinders} * $geom->{heads} * $geom->{sectors}, + totalsectors => $total_sectors, geom => $geom, file => $dest, }, 'partition_table::dos'; |