summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/partition_table.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 350431870..ee1769ad9 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -525,8 +525,12 @@ sub write {
$hd->{isDirty} or return;
#- set first primary partition active if no primary partitions are marked as active.
- for ($hd->{primary}{raw}) {
- (grep { $_->{local_start} = $_->{start}; $_->{active} ||= 0 } @$_) or $_->[0]{active} = 0x80;
+ if (my @l = @{$hd->{primary}{raw}}) {
+ foreach (@l) {
+ $_->{local_start} = $_->{start};
+ $_->{active} ||= 0;
+ }
+ $l[0]{active} = 0x80 if !grep { $_->{active} } @l;
}
#- last chance for verification, this make sure if an error is detected,