summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2001-11-12 15:26:53 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2001-11-12 15:26:53 +0000
commitcae5b2b41343a4f3fb8efe8b8d117cc5b0bb8a04 (patch)
treecf60e4dc595d3c5cbe5062336b32b5cf4c588f66
parent6d6a4fc8a5f301eaaec2e97401497ca7308463b2 (diff)
downloaddrakx-cae5b2b41343a4f3fb8efe8b8d117cc5b0bb8a04.tar
drakx-cae5b2b41343a4f3fb8efe8b8d117cc5b0bb8a04.tar.gz
drakx-cae5b2b41343a4f3fb8efe8b8d117cc5b0bb8a04.tar.bz2
drakx-cae5b2b41343a4f3fb8efe8b8d117cc5b0bb8a04.tar.xz
drakx-cae5b2b41343a4f3fb8efe8b8d117cc5b0bb8a04.zip
- Yet merges for GPT support from Pixel
-rw-r--r--perl-install/install_interactive.pm2
-rw-r--r--perl-install/partition_table_bsd.pm2
-rw-r--r--perl-install/partition_table_dos.pm21
3 files changed, 16 insertions, 9 deletions
diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm
index 997177cce..7b93bbf09 100644
--- a/perl-install/install_interactive.pm
+++ b/perl-install/install_interactive.pm
@@ -71,7 +71,7 @@ sub partitionWizardSolutions {
# each solution is a [ score, text, function ], where the function retunrs true if succeeded
- my @good_hds = grep { partition_table::can_raw_add($_) } @$hds;
+ my @good_hds = grep { $_->can_raw_add } @$hds;
if (fsedit::free_space(@good_hds) > $min_linux and !$readonly) {
$solutions{free_space} = [ 20, _("Use free space"), sub { fsedit::auto_allocate($all_hds); 1 } ]
} else {
diff --git a/perl-install/partition_table_bsd.pm b/perl-install/partition_table_bsd.pm
index e9f51b455..cb6a8441e 100644
--- a/perl-install/partition_table_bsd.pm
+++ b/perl-install/partition_table_bsd.pm
@@ -142,4 +142,6 @@ sub clear_raw {
{ raw => [ ({}) x $nb_primary ], info => info($hd) };
}
+sub first_usable_sector { 2048 }
+
1;
diff --git a/perl-install/partition_table_dos.pm b/perl-install/partition_table_dos.pm
index 2c76a40e5..00ee589b9 100644
--- a/perl-install/partition_table_dos.pm
+++ b/perl-install/partition_table_dos.pm
@@ -12,7 +12,7 @@ use partition_table;
use c;
my @fields = qw(active start_head start_sec start_cyl type end_head end_sec end_cyl start size);
-my $format = "C8 I2";
+my $format = "C8 V2";
my $magic = "\x55\xAA";
my $nb_primary = 4;
@@ -23,19 +23,24 @@ sub hasExtended { 1 }
sub compute_CHS($$) {
my ($hd, $e) = @_;
my @l = qw(cyl head sec);
- @$e{map { "start_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS(sector2CHS($hd, $e->{start})) : (0,0,0);
- @$e{map { "end_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS(sector2CHS($hd, $e->{start} + $e->{size} - 1)) : (0,0,0);
+ @$e{map { "start_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS($hd, sector2CHS($hd, $e->{start})) : (0,0,0);
+ @$e{map { "end_$_" } @l} = $e->{start} || $e->{type} ? CHS2rawCHS($hd, sector2CHS($hd, $e->{start} + $e->{size} - 1)) : (0,0,0);
1;
}
-sub CHS2rawCHS($$$) {
- my ($c, $h, $s) = @_;
- $c = min($c, 1023); #- no way to have a #cylinder >= 1024
+sub CHS2rawCHS {
+ my ($hd, $c, $h, $s) = @_;
+ if ($c > 1023) {
+ #- no way to have a #cylinder >= 1024
+ $c = 1023;
+ $h = $hd->{geom}{heads} - 1;
+ $s = $hd->{geom}{sectors};
+ }
($c & 0xff, $h, $s | ($c >> 2 & 0xc0));
}
# returns (cylinder, head, sector)
-sub sector2CHS($$) {
+sub sector2CHS {
my ($hd, $start) = @_;
my ($s, $h);
($start, $s) = divide($start, $hd->{geom}{sectors});
@@ -43,7 +48,7 @@ sub sector2CHS($$) {
($start, $h, $s + 1);
}
-sub read($$) {
+sub read {
my ($hd, $sector) = @_;
my $tmp;