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