]> pere.pagekite.me Git - homepage.git/blob - blog/tags/isenkram/isenkram.rss
ad2e79a04904262cbfe3203f9ec7a7a5d8257f66
[homepage.git] / blog / tags / isenkram / isenkram.rss
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries tagged isenkram</title>
5 <description>Entries tagged isenkram</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>Welcome to the world, Isenkram!</title>
11 <link>http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html</guid>
13 <pubDate>Tue, 22 Jan 2013 22:00:00 +0100</pubDate>
14 <description>&lt;p&gt;Yesterday, I
15 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html&quot;&gt;asked
16 for testers&lt;/a&gt; for my prototype for making Debian better at handling
17 pluggable hardware devices, which I
18 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html&quot;&gt;set
19 out to create&lt;/a&gt; earlier this month. Several valuable testers showed
20 up, and caused me to really want to to open up the development to more
21 people. But before I did this, I want to come up with a sensible name
22 for this project. Today I finally decided on a new name, and I have
23 renamed the project from hw-support-handler to this new name. In the
24 process, I moved the source to git and made it available as a
25 &lt;a href=&quot;http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git&quot;&gt;collab-maint&lt;/a&gt;
26 repository in Debian. The new name? It is &lt;strong&gt;Isenkram&lt;/strong&gt;.
27 To fetch and build the latest version of the source, use&lt;/p&gt;
28
29 &lt;pre&gt;
30 git clone git://anonscm.debian.org/collab-maint/isenkram.git
31 cd isenkram &amp;&amp; git-buildpackage
32 &lt;/pre&gt;
33
34 &lt;p&gt;I have not yet adjusted all files to use the new name yet. If you
35 want to hack on the source or improve the package, please go ahead.
36 But please talk to me first on IRC or via email before you do major
37 changes, to make sure we do not step on each others toes. :)&lt;/p&gt;
38
39 &lt;p&gt;If you wonder what &#39;isenkram&#39; is, it is a Norwegian word for iron
40 stuff, typically meaning tools, nails, screws, etc. Typical hardware
41 stuff, in other words. I&#39;ve been told it is the Norwegian variant of
42 the German word eisenkram, for those that are familiar with that
43 word.&lt;/p&gt;
44 </description>
45 </item>
46
47 <item>
48 <title>First prototype ready making hardware easier to use in Debian</title>
49 <link>http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html</link>
50 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html</guid>
51 <pubDate>Mon, 21 Jan 2013 12:00:00 +0100</pubDate>
52 <description>&lt;p&gt;Early this month I set out to try to
53 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html&quot;&gt;improve
54 the Debian support for pluggable hardware devices&lt;/a&gt;. Now my
55 prototype is working, and it is ready for a larger audience. To test
56 it, fetch the
57 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/&quot;&gt;source
58 from the Debian Edu subversion repository&lt;/a&gt;, build and install the
59 package. You might have to log out and in again activate the
60 autostart script.&lt;/p&gt;
61
62 &lt;p&gt;The design is simple:&lt;/p&gt;
63
64 &lt;ul&gt;
65
66 &lt;li&gt;Add desktop entry in /usr/share/autostart/ causing a program
67 hw-support-handlerd to start when the user log in.&lt;/li&gt;
68
69 &lt;li&gt;This program listen for kernel events about new hardware (directly
70 from the kernel like udev does), not using HAL dbus events as I
71 initially did.&lt;/li&gt;
72
73 &lt;li&gt;When new hardware is inserted, look up the hardware modalias in
74 the APT database, a database
75 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup&quot;&gt;available
76 via HTTP&lt;/a&gt; and a database available as part of the package.&lt;/li&gt;
77
78 &lt;li&gt;If a package is mapped to the hardware in question, the package
79 isn&#39;t installed yet and this is the first time the hardware was
80 plugged in, show a desktop notification suggesting to install the
81 package or packages.&lt;/li&gt;
82
83 &lt;li&gt;If the user click on the &#39;install package now&#39; button, ask
84 aptdaemon via the PackageKit API to install the requrired package.&lt;/li&gt;
85
86 &lt;li&gt;aptdaemon ask for root password or sudo password, and install the
87 package while showing progress information in a window.&lt;/li&gt;
88
89 &lt;/ul&gt;
90
91 &lt;p&gt;I still need to come up with a better name for the system. Here
92 are some screen shots showing the prototype in action. First the
93 notification, then the password request, and finally the request to
94 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.&lt;/p&gt;
95
96 &lt;p&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-1-notification.png&quot;&gt;
97 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-2-password.png&quot;&gt;
98 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-3-dependencies.png&quot;&gt;
99 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-4-installing.png&quot;&gt;
100 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-5-installing-details.png&quot; width=&quot;70%&quot;&gt;&lt;/p&gt;
101
102 &lt;p&gt;The prototype still need to be improved with longer timeouts, but
103 is already useful. The database of hardware to package mappings also
104 need more work. It is currently compatible with the Ubuntu way of
105 storing such information in the package control file, but could be
106 changed to use other formats instead or in addition to the current
107 method. I&#39;ve dropped the use of discover for this mapping, as the
108 modalias approach is more flexible and easier to use on Linux as long
109 as the Linux kernel expose its modalias strings directly.&lt;/p&gt;
110
111 &lt;p&gt;&lt;strong&gt;Update 2013-01-21 16:50&lt;/strong&gt;: Due to popular demand,
112 here is the command required to check out and build the source: Use
113 &#39;&lt;tt&gt;svn checkout
114 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
115 hw-support-handler; debuild&lt;/tt&gt;&#39;. If you lack debuild, install the
116 devscripts package.&lt;/p&gt;
117
118 &lt;p&gt;&lt;strong&gt;Update 2013-01-23 12:00&lt;/strong&gt;: The project is now
119 renamed to Isenkram and the source moved from the Debian Edu
120 subversion repository to a Debian collab-maint git repository. See
121 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html&quot;&gt;build
122 instructions&lt;/a&gt; for details.&lt;/p&gt;
123 </description>
124 </item>
125
126 <item>
127 <title>Using modalias info to find packages handling my hardware</title>
128 <link>http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html</link>
129 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html</guid>
130 <pubDate>Tue, 15 Jan 2013 08:00:00 +0100</pubDate>
131 <description>&lt;p&gt;Yesterday, I wrote about the
132 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html&quot;&gt;modalias
133 values provided by the Linux kernel&lt;/a&gt; following my hope for
134 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html&quot;&gt;better
135 dongle support in Debian&lt;/a&gt;. Using this knowledge, I have tested how
136 modalias values attached to package names can be used to map packages
137 to hardware. This allow the system to look up and suggest relevant
138 packages when I plug in some new hardware into my machine, and replace
139 discover and discover-data as the database used to map hardware to
140 packages.&lt;/p&gt;
141
142 &lt;p&gt;I create a modaliases file with entries like the following,
143 containing package name, kernel module name (if relevant, otherwise
144 the package name) and globs matching the relevant hardware
145 modalias.&lt;/p&gt;
146
147 &lt;p&gt;&lt;blockquote&gt;
148 Package: package-name
149 &lt;br&gt;Modaliases: module(modaliasglob, modaliasglob, modaliasglob)&lt;/p&gt;
150 &lt;/blockquote&gt;&lt;/p&gt;
151
152 &lt;p&gt;It is fairly trivial to write code to find the relevant packages
153 for a given modalias value using this file.&lt;/p&gt;
154
155 &lt;p&gt;An entry like this would suggest the video and picture application
156 cheese for many USB web cameras (interface bus class 0E01):&lt;/p&gt;
157
158 &lt;p&gt;&lt;blockquote&gt;
159 Package: cheese
160 &lt;br&gt;Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)&lt;/p&gt;
161 &lt;/blockquote&gt;&lt;/p&gt;
162
163 &lt;p&gt;An entry like this would suggest the pcmciautils package when a
164 CardBus bridge (bus class 0607) PCI device is present:&lt;/p&gt;
165
166 &lt;p&gt;&lt;blockquote&gt;
167 Package: pcmciautils
168 &lt;br&gt;Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
169 &lt;/blockquote&gt;&lt;/p&gt;
170
171 &lt;p&gt;An entry like this would suggest the package colorhug-client when
172 plugging in a ColorHug with USB IDs 04D8:F8DA:&lt;/p&gt;
173
174 &lt;p&gt;&lt;blockquote&gt;
175 Package: colorhug-client
176 &lt;br&gt;Modaliases: colorhug-client(usb:v04D8pF8DAd*)&lt;/p&gt;
177 &lt;/blockquote&gt;&lt;/p&gt;
178
179 &lt;p&gt;I believe the format is compatible with the format of the Packages
180 file in the Debian archive. Ubuntu already uses their Packages file
181 to store their mappings from packages to hardware.&lt;/p&gt;
182
183 &lt;p&gt;By adding a XB-Modaliases: header in debian/control, any .deb can
184 announce the hardware it support in a way my prototype understand.
185 This allow those publishing packages in an APT source outside the
186 Debian archive as well as those backporting packages to make sure the
187 hardware mapping are included in the package meta information. I&#39;ve
188 tested such header in the pymissile package, and its modalias mapping
189 is working as it should with my prototype. It even made it to Ubuntu
190 Raring.&lt;/p&gt;
191
192 &lt;p&gt;To test if it was possible to look up supported hardware using only
193 the shell tools available in the Debian installer, I wrote a shell
194 implementation of the lookup code. The idea is to create files for
195 each modalias and let the shell do the matching. Please check out and
196 try the
197 &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;
198 shell script. It run without any extra dependencies and fetch the
199 hardware mappings from the Debian archive and the subversion
200 repository where I currently work on my prototype.&lt;/p&gt;
201
202 &lt;p&gt;When I use it on a machine with a yubikey inserted, it suggest to
203 install yubikey-personalization:&lt;/p&gt;
204
205 &lt;p&gt;&lt;blockquote&gt;
206 % ./hw-support-lookup
207 &lt;br&gt;yubikey-personalization
208 &lt;br&gt;%
209 &lt;/blockquote&gt;&lt;/p&gt;
210
211 &lt;p&gt;When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
212 propose to install the pcmciautils package:&lt;/p&gt;
213
214 &lt;p&gt;&lt;blockquote&gt;
215 % ./hw-support-lookup
216 &lt;br&gt;pcmciautils
217 &lt;br&gt;%
218 &lt;/blockquote&gt;&lt;/p&gt;
219
220 &lt;p&gt;If you know of any hardware-package mapping that should be added to
221 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co&quot;&gt;my
222 database&lt;/a&gt;, please tell me about it.&lt;/p&gt;
223
224 &lt;p&gt;It could be possible to generate several of the mappings between
225 packages and hardware. One source would be to look at packages with
226 kernel modules, ie packages with *.ko files in /lib/modules/, and
227 extract their modalias information. Another would be to look at
228 packages with udev rules, ie packages with files in
229 /lib/udev/rules.d/, and extract their vendor/model information to
230 generate a modalias matching rule. I have not tested any of these to
231 see if it work.&lt;/p&gt;
232
233 &lt;p&gt;If you want to help implementing a system to let us propose what
234 packages to install when new hardware is plugged into a Debian
235 machine, please send me an email or talk to me on
236 &lt;a href=&quot;irc://irc.debian.org/%23debian-devel&quot;&gt;#debian-devel&lt;/a&gt;.&lt;/p&gt;
237 </description>
238 </item>
239
240 <item>
241 <title>Modalias strings - a practical way to map &quot;stuff&quot; to hardware</title>
242 <link>http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html</link>
243 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html</guid>
244 <pubDate>Mon, 14 Jan 2013 11:20:00 +0100</pubDate>
245 <description>&lt;p&gt;While looking into how to look up Debian packages based on hardware
246 information, to find the packages that support a given piece of
247 hardware, I refreshed my memory regarding modalias values, and decided
248 to document the details. Here are my findings so far, also available
249 in
250 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/&quot;&gt;the
251 Debian Edu subversion repository&lt;/a&gt;:
252
253 &lt;p&gt;&lt;strong&gt;Modalias decoded&lt;/strong&gt;&lt;/p&gt;
254
255 &lt;p&gt;This document try to explain what the different types of modalias
256 values stands for. It is in part based on information from
257 &amp;lt;URL: &lt;a href=&quot;https://wiki.archlinux.org/index.php/Modalias&quot;&gt;https://wiki.archlinux.org/index.php/Modalias&lt;/a&gt; &amp;gt;,
258 &amp;lt;URL: &lt;a href=&quot;http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device&quot;&gt;http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device&lt;/a&gt; &amp;gt;,
259 &amp;lt;URL: &lt;a href=&quot;http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c&quot;&gt;http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c&lt;/a&gt; &amp;gt; and
260 &amp;lt;URL: &lt;a href=&quot;http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&amp;view=markup&quot;&gt;http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&amp;view=markup&lt;/a&gt; &amp;gt;.
261
262 &lt;p&gt;The modalias entries for a given Linux machine can be found using
263 this shell script:&lt;/p&gt;
264
265 &lt;pre&gt;
266 find /sys -name modalias -print0 | xargs -0 cat | sort -u
267 &lt;/pre&gt;
268
269 &lt;p&gt;The supported modalias globs for a given kernel module can be found
270 using modinfo:&lt;/p&gt;
271
272 &lt;pre&gt;
273 % /sbin/modinfo psmouse | grep alias:
274 alias: serio:ty05pr*id*ex*
275 alias: serio:ty01pr*id*ex*
276 %
277 &lt;/pre&gt;
278
279 &lt;p&gt;&lt;strong&gt;PCI subtype&lt;/strong&gt;&lt;/p&gt;
280
281 &lt;p&gt;A typical PCI entry can look like this. This is an Intel Host
282 Bridge memory controller:&lt;/p&gt;
283
284 &lt;p&gt;&lt;blockquote&gt;
285 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
286 &lt;/blockquote&gt;&lt;/p&gt;
287
288 &lt;p&gt;This represent these values:&lt;/p&gt;
289
290 &lt;pre&gt;
291 v 00008086 (vendor)
292 d 00002770 (device)
293 sv 00001028 (subvendor)
294 sd 000001AD (subdevice)
295 bc 06 (bus class)
296 sc 00 (bus subclass)
297 i 00 (interface)
298 &lt;/pre&gt;
299
300 &lt;p&gt;The vendor/device values are the same values outputted from &#39;lspci
301 -n&#39; as 8086:2770. The bus class/subclass is also shown by lspci as
302 0600. The 0600 class is a host bridge. Other useful bus values are
303 0300 (VGA compatible card) and 0200 (Ethernet controller).&lt;/p&gt;
304
305 &lt;p&gt;Not sure how to figure out the interface value, nor what it
306 means.&lt;/p&gt;
307
308 &lt;p&gt;&lt;strong&gt;USB subtype&lt;/strong&gt;&lt;/p&gt;
309
310 &lt;p&gt;Some typical USB entries can look like this. This is an internal
311 USB hub in a laptop:&lt;/p&gt;
312
313 &lt;p&gt;&lt;blockquote&gt;
314 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
315 &lt;/blockquote&gt;&lt;/p&gt;
316
317 &lt;p&gt;Here is the values included in this alias:&lt;/p&gt;
318
319 &lt;pre&gt;
320 v 1D6B (device vendor)
321 p 0001 (device product)
322 d 0206 (bcddevice)
323 dc 09 (device class)
324 dsc 00 (device subclass)
325 dp 00 (device protocol)
326 ic 09 (interface class)
327 isc 00 (interface subclass)
328 ip 00 (interface protocol)
329 &lt;/pre&gt;
330
331 &lt;p&gt;The 0900 device class/subclass means hub. Some times the relevant
332 class is in the interface class section. For a simple USB web camera,
333 these alias entries show up:&lt;/p&gt;
334
335 &lt;p&gt;&lt;blockquote&gt;
336 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
337 &lt;br&gt;usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
338 &lt;br&gt;usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
339 &lt;br&gt;usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
340 &lt;/blockquote&gt;&lt;/p&gt;
341
342 &lt;p&gt;Interface class 0E01 is video control, 0E02 is video streaming (aka
343 camera), 0101 is audio control device and 0102 is audio streaming (aka
344 microphone). Thus this is a camera with microphone included.&lt;/p&gt;
345
346 &lt;p&gt;&lt;strong&gt;ACPI subtype&lt;/strong&gt;&lt;/p&gt;
347
348 &lt;p&gt;The ACPI type is used for several non-PCI/USB stuff. This is an IR
349 receiver in a Thinkpad X40:&lt;/p&gt;
350
351 &lt;p&gt;&lt;blockquote&gt;
352 acpi:IBM0071:PNP0511:
353 &lt;/blockquote&gt;&lt;/p&gt;
354
355 &lt;p&gt;The values between the colons are IDs.&lt;/p&gt;
356
357 &lt;p&gt;&lt;strong&gt;DMI subtype&lt;/strong&gt;&lt;/p&gt;
358
359 &lt;p&gt;The DMI table contain lots of information about the computer case
360 and model. This is an entry for a IBM Thinkpad X40, fetched from
361 /sys/devices/virtual/dmi/id/modalias:&lt;/p&gt;
362
363 &lt;p&gt;&lt;blockquote&gt;
364 dmi:bvnIBM:bvr1UETB6WW(1.66):bd06/15/2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
365 &lt;/blockquote&gt;&lt;/p&gt;
366
367 &lt;p&gt;The values present are&lt;/p&gt;
368
369 &lt;pre&gt;
370 bvn IBM (BIOS vendor)
371 bvr 1UETB6WW(1.66) (BIOS version)
372 bd 06/15/2005 (BIOS date)
373 svn IBM (system vendor)
374 pn 2371H4G (product name)
375 pvr ThinkPadX40 (product version)
376 rvn IBM (board vendor)
377 rn 2371H4G (board name)
378 rvr NotAvailable (board version)
379 cvn IBM (chassis vendor)
380 ct 10 (chassis type)
381 cvr NotAvailable (chassis version)
382 &lt;/pre&gt;
383
384 &lt;p&gt;The chassis type 10 is Notebook. Other interesting values can be
385 found in the dmidecode source:&lt;/p&gt;
386
387 &lt;pre&gt;
388 3 Desktop
389 4 Low Profile Desktop
390 5 Pizza Box
391 6 Mini Tower
392 7 Tower
393 8 Portable
394 9 Laptop
395 10 Notebook
396 11 Hand Held
397 12 Docking Station
398 13 All In One
399 14 Sub Notebook
400 15 Space-saving
401 16 Lunch Box
402 17 Main Server Chassis
403 18 Expansion Chassis
404 19 Sub Chassis
405 20 Bus Expansion Chassis
406 21 Peripheral Chassis
407 22 RAID Chassis
408 23 Rack Mount Chassis
409 24 Sealed-case PC
410 25 Multi-system
411 26 CompactPCI
412 27 AdvancedTCA
413 28 Blade
414 29 Blade Enclosing
415 &lt;/pre&gt;
416
417 &lt;p&gt;The chassis type values are not always accurately set in the DMI
418 table. For example my home server is a tower, but the DMI modalias
419 claim it is a desktop.&lt;/p&gt;
420
421 &lt;p&gt;&lt;strong&gt;SerIO subtype&lt;/strong&gt;&lt;/p&gt;
422
423 &lt;p&gt;This type is used for PS/2 mouse plugs. One example is from my
424 test machine:&lt;/p&gt;
425
426 &lt;p&gt;&lt;blockquote&gt;
427 serio:ty01pr00id00ex00
428 &lt;/blockquote&gt;&lt;/p&gt;
429
430 &lt;p&gt;The values present are&lt;/p&gt;
431
432 &lt;pre&gt;
433 ty 01 (type)
434 pr 00 (prototype)
435 id 00 (id)
436 ex 00 (extra)
437 &lt;/pre&gt;
438
439 &lt;p&gt;This type is supported by the psmouse driver. I am not sure what
440 the valid values are.&lt;/p&gt;
441
442 &lt;p&gt;&lt;strong&gt;Other subtypes&lt;/strong&gt;&lt;/p&gt;
443
444 &lt;p&gt;There are heaps of other modalias subtypes according to
445 file2alias.c. There is the rest of the list from that source: amba,
446 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
447 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
448 vmbus, x86cpu and zorro. I did not spend time documenting all of
449 these, as they do not seem relevant for my intended use with mapping
450 hardware to packages when new stuff is inserted during run time.&lt;/p&gt;
451
452 &lt;p&gt;&lt;strong&gt;Looking up kernel modules using modalias values&lt;/strong&gt;&lt;/p&gt;
453
454 &lt;p&gt;To check which kernel modules provide support for a given modalias,
455 one can use the following shell script:&lt;/p&gt;
456
457 &lt;pre&gt;
458 for id in $(find /sys -name modalias -print0 | xargs -0 cat | sort -u); do \
459 echo &quot;$id&quot; ; \
460 /sbin/modprobe --show-depends &quot;$id&quot;|sed &#39;s/^/ /&#39; ; \
461 done
462 &lt;/pre&gt;
463
464 &lt;p&gt;The output can look like this (only the first few entries as the
465 list is very long on my test machine):&lt;/p&gt;
466
467 &lt;pre&gt;
468 acpi:ACPI0003:
469 insmod /lib/modules/2.6.32-5-686/kernel/drivers/acpi/ac.ko
470 acpi:device:
471 FATAL: Module acpi:device: not found.
472 acpi:IBM0068:
473 insmod /lib/modules/2.6.32-5-686/kernel/drivers/char/nvram.ko
474 insmod /lib/modules/2.6.32-5-686/kernel/drivers/leds/led-class.ko
475 insmod /lib/modules/2.6.32-5-686/kernel/net/rfkill/rfkill.ko
476 insmod /lib/modules/2.6.32-5-686/kernel/drivers/platform/x86/thinkpad_acpi.ko
477 acpi:IBM0071:PNP0511:
478 insmod /lib/modules/2.6.32-5-686/kernel/lib/crc-ccitt.ko
479 insmod /lib/modules/2.6.32-5-686/kernel/net/irda/irda.ko
480 insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/irda/nsc-ircc.ko
481 [...]
482 &lt;/pre&gt;
483
484 &lt;p&gt;If you want to help implementing a system to let us propose what
485 packages to install when new hardware is plugged into a Debian
486 machine, please send me an email or talk to me on
487 &lt;a href=&quot;irc://irc.debian.org/%23debian-devel&quot;&gt;#debian-devel&lt;/a&gt;.&lt;/p&gt;
488
489 &lt;p&gt;&lt;strong&gt;Update 2013-01-15:&lt;/strong&gt; Rewrite &quot;cat $(find ...)&quot; to
490 &quot;find ... -print0 | xargs -0 cat&quot; to make sure it handle directories
491 in /sys/ with space in them.&lt;/p&gt;
492 </description>
493 </item>
494
495 <item>
496 <title>Lets make hardware dongles easier to use in Debian</title>
497 <link>http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html</link>
498 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html</guid>
499 <pubDate>Wed, 9 Jan 2013 15:40:00 +0100</pubDate>
500 <description>&lt;p&gt;One thing that annoys me with Debian and Linux distributions in
501 general, is that there is a great package management system with the
502 ability to automatically install software packages by downloading them
503 from the distribution mirrors, but no way to get it to automatically
504 install the packages I need to use the hardware I plug into my
505 machine. Even if the package to use it is easily available from the
506 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
507 suggest to automatically install the python-nxt, nbc and t2n packages
508 I need to talk to it. When I plug in a Yubikey, it could propose the
509 yubikey-personalization package. The information required to do this
510 is available, but no-one have pulled all the pieces together.&lt;/p&gt;
511
512 &lt;p&gt;Some years ago, I proposed to
513 &lt;a href=&quot;http://lists.debian.org/debian-devel/2010/05/msg01206.html&quot;&gt;use
514 the discover subsystem to implement this&lt;/a&gt;. The idea is fairly
515 simple:
516
517 &lt;ul&gt;
518
519 &lt;li&gt;Add a desktop entry in /usr/share/autostart/ pointing to a program
520 starting when a user log in.&lt;/li&gt;
521
522 &lt;li&gt;Set this program up to listen for kernel events emitted when new
523 hardware is inserted into the computer.&lt;/li&gt;
524
525 &lt;li&gt;When new hardware is inserted, look up the hardware ID in a
526 database mapping to packages, and take note of any non-installed
527 packages.&lt;/li&gt;
528
529 &lt;li&gt;Show a message to the user proposing to install the discovered
530 package, and make it easy to install it.&lt;/li&gt;
531
532 &lt;/ul&gt;
533
534 &lt;p&gt;I am not sure what the best way to implement this is, but my
535 initial idea was to use dbus events to discover new hardware, the
536 discover database to find packages and
537 &lt;a href=&quot;http://www.packagekit.org/&quot;&gt;PackageKit&lt;/a&gt; to install
538 packages.&lt;/p&gt;
539
540 &lt;p&gt;Yesterday, I found time to try to implement this idea, and the
541 draft package is now checked into
542 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/&quot;&gt;the
543 Debian Edu subversion repository&lt;/a&gt;. In the process, I updated the
544 &lt;a href=&quot;http://packages.qa.debian.org/d/discover-data.html&quot;&gt;discover-data&lt;/a&gt;
545 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
546 the relevant packages in Debian, and uploaded a new version
547 2.2013.01.09 to unstable. I also discovered that the current
548 &lt;a href=&quot;http://packages.qa.debian.org/d/discover.html&quot;&gt;discover&lt;/a&gt;
549 package in Debian no longer discovered any USB devices, because
550 /proc/bus/usb/devices is no longer present. I ported it to use
551 libusb as a fall back option to get it working. The fixed package
552 version 2.1.2-6 is now in experimental (didn&#39;t upload it to unstable
553 because of the freeze).&lt;/p&gt;
554
555 &lt;p&gt;With this prototype in place, I can insert my Yubikey, and get this
556 desktop notification to show up (only once, the first time it is
557 inserted):&lt;/p&gt;
558
559 &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-09-hw-autoinstall.png&quot;&gt;&lt;/p&gt;
560
561 &lt;p&gt;For this prototype to be really useful, some way to automatically
562 install the proposed packages by pressing the &quot;Please install
563 program(s)&quot; button should to be implemented.&lt;/p&gt;
564
565 &lt;p&gt;If this idea seem useful to you, and you want to help make it
566 happen, please help me update the discover-data database with mappings
567 from hardware to Debian packages. Check if &#39;discover-pkginstall -l&#39;
568 list the package you would like to have installed when a given
569 hardware device is inserted into your computer, and report bugs using
570 reportbug if it isn&#39;t. Or, if you know of a better way to provide
571 such mapping, please let me know.&lt;/p&gt;
572
573 &lt;p&gt;This prototype need more work, and there are several questions that
574 should be considered before it is ready for production use. Is dbus
575 the correct way to detect new hardware? At the moment I look for HAL
576 dbus events on the system bus, because that is the events I could see
577 on my Debian Squeeze KDE desktop. Are there better events to use?
578 How should the user be notified? Is the desktop notification
579 mechanism the best option, or should the background daemon raise a
580 popup instead? How should packages be installed? When should they
581 not be installed?&lt;/p&gt;
582
583 &lt;p&gt;If you want to help getting such feature implemented in Debian,
584 please send me an email. :)&lt;/p&gt;
585 </description>
586 </item>
587
588 </channel>
589 </rss>