]> pere.pagekite.me Git - homepage.git/blob - blog/tags/isenkram/index.html
89e5cf1b3fb6b51d31e0125b541fa2efd453a7e8
[homepage.git] / blog / tags / isenkram / index.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
6 <title>Petter Reinholdtsen: Entries Tagged isenkram</title>
7 <link rel="stylesheet" type="text/css" media="screen" href="http://people.skolelinux.org/pere/blog/style.css" />
8 <link rel="stylesheet" type="text/css" media="screen" href="http://people.skolelinux.org/pere/blog/vim.css" />
9 <link rel="alternate" title="RSS Feed" href="isenkram.rss" type="application/rss+xml" />
10 </head>
11 <body>
12 <div class="title">
13 <h1>
14 <a href="http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen</a>
15
16 </h1>
17
18 </div>
19
20
21 <h3>Entries tagged "isenkram".</h3>
22
23 <div class="entry">
24 <div class="title">
25 <a href="http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">Welcome to the world, Isenkram!</a>
26 </div>
27 <div class="date">
28 22nd January 2013
29 </div>
30 <div class="body">
31 <p>Yesterday, I
32 <a href="http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html">asked
33 for testers</a> for my prototype for making Debian better at handling
34 pluggable hardware devices, which I
35 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">set
36 out to create</a> earlier this month. Several valuable testers showed
37 up, and caused me to really want to to open up the development to more
38 people. But before I did this, I want to come up with a sensible name
39 for this project. Today I finally decided on a new name, and I have
40 renamed the project from hw-support-handler to this new name. In the
41 process, I moved the source to git and made it available as a
42 <a href="http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git">collab-maint</a>
43 repository in Debian. The new name? It is <strong>Isenkram</strong>.
44 To fetch and build the latest version of the source, use</p>
45
46 <pre>
47 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
48 cd isenkram && git-buildpackage -us -uc
49 </pre>
50
51 <p>I have not yet adjusted all files to use the new name yet. If you
52 want to hack on the source or improve the package, please go ahead.
53 But please talk to me first on IRC or via email before you do major
54 changes, to make sure we do not step on each others toes. :)</p>
55
56 <p>If you wonder what 'isenkram' is, it is a Norwegian word for iron
57 stuff, typically meaning tools, nails, screws, etc. Typical hardware
58 stuff, in other words. I've been told it is the Norwegian variant of
59 the German word eisenkram, for those that are familiar with that
60 word.</p>
61
62 <p><strong>Update 2013-01-26</strong>: Added -us -us to build
63 instructions, to avoid confusing people with an error from the signing
64 process.</p>
65
66 <p><strong>Update 2013-01-27</strong>: Switch to HTTP URL for the git
67 clone argument to avoid the need for authentication.</p>
68
69 </div>
70 <div class="tags">
71
72
73 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>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
74
75
76 </div>
77 </div>
78 <div class="padding"></div>
79
80 <div class="entry">
81 <div class="title">
82 <a href="http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html">First prototype ready making hardware easier to use in Debian</a>
83 </div>
84 <div class="date">
85 21st January 2013
86 </div>
87 <div class="body">
88 <p>Early this month I set out to try to
89 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">improve
90 the Debian support for pluggable hardware devices</a>. Now my
91 prototype is working, and it is ready for a larger audience. To test
92 it, fetch the
93 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">source
94 from the Debian Edu subversion repository</a>, build and install the
95 package. You might have to log out and in again activate the
96 autostart script.</p>
97
98 <p>The design is simple:</p>
99
100 <ul>
101
102 <li>Add desktop entry in /usr/share/autostart/ causing a program
103 hw-support-handlerd to start when the user log in.</li>
104
105 <li>This program listen for kernel events about new hardware (directly
106 from the kernel like udev does), not using HAL dbus events as I
107 initially did.</li>
108
109 <li>When new hardware is inserted, look up the hardware modalias in
110 the APT database, a database
111 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup">available
112 via HTTP</a> and a database available as part of the package.</li>
113
114 <li>If a package is mapped to the hardware in question, the package
115 isn't installed yet and this is the first time the hardware was
116 plugged in, show a desktop notification suggesting to install the
117 package or packages.</li>
118
119 <li>If the user click on the 'install package now' button, ask
120 aptdaemon via the PackageKit API to install the requrired package.</li>
121
122 <li>aptdaemon ask for root password or sudo password, and install the
123 package while showing progress information in a window.</li>
124
125 </ul>
126
127 <p>I still need to come up with a better name for the system. Here
128 are some screen shots showing the prototype in action. First the
129 notification, then the password request, and finally the request to
130 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.</p>
131
132 <p><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-1-notification.png">
133 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-2-password.png">
134 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-3-dependencies.png">
135 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-4-installing.png">
136 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-5-installing-details.png" width="70%"></p>
137
138 <p>The prototype still need to be improved with longer timeouts, but
139 is already useful. The database of hardware to package mappings also
140 need more work. It is currently compatible with the Ubuntu way of
141 storing such information in the package control file, but could be
142 changed to use other formats instead or in addition to the current
143 method. I've dropped the use of discover for this mapping, as the
144 modalias approach is more flexible and easier to use on Linux as long
145 as the Linux kernel expose its modalias strings directly.</p>
146
147 <p><strong>Update 2013-01-21 16:50</strong>: Due to popular demand,
148 here is the command required to check out and build the source: Use
149 '<tt>svn checkout
150 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
151 hw-support-handler; debuild</tt>'. If you lack debuild, install the
152 devscripts package.</p>
153
154 <p><strong>Update 2013-01-23 12:00</strong>: The project is now
155 renamed to Isenkram and the source moved from the Debian Edu
156 subversion repository to a Debian collab-maint git repository. See
157 <a href="http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">build
158 instructions</a> for details.</p>
159
160 </div>
161 <div class="tags">
162
163
164 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>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
165
166
167 </div>
168 </div>
169 <div class="padding"></div>
170
171 <div class="entry">
172 <div class="title">
173 <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>
174 </div>
175 <div class="date">
176 15th January 2013
177 </div>
178 <div class="body">
179 <p>Yesterday, I wrote about the
180 <a href="http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">modalias
181 values provided by the Linux kernel</a> following my hope for
182 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">better
183 dongle support in Debian</a>. Using this knowledge, I have tested how
184 modalias values attached to package names can be used to map packages
185 to hardware. This allow the system to look up and suggest relevant
186 packages when I plug in some new hardware into my machine, and replace
187 discover and discover-data as the database used to map hardware to
188 packages.</p>
189
190 <p>I create a modaliases file with entries like the following,
191 containing package name, kernel module name (if relevant, otherwise
192 the package name) and globs matching the relevant hardware
193 modalias.</p>
194
195 <p><blockquote>
196 Package: package-name
197 <br>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)</p>
198 </blockquote></p>
199
200 <p>It is fairly trivial to write code to find the relevant packages
201 for a given modalias value using this file.</p>
202
203 <p>An entry like this would suggest the video and picture application
204 cheese for many USB web cameras (interface bus class 0E01):</p>
205
206 <p><blockquote>
207 Package: cheese
208 <br>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)</p>
209 </blockquote></p>
210
211 <p>An entry like this would suggest the pcmciautils package when a
212 CardBus bridge (bus class 0607) PCI device is present:</p>
213
214 <p><blockquote>
215 Package: pcmciautils
216 <br>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
217 </blockquote></p>
218
219 <p>An entry like this would suggest the package colorhug-client when
220 plugging in a ColorHug with USB IDs 04D8:F8DA:</p>
221
222 <p><blockquote>
223 Package: colorhug-client
224 <br>Modaliases: colorhug-client(usb:v04D8pF8DAd*)</p>
225 </blockquote></p>
226
227 <p>I believe the format is compatible with the format of the Packages
228 file in the Debian archive. Ubuntu already uses their Packages file
229 to store their mappings from packages to hardware.</p>
230
231 <p>By adding a XB-Modaliases: header in debian/control, any .deb can
232 announce the hardware it support in a way my prototype understand.
233 This allow those publishing packages in an APT source outside the
234 Debian archive as well as those backporting packages to make sure the
235 hardware mapping are included in the package meta information. I've
236 tested such header in the pymissile package, and its modalias mapping
237 is working as it should with my prototype. It even made it to Ubuntu
238 Raring.</p>
239
240 <p>To test if it was possible to look up supported hardware using only
241 the shell tools available in the Debian installer, I wrote a shell
242 implementation of the lookup code. The idea is to create files for
243 each modalias and let the shell do the matching. Please check out and
244 try the
245 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co">hw-support-lookup</a>
246 shell script. It run without any extra dependencies and fetch the
247 hardware mappings from the Debian archive and the subversion
248 repository where I currently work on my prototype.</p>
249
250 <p>When I use it on a machine with a yubikey inserted, it suggest to
251 install yubikey-personalization:</p>
252
253 <p><blockquote>
254 % ./hw-support-lookup
255 <br>yubikey-personalization
256 <br>%
257 </blockquote></p>
258
259 <p>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
260 propose to install the pcmciautils package:</p>
261
262 <p><blockquote>
263 % ./hw-support-lookup
264 <br>pcmciautils
265 <br>%
266 </blockquote></p>
267
268 <p>If you know of any hardware-package mapping that should be added to
269 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co">my
270 database</a>, please tell me about it.</p>
271
272 <p>It could be possible to generate several of the mappings between
273 packages and hardware. One source would be to look at packages with
274 kernel modules, ie packages with *.ko files in /lib/modules/, and
275 extract their modalias information. Another would be to look at
276 packages with udev rules, ie packages with files in
277 /lib/udev/rules.d/, and extract their vendor/model information to
278 generate a modalias matching rule. I have not tested any of these to
279 see if it work.</p>
280
281 <p>If you want to help implementing a system to let us propose what
282 packages to install when new hardware is plugged into a Debian
283 machine, please send me an email or talk to me on
284 <a href="irc://irc.debian.org/%23debian-devel">#debian-devel</a>.</p>
285
286 </div>
287 <div class="tags">
288
289
290 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>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
291
292
293 </div>
294 </div>
295 <div class="padding"></div>
296
297 <div class="entry">
298 <div class="title">
299 <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>
300 </div>
301 <div class="date">
302 14th January 2013
303 </div>
304 <div class="body">
305 <p>While looking into how to look up Debian packages based on hardware
306 information, to find the packages that support a given piece of
307 hardware, I refreshed my memory regarding modalias values, and decided
308 to document the details. Here are my findings so far, also available
309 in
310 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
311 Debian Edu subversion repository</a>:
312
313 <p><strong>Modalias decoded</strong></p>
314
315 <p>This document try to explain what the different types of modalias
316 values stands for. It is in part based on information from
317 &lt;URL: <a href="https://wiki.archlinux.org/index.php/Modalias">https://wiki.archlinux.org/index.php/Modalias</a> &gt;,
318 &lt;URL: <a href="http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device">http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device</a> &gt;,
319 &lt;URL: <a href="http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c">http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c</a> &gt; and
320 &lt;URL: <a href="http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&view=markup">http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&view=markup</a> &gt;.
321
322 <p>The modalias entries for a given Linux machine can be found using
323 this shell script:</p>
324
325 <pre>
326 find /sys -name modalias -print0 | xargs -0 cat | sort -u
327 </pre>
328
329 <p>The supported modalias globs for a given kernel module can be found
330 using modinfo:</p>
331
332 <pre>
333 % /sbin/modinfo psmouse | grep alias:
334 alias: serio:ty05pr*id*ex*
335 alias: serio:ty01pr*id*ex*
336 %
337 </pre>
338
339 <p><strong>PCI subtype</strong></p>
340
341 <p>A typical PCI entry can look like this. This is an Intel Host
342 Bridge memory controller:</p>
343
344 <p><blockquote>
345 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
346 </blockquote></p>
347
348 <p>This represent these values:</p>
349
350 <pre>
351 v 00008086 (vendor)
352 d 00002770 (device)
353 sv 00001028 (subvendor)
354 sd 000001AD (subdevice)
355 bc 06 (bus class)
356 sc 00 (bus subclass)
357 i 00 (interface)
358 </pre>
359
360 <p>The vendor/device values are the same values outputted from 'lspci
361 -n' as 8086:2770. The bus class/subclass is also shown by lspci as
362 0600. The 0600 class is a host bridge. Other useful bus values are
363 0300 (VGA compatible card) and 0200 (Ethernet controller).</p>
364
365 <p>Not sure how to figure out the interface value, nor what it
366 means.</p>
367
368 <p><strong>USB subtype</strong></p>
369
370 <p>Some typical USB entries can look like this. This is an internal
371 USB hub in a laptop:</p>
372
373 <p><blockquote>
374 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
375 </blockquote></p>
376
377 <p>Here is the values included in this alias:</p>
378
379 <pre>
380 v 1D6B (device vendor)
381 p 0001 (device product)
382 d 0206 (bcddevice)
383 dc 09 (device class)
384 dsc 00 (device subclass)
385 dp 00 (device protocol)
386 ic 09 (interface class)
387 isc 00 (interface subclass)
388 ip 00 (interface protocol)
389 </pre>
390
391 <p>The 0900 device class/subclass means hub. Some times the relevant
392 class is in the interface class section. For a simple USB web camera,
393 these alias entries show up:</p>
394
395 <p><blockquote>
396 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
397 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
398 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
399 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
400 </blockquote></p>
401
402 <p>Interface class 0E01 is video control, 0E02 is video streaming (aka
403 camera), 0101 is audio control device and 0102 is audio streaming (aka
404 microphone). Thus this is a camera with microphone included.</p>
405
406 <p><strong>ACPI subtype</strong></p>
407
408 <p>The ACPI type is used for several non-PCI/USB stuff. This is an IR
409 receiver in a Thinkpad X40:</p>
410
411 <p><blockquote>
412 acpi:IBM0071:PNP0511:
413 </blockquote></p>
414
415 <p>The values between the colons are IDs.</p>
416
417 <p><strong>DMI subtype</strong></p>
418
419 <p>The DMI table contain lots of information about the computer case
420 and model. This is an entry for a IBM Thinkpad X40, fetched from
421 /sys/devices/virtual/dmi/id/modalias:</p>
422
423 <p><blockquote>
424 dmi:bvnIBM:bvr1UETB6WW(1.66):bd06/15/2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
425 </blockquote></p>
426
427 <p>The values present are</p>
428
429 <pre>
430 bvn IBM (BIOS vendor)
431 bvr 1UETB6WW(1.66) (BIOS version)
432 bd 06/15/2005 (BIOS date)
433 svn IBM (system vendor)
434 pn 2371H4G (product name)
435 pvr ThinkPadX40 (product version)
436 rvn IBM (board vendor)
437 rn 2371H4G (board name)
438 rvr NotAvailable (board version)
439 cvn IBM (chassis vendor)
440 ct 10 (chassis type)
441 cvr NotAvailable (chassis version)
442 </pre>
443
444 <p>The chassis type 10 is Notebook. Other interesting values can be
445 found in the dmidecode source:</p>
446
447 <pre>
448 3 Desktop
449 4 Low Profile Desktop
450 5 Pizza Box
451 6 Mini Tower
452 7 Tower
453 8 Portable
454 9 Laptop
455 10 Notebook
456 11 Hand Held
457 12 Docking Station
458 13 All In One
459 14 Sub Notebook
460 15 Space-saving
461 16 Lunch Box
462 17 Main Server Chassis
463 18 Expansion Chassis
464 19 Sub Chassis
465 20 Bus Expansion Chassis
466 21 Peripheral Chassis
467 22 RAID Chassis
468 23 Rack Mount Chassis
469 24 Sealed-case PC
470 25 Multi-system
471 26 CompactPCI
472 27 AdvancedTCA
473 28 Blade
474 29 Blade Enclosing
475 </pre>
476
477 <p>The chassis type values are not always accurately set in the DMI
478 table. For example my home server is a tower, but the DMI modalias
479 claim it is a desktop.</p>
480
481 <p><strong>SerIO subtype</strong></p>
482
483 <p>This type is used for PS/2 mouse plugs. One example is from my
484 test machine:</p>
485
486 <p><blockquote>
487 serio:ty01pr00id00ex00
488 </blockquote></p>
489
490 <p>The values present are</p>
491
492 <pre>
493 ty 01 (type)
494 pr 00 (prototype)
495 id 00 (id)
496 ex 00 (extra)
497 </pre>
498
499 <p>This type is supported by the psmouse driver. I am not sure what
500 the valid values are.</p>
501
502 <p><strong>Other subtypes</strong></p>
503
504 <p>There are heaps of other modalias subtypes according to
505 file2alias.c. There is the rest of the list from that source: amba,
506 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
507 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
508 vmbus, x86cpu and zorro. I did not spend time documenting all of
509 these, as they do not seem relevant for my intended use with mapping
510 hardware to packages when new stuff is inserted during run time.</p>
511
512 <p><strong>Looking up kernel modules using modalias values</strong></p>
513
514 <p>To check which kernel modules provide support for a given modalias,
515 one can use the following shell script:</p>
516
517 <pre>
518 for id in $(find /sys -name modalias -print0 | xargs -0 cat | sort -u); do \
519 echo "$id" ; \
520 /sbin/modprobe --show-depends "$id"|sed 's/^/ /' ; \
521 done
522 </pre>
523
524 <p>The output can look like this (only the first few entries as the
525 list is very long on my test machine):</p>
526
527 <pre>
528 acpi:ACPI0003:
529 insmod /lib/modules/2.6.32-5-686/kernel/drivers/acpi/ac.ko
530 acpi:device:
531 FATAL: Module acpi:device: not found.
532 acpi:IBM0068:
533 insmod /lib/modules/2.6.32-5-686/kernel/drivers/char/nvram.ko
534 insmod /lib/modules/2.6.32-5-686/kernel/drivers/leds/led-class.ko
535 insmod /lib/modules/2.6.32-5-686/kernel/net/rfkill/rfkill.ko
536 insmod /lib/modules/2.6.32-5-686/kernel/drivers/platform/x86/thinkpad_acpi.ko
537 acpi:IBM0071:PNP0511:
538 insmod /lib/modules/2.6.32-5-686/kernel/lib/crc-ccitt.ko
539 insmod /lib/modules/2.6.32-5-686/kernel/net/irda/irda.ko
540 insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/irda/nsc-ircc.ko
541 [...]
542 </pre>
543
544 <p>If you want to help implementing a system to let us propose what
545 packages to install when new hardware is plugged into a Debian
546 machine, please send me an email or talk to me on
547 <a href="irc://irc.debian.org/%23debian-devel">#debian-devel</a>.</p>
548
549 <p><strong>Update 2013-01-15:</strong> Rewrite "cat $(find ...)" to
550 "find ... -print0 | xargs -0 cat" to make sure it handle directories
551 in /sys/ with space in them.</p>
552
553 </div>
554 <div class="tags">
555
556
557 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>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
558
559
560 </div>
561 </div>
562 <div class="padding"></div>
563
564 <div class="entry">
565 <div class="title">
566 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">Lets make hardware dongles easier to use in Debian</a>
567 </div>
568 <div class="date">
569 9th January 2013
570 </div>
571 <div class="body">
572 <p>One thing that annoys me with Debian and Linux distributions in
573 general, is that there is a great package management system with the
574 ability to automatically install software packages by downloading them
575 from the distribution mirrors, but no way to get it to automatically
576 install the packages I need to use the hardware I plug into my
577 machine. Even if the package to use it is easily available from the
578 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
579 suggest to automatically install the python-nxt, nbc and t2n packages
580 I need to talk to it. When I plug in a Yubikey, it could propose the
581 yubikey-personalization package. The information required to do this
582 is available, but no-one have pulled all the pieces together.</p>
583
584 <p>Some years ago, I proposed to
585 <a href="http://lists.debian.org/debian-devel/2010/05/msg01206.html">use
586 the discover subsystem to implement this</a>. The idea is fairly
587 simple:
588
589 <ul>
590
591 <li>Add a desktop entry in /usr/share/autostart/ pointing to a program
592 starting when a user log in.</li>
593
594 <li>Set this program up to listen for kernel events emitted when new
595 hardware is inserted into the computer.</li>
596
597 <li>When new hardware is inserted, look up the hardware ID in a
598 database mapping to packages, and take note of any non-installed
599 packages.</li>
600
601 <li>Show a message to the user proposing to install the discovered
602 package, and make it easy to install it.</li>
603
604 </ul>
605
606 <p>I am not sure what the best way to implement this is, but my
607 initial idea was to use dbus events to discover new hardware, the
608 discover database to find packages and
609 <a href="http://www.packagekit.org/">PackageKit</a> to install
610 packages.</p>
611
612 <p>Yesterday, I found time to try to implement this idea, and the
613 draft package is now checked into
614 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
615 Debian Edu subversion repository</a>. In the process, I updated the
616 <a href="http://packages.qa.debian.org/d/discover-data.html">discover-data</a>
617 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
618 the relevant packages in Debian, and uploaded a new version
619 2.2013.01.09 to unstable. I also discovered that the current
620 <a href="http://packages.qa.debian.org/d/discover.html">discover</a>
621 package in Debian no longer discovered any USB devices, because
622 /proc/bus/usb/devices is no longer present. I ported it to use
623 libusb as a fall back option to get it working. The fixed package
624 version 2.1.2-6 is now in experimental (didn't upload it to unstable
625 because of the freeze).</p>
626
627 <p>With this prototype in place, I can insert my Yubikey, and get this
628 desktop notification to show up (only once, the first time it is
629 inserted):</p>
630
631 <p align="center"><img src="http://people.skolelinux.org/pere/blog/images/2013-01-09-hw-autoinstall.png"></p>
632
633 <p>For this prototype to be really useful, some way to automatically
634 install the proposed packages by pressing the "Please install
635 program(s)" button should to be implemented.</p>
636
637 <p>If this idea seem useful to you, and you want to help make it
638 happen, please help me update the discover-data database with mappings
639 from hardware to Debian packages. Check if 'discover-pkginstall -l'
640 list the package you would like to have installed when a given
641 hardware device is inserted into your computer, and report bugs using
642 reportbug if it isn't. Or, if you know of a better way to provide
643 such mapping, please let me know.</p>
644
645 <p>This prototype need more work, and there are several questions that
646 should be considered before it is ready for production use. Is dbus
647 the correct way to detect new hardware? At the moment I look for HAL
648 dbus events on the system bus, because that is the events I could see
649 on my Debian Squeeze KDE desktop. Are there better events to use?
650 How should the user be notified? Is the desktop notification
651 mechanism the best option, or should the background daemon raise a
652 popup instead? How should packages be installed? When should they
653 not be installed?</p>
654
655 <p>If you want to help getting such feature implemented in Debian,
656 please send me an email. :)</p>
657
658 </div>
659 <div class="tags">
660
661
662 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>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
663
664
665 </div>
666 </div>
667 <div class="padding"></div>
668
669 <p style="text-align: right;"><a href="isenkram.rss"><img src="http://people.skolelinux.org/pere/blog/xml.gif" alt="RSS Feed" width="36" height="14" /></a></p>
670 <div id="sidebar">
671
672
673
674 <h2>Archive</h2>
675 <ul>
676
677 <li>2013
678 <ul>
679
680 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/01/">January (11)</a></li>
681
682 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/02/">February (3)</a></li>
683
684 </ul></li>
685
686 <li>2012
687 <ul>
688
689 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/01/">January (7)</a></li>
690
691 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/02/">February (10)</a></li>
692
693 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/03/">March (17)</a></li>
694
695 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/04/">April (12)</a></li>
696
697 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/05/">May (12)</a></li>
698
699 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/06/">June (20)</a></li>
700
701 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/07/">July (17)</a></li>
702
703 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/08/">August (6)</a></li>
704
705 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/09/">September (9)</a></li>
706
707 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/10/">October (17)</a></li>
708
709 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/11/">November (10)</a></li>
710
711 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/12/">December (7)</a></li>
712
713 </ul></li>
714
715 <li>2011
716 <ul>
717
718 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/01/">January (16)</a></li>
719
720 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/02/">February (6)</a></li>
721
722 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/03/">March (6)</a></li>
723
724 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/04/">April (7)</a></li>
725
726 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/05/">May (3)</a></li>
727
728 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/06/">June (2)</a></li>
729
730 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/07/">July (7)</a></li>
731
732 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/08/">August (6)</a></li>
733
734 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/09/">September (4)</a></li>
735
736 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/10/">October (2)</a></li>
737
738 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/11/">November (3)</a></li>
739
740 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/12/">December (1)</a></li>
741
742 </ul></li>
743
744 <li>2010
745 <ul>
746
747 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/01/">January (2)</a></li>
748
749 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/02/">February (1)</a></li>
750
751 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/03/">March (3)</a></li>
752
753 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/04/">April (3)</a></li>
754
755 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/05/">May (9)</a></li>
756
757 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/06/">June (14)</a></li>
758
759 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/07/">July (12)</a></li>
760
761 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/08/">August (13)</a></li>
762
763 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/09/">September (7)</a></li>
764
765 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/10/">October (9)</a></li>
766
767 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/11/">November (13)</a></li>
768
769 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/12/">December (12)</a></li>
770
771 </ul></li>
772
773 <li>2009
774 <ul>
775
776 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/01/">January (8)</a></li>
777
778 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/02/">February (8)</a></li>
779
780 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/03/">March (12)</a></li>
781
782 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/04/">April (10)</a></li>
783
784 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/05/">May (9)</a></li>
785
786 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/06/">June (3)</a></li>
787
788 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/07/">July (4)</a></li>
789
790 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/08/">August (3)</a></li>
791
792 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/09/">September (1)</a></li>
793
794 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/10/">October (2)</a></li>
795
796 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/11/">November (3)</a></li>
797
798 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/12/">December (3)</a></li>
799
800 </ul></li>
801
802 <li>2008
803 <ul>
804
805 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/11/">November (5)</a></li>
806
807 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/12/">December (7)</a></li>
808
809 </ul></li>
810
811 </ul>
812
813
814
815 <h2>Tags</h2>
816 <ul>
817
818 <li><a href="http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (13)</a></li>
819
820 <li><a href="http://people.skolelinux.org/pere/blog/tags/amiga">amiga (1)</a></li>
821
822 <li><a href="http://people.skolelinux.org/pere/blog/tags/aros">aros (1)</a></li>
823
824 <li><a href="http://people.skolelinux.org/pere/blog/tags/bankid">bankid (4)</a></li>
825
826 <li><a href="http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin (6)</a></li>
827
828 <li><a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (12)</a></li>
829
830 <li><a href="http://people.skolelinux.org/pere/blog/tags/bsa">bsa (2)</a></li>
831
832 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (70)</a></li>
833
834 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (118)</a></li>
835
836 <li><a href="http://people.skolelinux.org/pere/blog/tags/digistan">digistan (9)</a></li>
837
838 <li><a href="http://people.skolelinux.org/pere/blog/tags/docbook">docbook (7)</a></li>
839
840 <li><a href="http://people.skolelinux.org/pere/blog/tags/drivstoffpriser">drivstoffpriser (4)</a></li>
841
842 <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (176)</a></li>
843
844 <li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (21)</a></li>
845
846 <li><a href="http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (12)</a></li>
847
848 <li><a href="http://people.skolelinux.org/pere/blog/tags/freeculture">freeculture (10)</a></li>
849
850 <li><a href="http://people.skolelinux.org/pere/blog/tags/frikanalen">frikanalen (9)</a></li>
851
852 <li><a href="http://people.skolelinux.org/pere/blog/tags/intervju">intervju (32)</a></li>
853
854 <li><a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram (5)</a></li>
855
856 <li><a href="http://people.skolelinux.org/pere/blog/tags/kart">kart (17)</a></li>
857
858 <li><a href="http://people.skolelinux.org/pere/blog/tags/ldap">ldap (8)</a></li>
859
860 <li><a href="http://people.skolelinux.org/pere/blog/tags/lenker">lenker (6)</a></li>
861
862 <li><a href="http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (1)</a></li>
863
864 <li><a href="http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (25)</a></li>
865
866 <li><a href="http://people.skolelinux.org/pere/blog/tags/norsk">norsk (221)</a></li>
867
868 <li><a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug (148)</a></li>
869
870 <li><a href="http://people.skolelinux.org/pere/blog/tags/offentlig innsyn">offentlig innsyn (6)</a></li>
871
872 <li><a href="http://people.skolelinux.org/pere/blog/tags/open311">open311 (2)</a></li>
873
874 <li><a href="http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (41)</a></li>
875
876 <li><a href="http://people.skolelinux.org/pere/blog/tags/personvern">personvern (63)</a></li>
877
878 <li><a href="http://people.skolelinux.org/pere/blog/tags/raid">raid (1)</a></li>
879
880 <li><a href="http://people.skolelinux.org/pere/blog/tags/reprap">reprap (11)</a></li>
881
882 <li><a href="http://people.skolelinux.org/pere/blog/tags/rfid">rfid (2)</a></li>
883
884 <li><a href="http://people.skolelinux.org/pere/blog/tags/robot">robot (6)</a></li>
885
886 <li><a href="http://people.skolelinux.org/pere/blog/tags/rss">rss (1)</a></li>
887
888 <li><a href="http://people.skolelinux.org/pere/blog/tags/ruter">ruter (4)</a></li>
889
890 <li><a href="http://people.skolelinux.org/pere/blog/tags/scraperwiki">scraperwiki (2)</a></li>
891
892 <li><a href="http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (28)</a></li>
893
894 <li><a href="http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (4)</a></li>
895
896 <li><a href="http://people.skolelinux.org/pere/blog/tags/skepsis">skepsis (4)</a></li>
897
898 <li><a href="http://people.skolelinux.org/pere/blog/tags/standard">standard (39)</a></li>
899
900 <li><a href="http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (3)</a></li>
901
902 <li><a href="http://people.skolelinux.org/pere/blog/tags/stortinget">stortinget (6)</a></li>
903
904 <li><a href="http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance (14)</a></li>
905
906 <li><a href="http://people.skolelinux.org/pere/blog/tags/sysadmin">sysadmin (1)</a></li>
907
908 <li><a href="http://people.skolelinux.org/pere/blog/tags/valg">valg (7)</a></li>
909
910 <li><a href="http://people.skolelinux.org/pere/blog/tags/video">video (35)</a></li>
911
912 <li><a href="http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (4)</a></li>
913
914 <li><a href="http://people.skolelinux.org/pere/blog/tags/web">web (26)</a></li>
915
916 </ul>
917
918
919 </div>
920 <p style="text-align: right">
921 Created by <a href="http://steve.org.uk/Software/chronicle">Chronicle v4.6</a>
922 </p>
923
924 </body>
925 </html>