summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-28 01:49:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-28 01:49:44 +0000
commitc635a97bf47b8d45b2e2762445f980bf6e36ab5d (patch)
tree89a9ae3bcb1551fb064f7b2e623414f35d9b7d2a
parent47f3422c420c94125c52535342ebb4e97875214c (diff)
downloaddrakx-c635a97bf47b8d45b2e2762445f980bf6e36ab5d.tar
drakx-c635a97bf47b8d45b2e2762445f980bf6e36ab5d.tar.gz
drakx-c635a97bf47b8d45b2e2762445f980bf6e36ab5d.tar.bz2
drakx-c635a97bf47b8d45b2e2762445f980bf6e36ab5d.tar.xz
drakx-c635a97bf47b8d45b2e2762445f980bf6e36ab5d.zip
fix getCompaqSmartArray() on 2.6 (since /proc/driver/cciss/cciss0 doesn't talk about c0dX anymore)
-rw-r--r--perl-install/detect_devices.pm20
1 files changed, 14 insertions, 6 deletions
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 };
}
}
}