https://redmine.graphics-muse.org/https://redmine.graphics-muse.org/favicon.ico?16278048512014-02-15T23:56:14ZGraphics Muse Issue TrackerPiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9852014-02-15T23:56:14ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul>No answers of any use on the mailing list. The next step is to look at these:
<ol>
<li><a class="external" href="http://git.r-36.net/nldev/">http://git.r-36.net/nldev/</a>
<ol>
<li><a class="external" href="http://git.r-36.net/nlmon/">http://git.r-36.net/nlmon/</a></li>
<li><a class="external" href="http://lists.suckless.org/dev/1204/11576.html">http://lists.suckless.org/dev/1204/11576.html</a> (announcement for nldev)</li>
</ol>
</li>
<li><a class="external" href="http://git.2f30.org/smdev">http://git.2f30.org/smdev</a>
<ol>
<li><a class="external" href="https://groups.google.com/forum/#!topic/wmii/o7GksBsfTvQ">https://groups.google.com/forum/#!topic/wmii/o7GksBsfTvQ</a> (discussion of smdev)</li>
</ol>
</li>
<li><a class="external" href="http://www.openwall.com/lists/musl/2012/05/22/8">http://www.openwall.com/lists/musl/2012/05/22/8</a> (discussion showing nldev and mdev replacing udev)</li>
<li><a class="external" href="http://sta.li/technologies">http://sta.li/technologies</a> (static linux - part of suckless.org)</li>
</ol>
<p>It appears it may be useful as a front end to mdev.</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9892014-02-18T02:23:11ZHammelmjhammel@graphics-muse.org
<ul><li><strong>File</strong> <a href="/attachments/49">Makefile</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/49/Makefile">Makefile</a> added</li><li><strong>File</strong> <a href="/attachments/50">S10nldev</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/50/S10nldev">S10nldev</a> added</li><li><strong>% Done</strong> changed from <i>10</i> to <i>20</i></li></ul><p>Cross compiling nldev was easy. See attached modified Makefile. It was run with this command:</p>
<pre>
make STAGING=$staging CC=arm-unknown-linux-gnueabi-cc PREFIX=`pwd`/install install
</pre>
where
<ul>
<li>$staging = <Buildroot>/output/staging</li>
</ul>
Once it's built you apparently do the following:
<ol>
<li>copy <src>/install/* to pibox:/usr/</li>
<li>copy <src>/mdev/etc/mdev.conf to pibox:/etc/mdev.conf</li>
<li>mkdir pibox:/lib/mdev</li>
<li>copy <src>/mdev/lib/* to pibox:/lib/mdev</li>
<li>Add S10nldev (see attached init script) to pibox:/etc/init.d/ so it runs after mdev is inserted to handle hotplugging</li>
</ol>
<p>That should be it. This hasn't been tried yet, but it's what I'll be testing next.</p>
<p>If this works then I need to make a Buildroot package for nldev.</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9902014-02-18T03:11:40ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>20</i> to <i>30</i></li></ul><p>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.</p>
<p>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).</p>
<p>So the two things to do now:<br />1. Merge the mdev.conf files<br />2. Create an nldev package for Buildroot</p>
<p>I'm getting very close to getting to update the kernel to 3.10.x!!</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9922014-02-19T15:25:21ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>30</i> to <i>70</i></li></ul><p>Added nldev package to Buildroot 2013.11 build.</p>
<p>Still need to tweak the nldev mdev.conf for PiBox specific needs. This would be a modification to the existing skeleton/etc/mdev.conf.</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9932014-02-20T02:23:29ZHammelmjhammel@graphics-muse.org
<ul><li><strong>File</strong> <a href="/attachments/51">mdev.conf</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/51/mdev.conf">mdev.conf</a> added</li><li><strong>% Done</strong> changed from <i>70</i> to <i>80</i></li></ul>Merged the two mdev.conf's (PiBox and nldev, see attachment) and tested. Most of the system comes up just fine. Certainly the USB wifi is available and the SD card is mounted. But the following two drivers are not loaded:
<ol>
<li>uvcvideo</li>
<li>videodev</li>
</ol>
usbhandler.conf specified which driver was loaded (via usbhandler.sh) but the mdev.conf is currently using /lib/mdev/usb (nldev's handler). So I'll need to merge these two scripts:
<ol>
<li>usbhandler.sh (PiBox)</li>
<li>usb (nldev)</li>
</ol>
<p>After that, I should be golden with 3.10.y and Buildroot 2013.11.</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9962014-02-22T16:55:26ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Priority</strong> changed from <i>High</i> to <i>Immediate</i></li><li><strong>Target version</strong> changed from <i>1.0 - Atreides</i> to <i>0.8.0</i></li></ul><p>Retargeting for 0.8.0.</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9972014-02-24T00:12:59ZHammelmjhammel@graphics-muse.org
<ul><li><strong>File</strong> <a href="/attachments/52">S10usbdev</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/52/S10usbdev">S10usbdev</a> added</li><li><strong>% Done</strong> changed from <i>80</i> to <i>90</i></li></ul><p>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.</p>
<p>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.</p>
<p>The new init script is included here, for reference. It's been added to the source tree already.</p>
<p>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.</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9982014-02-26T03:36:27ZHammelmjhammel@graphics-muse.org
<ul><li><strong>% Done</strong> changed from <i>90</i> to <i>80</i></li></ul><p>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.</p>
<p>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.</p>
<p>So I've set the KERNEL_GIT_ID to back up to the 3.10.31 merge and will try again.</p> PiBox - Bug #273: mdev doesn't load usb drivers on boot with 3.10.y RPI kernelhttps://redmine.graphics-muse.org/issues/273?journal_id=9992014-02-27T04:19:51ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>80</i> to <i>100</i></li></ul><p>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.</p>
<p>Changes pushed upstream.</p>
<p>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.</p>
<p>This issue can be closed.</p>