summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-11-11 12:42:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-11-11 12:42:59 +0000
commitd2d42e74051c84531e59967f8bd79ec05b4e85c4 (patch)
treef7d372e606d5a88eb84021ce8c472b98ae5a9ecf
parent82a6dc6117ce0394047eb8a85bc1fbb43d6cbc0e (diff)
downloaddrakx-d2d42e74051c84531e59967f8bd79ec05b4e85c4.tar
drakx-d2d42e74051c84531e59967f8bd79ec05b4e85c4.tar.gz
drakx-d2d42e74051c84531e59967f8bd79ec05b4e85c4.tar.bz2
drakx-d2d42e74051c84531e59967f8bd79ec05b4e85c4.tar.xz
drakx-d2d42e74051c84531e59967f8bd79ec05b4e85c4.zip
- make use_proc_partitions a clean function
(not only used when diskdrake code fails) - fix {start} in read_proc_partitions() ({start} was not re-initialised between drives)
-rw-r--r--perl-install/fsedit.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index 2ed4b53a3..13ef8cca1 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -203,11 +203,13 @@ sub hds {
};
if (my $err = $@) {
if ($hd->{readonly}) {
+ log::l("using /proc/partitions since diskdrake failed :(");
use_proc_partitions($hd);
} elsif ($o_ask_before_blanking && $o_ask_before_blanking->($hd->{device}, $err)) {
partition_table::raw::zero_MBR($hd);
} else {
#- using it readonly
+ log::l("using /proc/partitions since diskdrake failed :(");
use_proc_partitions($hd);
}
}
@@ -285,6 +287,8 @@ sub read_proc_partitions {
$part->{rootDevice} = $hd->{device} if $part->{dev} =~ /^$hd->{device}./;
}
}
+ undef $prev_part if $prev_part && ($prev_part->{rootDevice} || '') ne ($part->{rootDevice} || '');
+
$part->{device} = $dev;
$part->{size} *= 2; # from KB to sectors
$part->{type} = typeOfPart($dev);
@@ -799,7 +803,6 @@ sub compare_with_proc_partitions {
sub use_proc_partitions {
my ($hd) = @_;
- log::l("using /proc/partitions since diskdrake failed :(");
partition_table::raw::zero_MBR($hd);
$hd->{readonly} = 1;
$hd->{getting_rid_of_readonly_allowed} = 1;