summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table_raw.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-02-14 13:53:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-02-14 13:53:43 +0000
commitb665d3c80aa66b6f440ead49ac606e0702ffefd9 (patch)
treef9d2f8565a2aae01502b65760d91adf10c73a6fa /perl-install/partition_table_raw.pm
parent625c6a2b2ad64ea930f2c444bed180b106732985 (diff)
downloaddrakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar.gz
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar.bz2
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.tar.xz
drakx-b665d3c80aa66b6f440ead49ac606e0702ffefd9.zip
no_comment
Diffstat (limited to 'perl-install/partition_table_raw.pm')
-rw-r--r--perl-install/partition_table_raw.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm
index 41a49d552..d1399f230 100644
--- a/perl-install/partition_table_raw.pm
+++ b/perl-install/partition_table_raw.pm
@@ -73,11 +73,13 @@ sub get_geometry($) {
local *F; sysopen F, $dev, 0 or return;
ioctl(F, c::HDIO_GETGEO(), $g) or return;
-
my %geom; @geom{qw(heads sectors cylinders start)} = unpack "CCSL", $g;
- $geom{totalcylinders} = $geom{cylinders};
- { geom => \%geom, totalsectors => $geom{heads} * $geom{sectors} * $geom{cylinders} };
+ #- $geom{cylinders} is no good (only a ushort, that means less than 2^16 => at best 512MB)
+ my $total = c::total_sectors(fileno F);
+ $geom{totalcylinders} = $total / $geom{heads} * $geom{sectors};
+
+ { geom => \%geom, totalsectors => $total };
}
sub openit($$;$) { sysopen $_[1], $_[0]{file}, $_[2] || 0; }