From e254e4769d84e9d8e512eb225d079ca87800b5ef Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 6 Sep 2000 20:12:21 +0000 Subject: no_comment --- perl-install/detect_devices.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'perl-install/detect_devices.pm') 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 { -- cgit v1.2.1