LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-15-2016, 04:42 AM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,044

Rep: Reputation: Disabled
Patch for /var/log/setup/setup.mouse (package gpm)


setup.mouse greps /proc/bus/usb/devices to know if there is an USB mouse.

But in Slackware 14.2 there is no more /proc/bus/usb/devices directory, thus the test always fails and USB mice are not autodected.

This is unfortunate, because nowadays most mice are USB, so during installation the user is uselessly asked which is the mouse type. I propose this patch to fix that:
Code:
--- setup.mouse    2008-03-15 21:30:07.000000000 +0100
+++ setup.mouse.new    2016-12-15 11:24:29.004962521 +0100
@@ -4,8 +4,8 @@
 TMP=/var/log/setup/tmp
 GPM=/usr/sbin/gpm
 # If the mouse is USB, we can autodetect it:
-if [ -r /proc/bus/usb/devices ]; then
- if cat /proc/bus/usb/devices | grep usb_mouse 1> /dev/null 2> /dev/null ; then
+if [ -r /proc/bus/input/devices ]; then
+ if grep -B3 Handlers=mouse /proc/bus/input/devices | grep Phys=usb 1>/dev/null 2>/dev/null; then
   MOUSE_TYPE=usb
   MTYPE="imps2"
   ( cd $T_PX/dev ; rm -f mouse ; ln -sf input/mice mouse )
This works here™ but of course there is no guarantee.

I have also considered grepping the output of lsusb, but I assume that then the test would fail for an USB mouse whose model is not registered in the hardware database, unless maybe finding one's way in the output of "lsusb -v", which I am too lazy to attempt.

Last edited by Didier Spaier; 12-15-2016 at 07:04 AM. Reason: Lats part of last sentance added, from ",unless"
 
Old 12-15-2016, 09:03 PM   #2
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,454

Rep: Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347Reputation: 8347
I've always picked the default imps2 for my USB mice and they work fine with that. But I'll look into this anyway.
 
1 members found this post helpful.
Old 12-16-2016, 01:03 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,044

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by volkerdi View Post
I've always picked the default imps2 for my USB mice and they work fine with that.
Same here.

But my point is that without the patch, during installation the user is proposed to select the mouse type in all cases.

With the patch applied, in case of an USB mouse (99,17625% of mice are USB nowadays) the user is directly proposed the second dialog: shall we load the gpm program at boot time? and if the answer is yes the mouse type will be set to imps2, which is indeed correct.

My guess is: this is the behavior you intended for USB mice and it worked that way until the layout of /proc changed, I do not know when.

Sorry if the first post was unclear, my usual excuse being that English is not my native language
Attached Thumbnails
Click image for larger version

Name:	select_the_mouse_type.png
Views:	26
Size:	9.8 KB
ID:	23778   Click image for larger version

Name:	start_gpm_or_not.png
Views:	25
Size:	5.0 KB
ID:	23779  

Last edited by Didier Spaier; 12-16-2016 at 05:17 AM. Reason: Sentence beginning with "My guess" modified.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help on setup of fedora 20 as a router from nic setup to firewalld setup Brian1 Linux - Networking 4 07-02-2014 08:53 PM
setup for official Laptop. (Admin setup in server and user account setup in lap) vignesh4sh Linux - Server 3 11-26-2012 07:03 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
/var/log/packages and /var/log/setup sunny_5252 Slackware 4 05-17-2007 08:17 PM
Recreate a package from /var/log/package/ Vgui Slackware 2 08-31-2005 10:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration