diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-03-17 13:53:09 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-03-17 13:53:09 +0000 |
commit | d92dda625cdd370696b4c48cb864796331742e4c (patch) | |
tree | 929ca1bbff7e51a9434da856ce1acf632e203dc5 /perl-install/partition_table/raw.pm | |
parent | 4aaa565756eec6abd011192ba45c5089977ef465 (diff) | |
download | drakx-d92dda625cdd370696b4c48cb864796331742e4c.tar drakx-d92dda625cdd370696b4c48cb864796331742e4c.tar.gz drakx-d92dda625cdd370696b4c48cb864796331742e4c.tar.bz2 drakx-d92dda625cdd370696b4c48cb864796331742e4c.tar.xz drakx-d92dda625cdd370696b4c48cb864796331742e4c.zip |
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)
Diffstat (limited to 'perl-install/partition_table/raw.pm')
-rw-r--r-- | perl-install/partition_table/raw.pm | 8 |
1 files changed, 7 insertions, 1 deletions
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} } |