diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-07-26 06:57:00 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-07-26 06:57:00 +0000 |
commit | 7afaacde8097ff8793100eca4b8018efcf4ac5fe (patch) | |
tree | 44c6f8de36d8764eab525d7f05d3be1ad62e7738 /perl-install/detect_devices.pm | |
parent | 0ac551ba1f6be91bc213f2965d93d62a8087c956 (diff) | |
download | drakx-backup-do-not-use-7afaacde8097ff8793100eca4b8018efcf4ac5fe.tar drakx-backup-do-not-use-7afaacde8097ff8793100eca4b8018efcf4ac5fe.tar.gz drakx-backup-do-not-use-7afaacde8097ff8793100eca4b8018efcf4ac5fe.tar.bz2 drakx-backup-do-not-use-7afaacde8097ff8793100eca4b8018efcf4ac5fe.tar.xz drakx-backup-do-not-use-7afaacde8097ff8793100eca4b8018efcf4ac5fe.zip |
fix getCompaqSmartArray() on 2.6 (since /proc/driver/cciss/cciss0 doesn't talk about c0dX anymore)
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r-- | perl-install/detect_devices.pm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 0ecd3c79f..b9a7eb521 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -348,6 +348,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); @@ -357,12 +363,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 }; } } } |