summaryrefslogtreecommitdiffstats
path: root/draklive
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-08-04 07:35:29 +0000
committerOlivier Blin <oblin@mandriva.com>2009-08-04 07:35:29 +0000
commit59e175d9ad63a30e112f25fc98c17cfc98ceb1f5 (patch)
treed62e5d6882ba38a8f1be4d7025a9177c87ad5c96 /draklive
parenta326e02822d048e9e497ace31b7bb07f26b6a7d7 (diff)
downloaddrakiso-59e175d9ad63a30e112f25fc98c17cfc98ceb1f5.tar
drakiso-59e175d9ad63a30e112f25fc98c17cfc98ceb1f5.tar.gz
drakiso-59e175d9ad63a30e112f25fc98c17cfc98ceb1f5.tar.bz2
drakiso-59e175d9ad63a30e112f25fc98c17cfc98ceb1f5.tar.xz
drakiso-59e175d9ad63a30e112f25fc98c17cfc98ceb1f5.zip
fix size approximations by using ceil
Diffstat (limited to 'draklive')
-rwxr-xr-xdraklive3
1 files changed, 2 insertions, 1 deletions
diff --git a/draklive b/draklive
index 6aae36e..93282f5 100755
--- a/draklive
+++ b/draklive
@@ -31,6 +31,7 @@ use Getopt::Long;
use Pod::Usage;
use File::Temp;
use IO::Handle; #- autoflush
+use POSIX;
use MDV::Draklive::Utils;
use MDV::Draklive::Live;
use MDV::Draklive::Progress;
@@ -696,7 +697,7 @@ sub get_hd_from_layout {
my $geom = get_harddisk_geometry($media);
my $required_sectors = fold_left { $::a + $::b } map { $_->{size} } @{$media->{partitions}};
$required_sectors += $geom->{sectors}; # keep one more track
- $geom->{cylinders} = int($required_sectors / ($geom->{sectors} * $geom->{heads}));
+ $geom->{cylinders} = POSIX::ceil($required_sectors / ($geom->{sectors} * $geom->{heads}));
my $total_sectors = $geom->{cylinders} * $geom->{heads} * $geom->{sectors};
my $hd = bless {
totalsectors => $total_sectors,