From d92dda625cdd370696b4c48cb864796331742e4c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 17 Mar 2004 13:53:09 +0000 Subject: add set_best_geometry_for_the_partition_table to use the hd geometry instead of the physical geometry returned by the kernel (since for now i can't have bios geometry on 2.6) --- perl-install/partition_table/raw.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'perl-install/partition_table/raw.pm') diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm index d8bcf8954..2b7efa808 100644 --- a/perl-install/partition_table/raw.pm +++ b/perl-install/partition_table/raw.pm @@ -45,6 +45,7 @@ sub typeOfMBR($) { typeFromMagic(devices::make($_[0]), @MBR_signatures) } sub typeOfMBR_($) { typeFromMagic($_[0], @MBR_signatures) } sub hasExtended { 0 } +sub set_best_geometry_for_the_partition_table {} sub cylinder_size($) { my ($hd) = @_; @@ -88,6 +89,11 @@ sub adjustEnd($$) { $part->{size} > 0 or internal_error("adjustEnd get a too small partition to handle correctly"); } +sub compute_nb_cylinders { + my ($geom, $totalsectors) = @_; + $geom->{cylinders} = int $totalsectors / $geom->{heads} / $geom->{sectors}; +} + sub get_geometry($) { my ($dev) = @_; my $g = ""; @@ -100,7 +106,7 @@ sub get_geometry($) { my $total; #- $geom{cylinders} is no good (only a ushort, that means less than 2^16 => at best 512MB) if ($total = c::total_sectors(fileno $F)) { - $geom{cylinders} = int $total / $geom{heads} / $geom{sectors}; + compute_nb_cylinders(\%geom, $total); } else { $total = $geom{heads} * $geom{sectors} * $geom{cylinders} } -- cgit v1.2.1