summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/partition_table.pm4
-rw-r--r--perl-install/partition_table_bsd.pm2
-rw-r--r--perl-install/partition_table_gpt.pm9
-rw-r--r--perl-install/partition_table_raw.pm5
4 files changed, 18 insertions, 2 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 61b6738b2..336e270c8 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -420,7 +420,7 @@ sub get_normal_parts {
sub get_normal_parts_and_holes {
my ($hd) = @_;
- my $start = arch() eq "alpha" ? 2048 : 1;
+ my ($start, $last) = ($hd->first_usable_sector, $hd->last_usable_sector);
ref($hd) or print("get_normal_parts_and_holes: bad hd" . backtrace(), "\n");
@@ -431,7 +431,7 @@ sub get_normal_parts_and_holes {
$hole, $_;
} sort { $a->{start} <=> $b->{start} } grep { !isWholedisk($_) } get_normal_parts($hd);
- push @l, { start => $start, size => $hd->{totalsectors} - $start, type => 0, rootDevice => $hd->{device} };
+ push @l, { start => $start, size => $last - $start, type => 0, rootDevice => $hd->{device} };
grep { $_->{type} || $_->{size} >= $hd->cylinder_size } @l;
}
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_gpt.pm b/perl-install/partition_table_gpt.pm
index 7512bb0c2..4662d58a8 100644
--- a/perl-install/partition_table_gpt.pm
+++ b/perl-install/partition_table_gpt.pm
@@ -225,6 +225,15 @@ sub raw_add {
push @$raw, $part;
}
+sub first_usable_sector {
+ my ($hd) = @_;
+ $hd->{primary}{info}{firstUsableLBA};
+}
+sub last_usable_sector {
+ my ($hd) = @_;
+ $hd->{primary}{info}{lastUsableLBA} + 1;
+}
+
sub info {
my ($hd) = @_;
my $nb_sect = 32;
diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm
index f11fd7068..5dfc82e74 100644
--- a/perl-install/partition_table_raw.pm
+++ b/perl-install/partition_table_raw.pm
@@ -47,6 +47,11 @@ sub cylinder_size($) {
my ($hd) = @_;
$hd->{geom}{sectors} * $hd->{geom}{heads};
}
+sub first_usable_sector { 1 }
+sub last_usable_sector {
+ my ($hd) = @_;
+ $hd->{totalsectors};
+}
#- default method for starting a partition, only head size or twice
#- is allowed for starting a partition after a cylinder boundarie.