summaryrefslogtreecommitdiffstats
path: root/perl-install/mouse.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-11-06 17:09:36 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-11-06 17:09:36 +0000
commit5424ceca56bfb9a9a749d4ec618acf434c5dc4b3 (patch)
treebb4e03a1b009fed7cff243b5c2a4bb0ef076ad8b /perl-install/mouse.pm
parent2f6812f51d43e7b76aef7764a298b05154d308e4 (diff)
downloaddrakx-backup-do-not-use-5424ceca56bfb9a9a749d4ec618acf434c5dc4b3.tar
drakx-backup-do-not-use-5424ceca56bfb9a9a749d4ec618acf434c5dc4b3.tar.gz
drakx-backup-do-not-use-5424ceca56bfb9a9a749d4ec618acf434c5dc4b3.tar.bz2
drakx-backup-do-not-use-5424ceca56bfb9a9a749d4ec618acf434c5dc4b3.tar.xz
drakx-backup-do-not-use-5424ceca56bfb9a9a749d4ec618acf434c5dc4b3.zip
no_comment
Diffstat (limited to 'perl-install/mouse.pm')
-rw-r--r--perl-install/mouse.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm
index 795d859b1..ecedfff9a 100644
--- a/perl-install/mouse.pm
+++ b/perl-install/mouse.pm
@@ -8,6 +8,10 @@ use strict;
#-######################################################################################
use common qw(:common :system :functional :file);
use modules;
+use pci_probing::main;
+use detect_devices;
+use run_program;
+use commands;
use log;
my @mouses_fields = qw(nbuttons device MOUSETYPE XMOUSETYPE FULLNAME);
@@ -80,8 +84,16 @@ sub write($;$) {
}
sub detect() {
+ detect_devices::hasMousePS2 and return name2mouse("Generic Mouse (PS/2)");
+
my %l;
- eval { modules::load("serial") };
- @l{qw(FULLNAME nbuttons MOUSETYPE XMOUSETYPE device)} = split("\n", `mouseconfig --nointeractive 2>/dev/null`) or die "mouseconfig failed";
- \%l;
+ eval { commands::modprobe("serial") };
+ @l{qw(FULLNAME nbuttons MOUSETYPE XMOUSETYPE device)} = split("\n", `mouseconfig --nointeractive 2>/dev/null`) and return \%l;
+ eval { run_program::run("rmmod", "serial") };
+
+ if (my ($c) = pci_probing::main::probe("SERIAL_USB")) {
+ eval { modules::load($c->[1]) };
+ return name2mouse("Generic Mouse (PS/2)") if !$@ && detect_devices::tryOpen("usbmouse");
+ }
+ die "mouseconfig failed";
}