summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-03-24 14:29:56 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-03-24 14:29:56 +0000
commitf74c3b0afadaa40c9a784321029959a7fffdd0e6 (patch)
tree32777c65d09619bfde64fd85ce6f4ab161bddb23 /perl-install/detect_devices.pm
parented76955e239d467e996ea3d20e8ae14c13db0253 (diff)
downloaddrakx-f74c3b0afadaa40c9a784321029959a7fffdd0e6.tar
drakx-f74c3b0afadaa40c9a784321029959a7fffdd0e6.tar.gz
drakx-f74c3b0afadaa40c9a784321029959a7fffdd0e6.tar.bz2
drakx-f74c3b0afadaa40c9a784321029959a7fffdd0e6.tar.xz
drakx-f74c3b0afadaa40c9a784321029959a7fffdd0e6.zip
no_comment
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm19
1 files changed, 18 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 816277cb5..e5ca00ea5 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -7,7 +7,7 @@ use strict;
#- misc imports
#-######################################################################################
use log;
-use common qw(:common :file);
+use common qw(:common :file :functional);
use devices;
use c;
@@ -197,6 +197,23 @@ sub syslog {
sub hasSMP { c::detectSMP() }
+sub hasHPT {
+ 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');
+
+ 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
+ }
+ };
+ log::l("HPT|Ultra66: found $ide");
+ $ide;
+}
+
sub whatParport() {
my @res =();
foreach (0..3) {