summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-06 20:12:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-06 20:12:21 +0000
commite254e4769d84e9d8e512eb225d079ca87800b5ef (patch)
treeac3ea3dd110b579118eb5f92e8c3177db7c92871 /perl-install/detect_devices.pm
parent967c918d9eaf22eceee3c3b3ed448d141e38fd00 (diff)
downloaddrakx-backup-do-not-use-e254e4769d84e9d8e512eb225d079ca87800b5ef.tar
drakx-backup-do-not-use-e254e4769d84e9d8e512eb225d079ca87800b5ef.tar.gz
drakx-backup-do-not-use-e254e4769d84e9d8e512eb225d079ca87800b5ef.tar.bz2
drakx-backup-do-not-use-e254e4769d84e9d8e512eb225d079ca87800b5ef.tar.xz
drakx-backup-do-not-use-e254e4769d84e9d8e512eb225d079ca87800b5ef.zip
no_comment
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index adc701a81..6bcf38ac6 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -228,6 +228,20 @@ sub syslog {
`dmesg`;
}
+sub hasUsb {
+ my ($class, $prot) = @_;
+ foreach (cat_("/proc/bus/usb/devices")) {
+ if (/^P/ .. /^I/) {
+ my ($c, $p) = /Cls=(\d+).*Prot=(\d+)/;
+ $c == $class && ($prot < 0 || $prot == $p) and log::l("found usb $c $p"), return 1;
+ }
+ }
+ 0;
+}
+sub hasUsbKeyboard { hasUsb(3, 1) }
+sub hasUsbMouse { hasUsb(3, 2) }
+sub hasUsbZip { hasUsb(8, -1) }
+
sub hasSMP { c::detectSMP() }
sub hasUltra66 {