summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-09-30 04:03:22 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-09-30 04:03:22 +0000
commit1e486d004c45e583d5f66839cbe85fe6f0091194 (patch)
tree0a81bdac1ca7f9c9e169c85035a0f060e36d53b2
parente0f95affe2fbb4a486da48a7b621433cd79fa120 (diff)
downloaddrakx-1e486d004c45e583d5f66839cbe85fe6f0091194.tar
drakx-1e486d004c45e583d5f66839cbe85fe6f0091194.tar.gz
drakx-1e486d004c45e583d5f66839cbe85fe6f0091194.tar.bz2
drakx-1e486d004c45e583d5f66839cbe85fe6f0091194.tar.xz
drakx-1e486d004c45e583d5f66839cbe85fe6f0091194.zip
(getInputDevices) introduce it in order to list input devices
-rw-r--r--perl-install/detect_devices.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 385bbc2fa..c56fd32a1 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -447,6 +447,27 @@ sub getTVcards() {
grep { isTVcard($_) } detect_devices::probeall();
}
+sub getInputDevices() {
+ my (@devices, $device);
+ foreach (cat_('/proc/bus/input/devices')) {
+ if (/^I:/) {
+ push @devices, $device if $device;
+ $device = {};
+ $device->{vendor} = $1 if /Vendor=([0-9a-f]+)/;
+ $device->{id} = $1 if /Product=([0-9a-f]+)/;
+ }
+ $device->{description} = "|$1" if /N: Name="(.*)"/;
+ $device->{driver} = $1 if /H: Handlers=(\w+)/;
+ if (/P: Phys=(.*)/) {
+ $device->{location} = $1;
+ $device->{bus} = 'isa' if $device->{location} =~ /^isa/;
+ $device->{bus} = 'usb' if $device->{location} =~ /^usb/i;
+ }
+ }
+ push @devices, $device if $device;
+ @devices;
+}
+
sub getSerialModem {
my ($modules_conf, $o_mouse) = @_;
my $mouse = $o_mouse || {};