summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-03-08 10:40:13 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-03-08 10:40:13 +0000
commit7b070b17a4332d1c4d540b90cbae6c6b28db1fc7 (patch)
tree69272836b59128571a7f09f233bfbecf7de152bc
parent0ebae9b982f0199e17f20a1a550c87422ca9a0b1 (diff)
downloaddrakx-7b070b17a4332d1c4d540b90cbae6c6b28db1fc7.tar
drakx-7b070b17a4332d1c4d540b90cbae6c6b28db1fc7.tar.gz
drakx-7b070b17a4332d1c4d540b90cbae6c6b28db1fc7.tar.bz2
drakx-7b070b17a4332d1c4d540b90cbae6c6b28db1fc7.tar.xz
drakx-7b070b17a4332d1c4d540b90cbae6c6b28db1fc7.zip
/proc/partitions parsing was broken for scsi cdroms using non-devfs names, and
our 2.6 doesn't use devfs names in /proc/partitions... :'-( (bugzilla #8641)
-rw-r--r--perl-install/fsedit.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm
index a41a73a97..ec8f5a634 100644
--- a/perl-install/fsedit.pm
+++ b/perl-install/fsedit.pm
@@ -268,19 +268,18 @@ sub read_proc_partitions {
my ($hds) = @_;
my @all = devices::read_proc_partitions_raw();
- my @parts = grep { $_->{dev} =~ /\d$/ } @all;
- my @disks = grep { $_->{dev} !~ /\d$/ } @all;
+ my ($parts, $disks) = partition { $_->{dev} =~ /\d$/ && $_->{dev} !~ /^(sr|scd)/ } @all;
- my $devfs_like = any { $_->{dev} =~ m|/disc$| } @disks;
+ my $devfs_like = any { $_->{dev} =~ m|/disc$| } @$disks;
my %devfs2normal = map {
my (undef, $major, $minor) = devices::entry($_->{device});
- my $disk = find { $_->{major} == $major && $_->{minor} == $minor } @disks;
+ my $disk = find { $_->{major} == $major && $_->{minor} == $minor } @$disks;
$disk->{dev} => $_->{device};
} @$hds;
my $prev_part;
- foreach my $part (@parts) {
+ foreach my $part (@$parts) {
my $dev;
if ($devfs_like) {
$dev = -e "/dev/$part->{dev}" ? $part->{dev} : sprintf("0x%x%02x", $part->{major}, $part->{minor});
@@ -300,7 +299,7 @@ sub read_proc_partitions {
$prev_part = $part;
delete $part->{dev}; # cleanup
}
- @parts;
+ @$parts;
}
sub all_hds {