diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-11-06 17:09:36 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-11-06 17:09:36 +0000 |
commit | 5424ceca56bfb9a9a749d4ec618acf434c5dc4b3 (patch) | |
tree | bb4e03a1b009fed7cff243b5c2a4bb0ef076ad8b /perl-install | |
parent | 2f6812f51d43e7b76aef7764a298b05154d308e4 (diff) | |
download | drakx-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')
-rw-r--r-- | perl-install/detect_devices.pm | 8 | ||||
-rw-r--r-- | perl-install/mouse.pm | 18 |
2 files changed, 16 insertions, 10 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index f03bbd596..b8a1ff707 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -219,13 +219,7 @@ sub hasModem($) { } sub hasMousePS2() { - my $t; sysread(tryOpen("psaux"), $t, 1) != 1 || $t ne "\xFE"; -} - -sub hasMouseUSB(;$) { - my @modules = map { "usb-$_" } qw(uhci ohci ohci-hcd); - my ($first) = @_; -# modprobe( + my $t; sysread(tryOpen("psaux"), $t, 256) != 1 || $t ne "\xFE"; } #-###################################################################################### 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"; } |