Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using mdev with usb keyboard [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Mon Aug 03, 2015 11:04 pm    Post subject: Using mdev with usb keyboard [SOLVED] Reply with quote

I've bee praising mdev but ran into a snag when implementing on my second computer. All went with a hitch, except I can't type anything! I finally realized that the first computer had a PS/2 keyboard and the second had a usb keyboard. I had run into a problem on the first computer with the mouse which I fixed with a line in /etc/conf.d/modules
Quote:
# ohci_pci and ehci_pci needed for usb mouse
modules="radeon e1000e snd_hda_intel k10temp acpi_cpufreq ohci_pci ehci_pci"


So on the second machine I changed /etc/conf.d/modules to read (eventually)
Quote:
modules="nouveau r8169 snd_hda_intel k10temp acpi_cpufreq xhci_pci ohci_pci ehci_pci usbcore usb_common usbhid "
But still no keyboard or mouse.

My kernel config is here: https://bpaste.net/show/7bfebb22cf0b


Last edited by Tony0945 on Sat Oct 24, 2015 8:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Aug 04, 2015 5:52 pm    Post subject: Reply with quote

does the keyboard works in grub?

Some older bios disable usb devices when the settings are wrong in teh bios.-
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Tue Aug 04, 2015 5:57 pm    Post subject: Reply with quote

https://github.com/slashbeast/mdev-like-a-boss

Quote:
Xorg

Build xorg-server with '-udev' USEFLAG. As we no longer use udev, we can't use evdev. Install mouse and keyboard drivers, and if you use touchpad synaptics as well. The input configuration is not the same as with evdev, we will no longer use 'InputClass' but 'InputDevice' sections. You propably do not need xorg.conf at all. Create /etc/X11/xorg.conf.d/ and copy content of the /opt/mdev/xorg.conf.d/ there. Then adjust the config files as you wish.


well this hint is a bit bogus. my opinion is that you need at least a config file in the directory shown below with the contents of the input device sections at least. so teh Claim no xorg.conf is just a lie because you need another config file with the input section. which was basically part of the xorg.conf in the past for years.

did you create this file?

Code:
ls --full-time /etc/X11/xorg.conf.d/
please

the x server should give you plenty of messages and warnings and plesae do not ignore those
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Thu Aug 06, 2015 1:41 am    Post subject: Reply with quote

Sorry to respond late. My cable modem died and my ISP just replaced it two hours ago.

Yes, keyboard works in grub. Does not work in initramfs. Doesn't work in terminal mode either if I don't launch xdm, so I doubt that the X configuration matters.

The machine is not locked up, I can ssh in to it.
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2325
Location: Germania

PostPosted: Thu Aug 06, 2015 6:40 am    Post subject: Reply with quote

well, I have the same problem on console - headless system. do you already use mdev-like-a-boss?
if not, like me, I wonder if the following may help. mdev-like-a-boss parses sysfs for usb devices which busybox[mdev] init script does not.

https://github.com/slashbeast/mdev-like-a-boss/blob/master/mdev.init#L54

I do not know if I can test that anytime soon.
_________________
boost|select libs to build|slotable|python-buildid

hear hear
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Sat Aug 08, 2015 3:19 am    Post subject: Reply with quote

Tried lifting the code from mdev-like-a-boss. Didn't work. I see the kernel messages in the syslog but no devices are created. To do it right, I need to replace busybox with the mdev from the overlay, but I'm afraid to do that.
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2325
Location: Germania

PostPosted: Sun Aug 09, 2015 10:50 am    Post subject: Reply with quote

I think I found the solution to my problem here.

I somehow thought that usb keyboards/mice need no extra kernel drivers. well, I was wrong.
I may better check kernel config: Device Drivers > HID support > Special HID drivers.

and there it was: my cherry usb keyboard driver! :oops:
now, also seen in /proc/bus/input/devices.

lets see when I get there to actually test the keyboard.

edit #1
it actually works.
_________________
boost|select libs to build|slotable|python-buildid

hear hear


Last edited by geki on Wed Aug 19, 2015 5:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Sun Aug 09, 2015 11:14 pm    Post subject: Reply with quote

Well, I unemerged busybox and emerged mdev-bb which turned out to be busybox-1.21 instead of the 1.23 that i had installed. emerged mdev-like-a-boss from the overlay. no difference.

I saved copies of ls -l /dev from mdev, mdev-like-a-boss, and eudev. The only difference was that mdev-like-a-boss did not create /dev/radio1 all the major minor numbers were the same although the order of creation varied.

There is no special driver for the Microsoft keyboard unlike the Cherry keyboard.

What I haven't tried is unplugging and replugging the mouse and keyboard at the xdm login screen to see if they hotplug. Going to try that now.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Mon Aug 10, 2015 12:10 am    Post subject: Reply with quote

Interestingly enough, the Microsoft keyboard is identified as a LITEON. I was wrong, there is a CONFIG_USB_MICROSOFT and it's set to y.

Anyway hotplugging didn't work but I have a log with two fatal errors:https://bpaste.net/show/8d247d6dac9f however, I have no idea what they mean.

I've spent the weekend reading Kay Siever's documentation, various google results, the www.kernel.org documentation, and Linux Device Drivers 3rd edition, and the mdev/udev code (ugh!). This seems like a straightforward mechanism, I can't imagine why the code and rules are so complex.

I'm kind of tempted to copy the /dev from eudev to the hard drive, remove devtmpfs from /etc/fstab, remove all &dev from rc-update levels, boot the sysrecuecd and copy that saved /dev to /dev on the root drive and just use it as a fixed /dev. But if that would work, why didn't mdev?

I reiterate, mdev (not like a boss) working fine on the system with PS/2 keyboard and usb wireless mouse, although I thing Xorg is activating the mouse.
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2325
Location: Germania

PostPosted: Mon Aug 10, 2015 6:16 am    Post subject: Reply with quote

do you see your keyboard in /proc/bus/input/devices with mdev?
I wonder if that is an indication of its working state.
_________________
boost|select libs to build|slotable|python-buildid

hear hear
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Wed Aug 12, 2015 11:31 pm    Post subject: Reply with quote

geki wrote:
do you see your keyboard in /proc/bus/input/devices with mdev?
I wonder if that is an indication of its working state.


Yes, I do.

I added "modules" to the depend line of /etc/init.d/mdev. Apparently modules were being loaded later because now the keyboard works in the consoles. However when I manually launch xdm, there is no input any more. I removed evdev and rebuilt xord and modules but the keyboard still isn't recognized in X.

At least there is some progress.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Aug 13, 2015 12:32 am    Post subject: Reply with quote

Tony0945 wrote:
I added "modules" to the depend line of /etc/init.d/mdev. Apparently modules were being loaded later because now the keyboard works in the consoles.

Tony ... you shouldn't need to do that, once mdev is in /proc/sys/kernel/hotplug any subsequent module load will trigger mdev and so the device nodes created. In my case, in case it matters, 'mdev' is in the sysinit runlevel, and 'modules' in the boot runlevel. Both of these are well before default, so any issue with the required modules, and/or device nodes, shouldn't have any effect on your having kbd at the login (or xorg) stage.

Tony0945 wrote:
However when I manually launch xdm, there is no input any more. I removed evdev and rebuilt xord and modules but the keyboard still isn't recognized in X.

You mention above that you're using mdev-like-a-boss, did you copy the contents of /opt/mdev/xorg.conf.d/ to /etc/X11/xorg.conf.d?

HTH & best ... khay
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Sat Oct 24, 2015 8:55 pm    Post subject: Reply with quote

FINALLY SOLVED!

Found in the xorg log that because hotplug was enabled, the keyboard and mouse were shut off.(????) The solution was to change "udev" to "-udev" in the xorg-server use flags.

System boots MUCH faster. Thanks to all! And thanks user chithanh in another thread who introduced me to the Magic SysRQ which I use to get to a virtual terminal to examine the Xorg log.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Oct 24, 2015 11:26 pm    Post subject: Reply with quote

Tony0945 wrote:
Found in the xorg log that because hotplug was enabled, the keyboard and mouse were shut off.(????) The solution was to change "udev" to "-udev" in the xorg-server use flags.

Tony ... its odd you should mention this because sometime back I has a discussion with krinn on this very subject, the upshot of which (as I remember) was that udev could be left enabled. I was fairly sure I'd tried this but had a similar issue to yours ...

Tony0945 wrote:
System boots MUCH faster. Thanks to all! And thanks user chithanh in another thread who introduced me to the Magic SysRQ which I use to get to a virtual terminal to examine the Xorg log.

Yes, that was my experience also ... btw, I'd also recommend switching /bin/sh to /bin/dash (if you haven't already). Instructions are here if you search for my name and dash.

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum