]> pere.pagekite.me Git - homepage.git/blobdiff - blog/archive/2013/01/01.rss
Generated.
[homepage.git] / blog / archive / 2013 / 01 / 01.rss
index 9ed8f40613e85afd2822f3d482af7d91c3665b5c..1814573145a8c7cc7f5c7f85c3381f4f7790cc63 100644 (file)
@@ -6,6 +6,120 @@
                 <link>http://people.skolelinux.org/pere/blog/</link>
 
        
+       <item>
+               <title>Using modalias info to find packages handling my hardware</title>
+               <link>http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html</guid>
+                <pubDate>Tue, 15 Jan 2013 08:00:00 +0100</pubDate>
+               <description>&lt;p&gt;Yesterday, I wrote about the
+&lt;a href=&quot;http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html&quot;&gt;modalias
+values provided by the Linux kernel&lt;/a&gt; following my hope for
+&lt;a href=&quot;http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html&quot;&gt;better
+dongle support in Debian&lt;/a&gt;.  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.&lt;/p&gt;
+
+&lt;p&gt;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.&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;
+Package: package-name
+&lt;br&gt;Modaliases: module(modaliasglob, modaliasglob, modaliasglob)&lt;/p&gt;
+&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;It is fairly trivial to write code to find the relevant packages
+for a given modalias value using this file.&lt;/p&gt;
+
+&lt;p&gt;An entry like this would suggest the video and picture application
+cheese for many USB web cameras (interface bus class 0E01):&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;
+Package: cheese
+&lt;br&gt;Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)&lt;/p&gt;
+&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;An entry like this would suggest the pcmciautils package when a
+CardBus bridge (bus class 0607) PCI device is present:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;
+Package: pcmciautils
+&lt;br&gt;Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
+&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;An entry like this would suggest the package colorhug-client when
+plugging in a ColorHug with USB IDs 04D8:F8DA:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;
+Package: colorhug-client
+&lt;br&gt;Modaliases: colorhug-client(usb:v04D8pF8DAd*)&lt;/p&gt;
+&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;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.&lt;/p&gt;
+
+&lt;p&gt;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&#39;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.&lt;/p&gt;
+
+&lt;p&gt;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
+&lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co&quot;&gt;hw-support-lookup&lt;/a&gt;
+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.&lt;/p&gt;
+
+&lt;p&gt;When I use it on a machine with a yubikey inserted, it suggest to
+install yubikey-personalization:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;
+% ./hw-support-lookup
+&lt;br&gt;yubikey-personalization:
+&lt;br&gt;%
+&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
+propose to install the pcmciautils package:&lt;/p&gt;
+
+&lt;p&gt;&lt;blockquote&gt;
+% ./hw-support-lookup 
+&lt;br&gt;pcmciautils
+&lt;br&gt;%
+&lt;/blockquote&gt;&lt;/p&gt;
+
+&lt;p&gt;If you know of any hardware-package mapping that should be added to
+&lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co&quot;&gt;my
+database&lt;/a&gt;, please tell me about it.&lt;/p&gt;
+
+&lt;p&gt;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.&lt;/p&gt;
+
+&lt;p&gt;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
+&lt;a href=&quot;irc://irc.debian.org/%23debian-devel&quot;&gt;#debian-devel&lt;/a&gt;.&lt;/p&gt;
+</description>
+       </item>
+       
        <item>
                <title>Modalias strings - a practical way to map &quot;stuff&quot; to hardware</title>
                <link>http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html</link>