summaryrefslogtreecommitdiffstats
path: root/draklive
diff options
context:
space:
mode:
Diffstat (limited to 'draklive')
-rwxr-xr-xdraklive9
1 files changed, 4 insertions, 5 deletions
diff --git a/draklive b/draklive
index 2e5f774..be0c629 100755
--- a/draklive
+++ b/draklive
@@ -684,13 +684,12 @@ sub allocate_master {
heads => 16,
sectors => 63, # sectors per track
};
- my $track_size = $common::SECTORSIZE * $geom->{sectors};
- my $cylinder_size = $track_size * $geom->{heads};
- my $disk_size = $track_size + fold_left { $::a + $::b } map { $_->{size} * $common::SECTORSIZE } @{$live->{media}{partitions}};
- $geom->{cylinders} = int($disk_size / $cylinder_size);
+ my $disk_sectors = fold_left { $::a->{size} + $::b->{size} } @{$live->{media}{partitions}};
+ $disk_sectors += $geom->{sectors}; # keep one more track
+ $geom->{cylinders} = int($disk_sectors / ($geom->{sectors} * $geom->{heads}));
- MDV::Draklive::Utils::device_allocate_file($dest, $disk_size);
+ MDV::Draklive::Utils::device_allocate_file($dest, $disk_sectors * $common::SECTORSIZE);
my $hd = bless {
totalsectors => $geom->{cylinders} * $geom->{heads} * $geom->{sectors},