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