Bug #273
closedmdev doesn't load usb drivers on boot with 3.10.y RPI kernel
100%
Description
The problem appears to be that usbfs was deprecated in 3.6. So mdev needs a different method of identifying usb devices on boot in order to load their drivers. Without this fix things like BLE (RM #252) can't be added.
I've posted a question about this to the Busybox mailing list.
Files
Updated by Hammel almost 11 years ago
- % Done changed from 0 to 10
- http://git.r-36.net/nldev/
- http://git.r-36.net/nlmon/
- http://lists.suckless.org/dev/1204/11576.html (announcement for nldev)
- http://git.2f30.org/smdev
- https://groups.google.com/forum/#!topic/wmii/o7GksBsfTvQ (discussion of smdev)
- http://www.openwall.com/lists/musl/2012/05/22/8 (discussion showing nldev and mdev replacing udev)
- http://sta.li/technologies (static linux - part of suckless.org)
It appears it may be useful as a front end to mdev.
Updated by Hammel almost 11 years ago
Cross compiling nldev was easy. See attached modified Makefile. It was run with this command:
make STAGING=$staging CC=arm-unknown-linux-gnueabi-cc PREFIX=`pwd`/install installwhere
- $staging = <Buildroot>/output/staging
- copy <src>/install/* to pibox:/usr/
- copy <src>/mdev/etc/mdev.conf to pibox:/etc/mdev.conf
- mkdir pibox:/lib/mdev
- copy <src>/mdev/lib/* to pibox:/lib/mdev
- Add S10nldev (see attached init script) to pibox:/etc/init.d/ so it runs after mdev is inserted to handle hotplugging
That should be it. This hasn't been tried yet, but it's what I'll be testing next.
If this works then I need to make a Buildroot package for nldev.
Updated by Hammel almost 11 years ago
- % Done changed from 20 to 30
This works a bit better than mdev by itself. One problem is that nldev is looking for /bin/mdev while Busybox it putting this under /sbin. Making a symlink fixed that.
I tested this with my old mdev.conf but it doesn't work. I tried it with the nldev version of mdev.conf and all the USB device drivers were loaded properly. So I need to merge the mdev.conf so I can get mmc mounted correctly (which my script does but nldev's doesn't).
So the two things to do now:
1. Merge the mdev.conf files
2. Create an nldev package for Buildroot
I'm getting very close to getting to update the kernel to 3.10.x!!
Updated by Hammel almost 11 years ago
- % Done changed from 30 to 70
Added nldev package to Buildroot 2013.11 build.
Still need to tweak the nldev mdev.conf for PiBox specific needs. This would be a modification to the existing skeleton/etc/mdev.conf.
Updated by Hammel almost 11 years ago
- uvcvideo
- videodev
- usbhandler.sh (PiBox)
- usb (nldev)
After that, I should be golden with 3.10.y and Buildroot 2013.11.
Updated by Hammel almost 11 years ago
- Priority changed from High to Immediate
- Target version changed from 1.0 - Atreides to 0.8.0
Retargeting for 0.8.0.
Updated by Hammel almost 11 years ago
Turns out that nldev + mdev didn't work consistently to load the modules. The former didn't always ensure that event notifications would arrive at mdev. Sometimes I got some of the usb devices, other times I didn't get any. The only drivers that were always loaded were those included in /etc/modules.conf, which were loaded by S00dev's call of /etc/rc.modules.
So I'm punting on this. The alternative is to fall back to a variation on usbhandler.sh, which was being called by mdev in 3.2.x. It's still called by mdev in 3.10.x, but now I'm adding an init script that loads the configuration file (/etc/usbhandler.conf) and loads the output of lsusb into a shell variable. It then uses the latter to find drivers in the former and loads them. This script runs after mdev starts and fails silently if the driver is already loaded.
The new init script is included here, for reference. It's been added to the source tree already.
I just need to do a full kernel and rootfs build to verify this is working properly. Then I can close this issue and be moved permanently to the 3.10.y tree.
Updated by Hammel almost 11 years ago
- % Done changed from 90 to 80
Ugh. This never ends. So I rebuilt on my desktop instead of the build machine. The desktop picked up 3.10.32. The build machine had 3.10.30. The latter works. The former doesn't. They have the same kernel config. They have the same rootfs. On the 3.10.30 box lsusb works. On 3.10.32 it doesn't. So my little trick of using lsusb fails on the later kernel.
3.10.32 is the latest long term stable kernel for the 3.10.x branch. So I can see why they're tracking it with the Raspberry Pi tree. The previous long term stable release is a 3.4 tree. But that's not good enough for use with BLE (Bluetooth Low Energy). So I have to make the 3.10.x series work.
So I've set the KERNEL_GIT_ID to back up to the 3.10.31 merge and will try again.
Updated by Hammel almost 11 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100
The 3.10.y branch works if you use the correct git ID. I found that the last merge with the upstream 3.10.31 branch at kernel.org works correctly with lsusb, allowing the new S10usbdev init script to properly load usb drivers.
Changes pushed upstream.
So now PiBox is rev'd to the 3.10.y branch, which is what the fbtft driver is mainlained with and which will allow use of BLE support.
This issue can be closed.