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