summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-02-18 20:52:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-02-18 20:52:38 +0000
commitbd671655350f6ffadc045e53b37978ac7022e64a (patch)
treead763da8581cf83e50206df8d9ebada132cb1a0f
parent1dc4375a36acb3e4de08461c5e825071d9827cf1 (diff)
downloaddrakx-bd671655350f6ffadc045e53b37978ac7022e64a.tar
drakx-bd671655350f6ffadc045e53b37978ac7022e64a.tar.gz
drakx-bd671655350f6ffadc045e53b37978ac7022e64a.tar.bz2
drakx-bd671655350f6ffadc045e53b37978ac7022e64a.tar.xz
drakx-bd671655350f6ffadc045e53b37978ac7022e64a.zip
/proc/partitions includes partition with type "empty" and a non-null size
so add them for comparison
-rw-r--r--perl-install/fsedit.pm12
-rw-r--r--perl-install/partition_table.pm3
2 files changed, 10 insertions, 5 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 620dba807..483e87000 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -771,13 +771,17 @@ sub compare_with_proc_partitions {
my @l1 = partition_table::get_normal_parts($hd);
my @l2 = grep { $_->{rootDevice} eq $hd->{device} } read_proc_partitions([$hd]);
-
- if (int(@l1) != int(@l2) && arch() ne 'ppc') {
+
+ #- /proc/partitions includes partition with type "empty" and a non-null size
+ #- so add them for comparison
+ my ($len1, $len2) = (int(@l1) + $hd->{primary}{nb_special_empty}, int(@l2));
+
+ if ($len1 != $len2 && arch() ne 'ppc') {
die sprintf(
- "/proc/partitions doesn't agree with drakx %d != %d:\n%s\n", int(@l1), int(@l2),
+ "/proc/partitions doesn't agree with drakx %d != %d:\n%s\n", $len1, $len2,
"/proc/partitions: " . join(", ", map { "$_->{device} ($_->{rootDevice})" } @l2));
}
- int @l2;
+ $len2;
}
sub use_proc_partitions {
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index b468c8174..19b7f2842 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -491,11 +491,12 @@ sub read_one($$) {
my @extended = $hd->hasExtended ? grep { isExtended($_) } @$pt : ();
my @normal = grep { $_->{size} && $_->{type} && !isExtended($_) } @$pt;
+ my $nb_special_empty = int(grep { $_->{size} && $_->{type} == 0 } @$pt);
@extended > 1 and die "more than one extended partition";
$_->{rootDevice} = $hd->{device} foreach @normal, @extended;
- { raw => $pt, extended => $extended[0], normal => \@normal, info => $info };
+ { raw => $pt, extended => $extended[0], normal => \@normal, info => $info, nb_special_empty => $nb_special_empty };
}
sub read {