]> pere.pagekite.me Git - homepage.git/blobdiff - blog/archive/2013/01/index.html
Generated.
[homepage.git] / blog / archive / 2013 / 01 / index.html
index 15944c320bfa52179561c697b47395f752925654..b74f53c36e433f2c889cbf8c8a2cbaeb83db255b 100644 (file)
 
     <h3>Entries from January 2013.</h3>
     
+    <div class="entry">
+      <div class="title">
+        <a href="http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html">Using modalias info to find packages handling my hardware</a>
+      </div>
+      <div class="date">
+        15th January 2013
+      </div>
+      <div class="body">
+        <p>Yesterday, I wrote about the
+<a href="http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">modalias
+values provided by the Linux kernel</a> following my hope for
+<a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">better
+dongle support in Debian</a>.  Using this knowledge, I have tested how
+modalias values attached to package names can be used to map packages
+to hardware.  This allow the system to look up and suggest relevant
+packages when I plug in some new hardware into my machine, and replace
+discover and discover-data as the database used to map hardware to
+packages.</p>
+
+<p>I create a modaliases file with entries like the following,
+containing package name, kernel module name (if relevant, otherwise
+the package name) and globs matching the relevant hardware
+modalias.</p>
+
+<p><blockquote>
+Package: package-name
+<br>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)</p>
+</blockquote></p>
+
+<p>It is fairly trivial to write code to find the relevant packages
+for a given modalias value using this file.</p>
+
+<p>An entry like this would suggest the video and picture application
+cheese for many USB web cameras (interface bus class 0E01):</p>
+
+<p><blockquote>
+Package: cheese
+<br>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)</p>
+</blockquote></p>
+
+<p>An entry like this would suggest the pcmciautils package when a
+CardBus bridge (bus class 0607) PCI device is present:</p>
+
+<p><blockquote>
+Package: pcmciautils
+<br>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
+</blockquote></p>
+
+<p>An entry like this would suggest the package colorhug-client when
+plugging in a ColorHug with USB IDs 04D8:F8DA:</p>
+
+<p><blockquote>
+Package: colorhug-client
+<br>Modaliases: colorhug-client(usb:v04D8pF8DAd*)</p>
+</blockquote></p>
+
+<p>I believe the format is compatible with the format of the Packages
+file in the Debian archive.  Ubuntu already uses their Packages file
+to store their mappings from packages to hardware.</p>
+
+<p>By adding a XB-Modaliases: header in debian/control, any .deb can
+announce the hardware it support in a way my prototype understand.
+This allow those publishing packages in an APT source outside the
+Debian archive as well as those backporting packages to make sure the
+hardware mapping are included in the package meta information.  I've
+tested such header in the pymissile package, and its modalias mapping
+is working as it should with my prototype.  It even made it to Ubuntu
+Raring.</p>
+
+<p>To test if it was possible to look up supported hardware using only
+the shell tools available in the Debian installer, I wrote a shell
+implementation of the lookup code.  The idea is to create files for
+each modalias and let the shell do the matching.  Please check out and
+try the
+<a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co">hw-support-lookup</a>
+shell script.  It run without any extra dependencies and fetch the
+hardware mappings from the Debian archive and the subversion
+repository where I currently work on my prototype.</p>
+
+<p>When I use it on a machine with a yubikey inserted, it suggest to
+install yubikey-personalization:</p>
+
+<p><blockquote>
+% ./hw-support-lookup
+<br>yubikey-personalization:
+<br>%
+</blockquote></p>
+
+<p>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
+propose to install the pcmciautils package:</p>
+
+<p><blockquote>
+% ./hw-support-lookup 
+<br>pcmciautils
+<br>%
+</blockquote></p>
+
+<p>If you know of any hardware-package mapping that should be added to
+<a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co">my
+database</a>, please tell me about it.</p>
+
+<p>It could be possible to generate several of the mappings between
+packages and hardware.  One source would be to look at packages with
+kernel modules, ie packages with *.ko files in /lib/modules/, and
+extract their modalias information.  Another would be to look at
+packages with udev rules, ie packages with files in
+/lib/udev/rules.d/, and extract their vendor/model information to
+generate a modalias matching rule.  I have not tested any of these to
+see if it work.</p>
+
+<p>If you want to help implementing a system to let us propose what
+packages to install when new hardware is plugged into a Debian
+machine, please send me an email or talk to me on
+<a href="irc://irc.debian.org/%23debian-devel">#debian-devel</a>.</p>
+
+      </div>
+      <div class="tags">
+        
+        
+        Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
+        
+        
+      </div>
+    </div>
+    <div class="padding"></div>
+    
     <div class="entry">
       <div class="title">
         <a href="http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">Modalias strings - a practical way to map "stuff" to hardware</a>
@@ -583,7 +709,7 @@ siste måneden.</p>
 <li>2013
 <ul>
 
-<li><a href="http://people.skolelinux.org/pere/blog/archive/2013/01/">January (5)</a></li>
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2013/01/">January (6)</a></li>
 
 </ul></li>
 
@@ -733,7 +859,7 @@ siste måneden.</p>
 
  <li><a href="http://people.skolelinux.org/pere/blog/tags/bsa">bsa (2)</a></li>
 
- <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (63)</a></li>
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (64)</a></li>
 
  <li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (118)</a></li>
 
@@ -743,7 +869,7 @@ siste måneden.</p>
 
  <li><a href="http://people.skolelinux.org/pere/blog/tags/drivstoffpriser">drivstoffpriser (4)</a></li>
 
- <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (169)</a></li>
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (170)</a></li>
 
  <li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (21)</a></li>