diff options
-rwxr-xr-x | draklive | 3 | ||||
-rw-r--r-- | lib/MDV/Draklive/Media.pm | 3 |
2 files changed, 4 insertions, 2 deletions
@@ -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, diff --git a/lib/MDV/Draklive/Media.pm b/lib/MDV/Draklive/Media.pm index 159fab3..bb938ff 100644 --- a/lib/MDV/Draklive/Media.pm +++ b/lib/MDV/Draklive/Media.pm @@ -2,6 +2,7 @@ package MDV::Draklive::Media; use MDK::Common; use MDV::Draklive::Storage; +use POSIX; use common; sub get_initrd_path { @@ -69,7 +70,7 @@ sub supplement_partitions { my $correction = 1.2; my $slash = find { $_->{mntpoint} eq '/' } @{$media->{partitions}}; - $slash->{size} ||= int($total_size * $correction / $common::SECTORSIZE); + $slash->{size} ||= POSIX::ceil($total_size * $correction / $common::SECTORSIZE); } 1; |