From c635a97bf47b8d45b2e2762445f980bf6e36ab5d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 28 Jul 2004 01:49:44 +0000 Subject: fix getCompaqSmartArray() on 2.6 (since /proc/driver/cciss/cciss0 doesn't talk about c0dX anymore) --- perl-install/detect_devices.pm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'perl-install/detect_devices.pm') diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index cec1646f6..60ce4c30d 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -344,6 +344,12 @@ sub getIDE() { @idi; } +sub block_devices() { + -d '/sys/block' + ? map { s|!|/|; $_ } all('/sys/block') + : map { $_->{dev} } devices::read_proc_partitions_raw(); +} + sub getCompaqSmartArray() { my (@idi, $f); @@ -353,12 +359,14 @@ sub getCompaqSmartArray() { my ($name) = m|/(.*)|; for (my $i = 0; -r ($f = "${prefix}$i"); $i++) { - foreach (cat_($f)) { - if (my ($raw_device) = m|^\s*($name/.*?):|) { - my $device = -d "/dev/$raw_device" ? "$raw_device/disc" : $raw_device; - push @idi, { device => $device, prefix => $raw_device . 'p', info => "Compaq RAID logical disk", - media_type => 'hd', bus => 'ida' }; - } + my @raw_devices = cat_($f) =~ m|^\s*($name/.*?):|gm; + @raw_devices or @raw_devices = grep { m!^$name/! } block_devices(); + + foreach my $raw_device (@raw_devices) { + my $device = -d "/dev/$raw_device" ? "$raw_device/disc" : $raw_device; + push @idi, { device => $device, prefix => $raw_device . 'p', + info => "Compaq RAID logical disk", + media_type => 'hd', bus => $name }; } } } -- cgit v1.2.1