summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-03-30 14:35:23 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-03-30 14:35:23 +0000
commit18011f2e9d699e37c6da8bec2d02de2b84a96a85 (patch)
treefdf782dfce0c929d31fe317a8b22c62518c19f56 /perl-install/detect_devices.pm
parented9b8286889057ba6a4983d4afb266d74cac20f0 (diff)
downloaddrakx-18011f2e9d699e37c6da8bec2d02de2b84a96a85.tar
drakx-18011f2e9d699e37c6da8bec2d02de2b84a96a85.tar.gz
drakx-18011f2e9d699e37c6da8bec2d02de2b84a96a85.tar.bz2
drakx-18011f2e9d699e37c6da8bec2d02de2b84a96a85.tar.xz
drakx-18011f2e9d699e37c6da8bec2d02de2b84a96a85.zip
no_comment
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm18
1 files changed, 8 insertions, 10 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 15db77742..04cef1ccb 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -63,7 +63,7 @@ sub isRemovableDrive() { &isZipDrive || &isLS120Drive } #-or &isJazzDrive }
sub hasSCSI() {
local *F;
- open F, "/proc/scsi/scsi" or log::l("failed to open /proc/scsi/scsi: $!"), return 0;
+ open F, "/proc/scsi/scsi" or return 0;
foreach (<F>) {
/devices: none/ and log::l("no scsi devices are available"), return 0;
}
@@ -197,20 +197,18 @@ sub syslog {
sub hasSMP { c::detectSMP() }
-#- warning: hasHPT does a pci probe
-sub hasHPT {
+#- warning: hasUltra66 does a pci probe
+sub hasUltra66 {
cat_("/proc/cmdline") =~ /(ide2=(\S+)(\s+ide3=(\S+))?)/ and return $1;
require pci_probing::main;
my @l = map { $_->[0] } grep { $_->[1] =~ /(HPT|Ultra66)/ } pci_probing::main::probe('STORAGE_OTHER', 'more') or return;
- my $ide = sprintf "ide2=0x%x,0x%x ide3=0x%x,0x%x", map_index { hex($_) + (odd($::i) ? 1 : -1) } do {
- if (@l == 2) {
- map { (split ' ')[3..4] } @l
- } else {
- map { (split ' ')[3..6] } @l
- }
- };
+ my $ide = sprintf "ide2=0x%x,0x%x ide3=0x%x,0x%x",
+ @l == 2 ?
+ (map_index { hex($_) + (odd($::i) ? 1 : -1) } map { (split ' ')[3..4] } @l) :
+ (map_index { hex($_) - 1 } map { (split ' ')[3..6] } @l);
+
log::l("HPT|Ultra66: found $ide");
$ide;
}