summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm22
1 files changed, 20 insertions, 2 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 514d5568a..684136207 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -297,8 +297,26 @@ sub assign_device_numbers($) {
my ($hd) = @_;
my $i = 1;
- $_->{device} = $hd->{prefix} . $i++ foreach @{$hd->{primary}{raw}},
+ my $start = 1;
+
+ #- on PPC we need to assign device numbers to the holes too - big FUN!
+ if (arch() =~ /ppc/) {
+ #- first sort the normal parts
+ $hd->{primary}{normal} = [sort { $a->{start} <=> $b->{start} } @{$hd->{primary}{normal}} ];
+
+ #- now loop through them, assigning partition numbers - reserve one for the holes
+ foreach (@{$hd->{primary}{normal}}) {
+ if ($_->{start} > $start) {
+ log::l("PPC: found a hole on $hd->{prefix} before $_->{start}, skipping device...");
+ $i++;
+ }
+ $_->{device} = $hd->{prefix} . $i++;
+ $start = $_->{start} + $_->{size};
+ }
+ } else {
+ $_->{device} = $hd->{prefix} . $i++ foreach @{$hd->{primary}{raw}},
map { $_->{normal} } @{$hd->{extended} || []};
+ }
#- try to figure what the windobe drive letter could be!
#
@@ -560,7 +578,7 @@ sub add_primary($$) {
}
sub add_extended {
- arch() =~ /^sparc/ and die _("Extended partition not supported on this platform");
+ arch() =~ /^sparc|ppc/ and die _("Extended partition not supported on this platform");
my ($hd, $part, $extended_type) = @_;
$extended_type =~ s/Extended_?//;