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">
5 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8" />
6 <title>Petter Reinholdtsen
</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=
"http://people.skolelinux.org/pere/blog/index.rss" type=
"application/rss+xml" />
14 <a href=
"http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen
</a>
23 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/_kt_overv_kning_applauderes_igjen_av_Arbeiderpartiet__H_yre_og_Fremskrittspartiet.html">Økt overvåkning applauderes igjen av Arbeiderpartiet, Høyre og Fremskrittspartiet
</a></div>
24 <div class=
"date"> 4th February
2013</div>
25 <div class=
"body"><p>Jeg ser med gru at Arbeiderpartiet, Høyre og Fremskrittspartiet
26 <a href=
"http://www.aftenposten.no/nyheter/iriks/Positive-til-mer-smuglerovervaking-7110348.html">applauderer
27 tollvesenets forslag
</a> om å øke overvåkningen i Norge nok et hakk.
28 Det er ikke så rart, da de som uttaler seg jo også har støttet
29 innføringen av datalagringsdirektivet eller i hvert fall ikke veldig
30 aktivt har motarbeidet det. Innføringen av datalagringsdirektivet er
31 en lovendring som innebærer brev og besøkskontroll for hele
34 <p><a href=
"http://www.stortinget.no/no/Saker-og-publikasjoner/Saker/Sak/?p=48717">Datalagringsdirektivet
</a>
35 har vært oppe til votering i stortinget tre ganger så langt. Det ble
36 <a href=
"http://svartelisten.org/">vedtatt første gang
2011-
04-
04</a>
38 <a href=
"https://github.com/holderdeord/hdo-folketingparser/blob/master/data/votering-2011-04-11.xml">andre
39 gang
2011-
04-
11</a> (lovendringer voteres to ganger), og forslag om å
41 <a href=
"http://www.stortinget.no/no/Saker-og-publikasjoner/Saker/Sak/Voteringsoversikt/?p=53844&dnid=1">nedstemt
42 2012-
12-
06</a> (se også
43 <a href=
"http://beta.holderdeord.no/votes/2715">oversikt fra Holder De
46 <p>Jan Bøhler i Arbeiderpartiet stemte for å innføre
47 datalagringsdirektivet i lovverket i første votering, var ikke
48 tilstede i andre votering og støttet loven i tredje votering. André
49 Oktay Dahl i Høyre var ikke til stede i første og andre votering men
50 støttet loven i tredje votering. Ulf Leirstein i Fremskrittspartiet
51 stemte mot loven i første votering men var ikke til stede i andre og
54 <p>Hvis du lurer på hva som er problemet med datalagringsdirektivet,
55 anbefaler jeg å lese
<a href=
"http://www.uhuru.biz/?cat=84">artiklene
56 fra Jon Wessel-Aas
</a> om temaet, samt informasjon fra foreningen
57 <a href=
"http://www.digitaltpersonvern.no/">Digitalt
63 Tags:
<a href=
"http://people.skolelinux.org/pere/blog/tags/norsk">norsk
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/personvern">personvern
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance
</a>.
68 <div class=
"padding"></div>
71 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/Bitcoin_GUI_now_available_from_Debian_unstable__and_Ubuntu_raring_.html">Bitcoin GUI now available from Debian/unstable (and Ubuntu/raring)
</a></div>
72 <div class=
"date"> 2nd February
2013</div>
73 <div class=
"body"><p>My
74 <a href=
"http://people.skolelinux.org/pere/blog/How_to_backport_bitcoin_qt_version_0_7_2_2_to_Debian_Squeeze.html">last
75 bitcoin related blog post
</a> mentioned that the new
76 <a href=
"http://packages.qa.debian.org/bitcoin">bitcoin package
</a> for
77 Debian was waiting in NEW. It was accepted by the Debian ftp-masters
78 2013-
01-
19, and have been available in unstable since then. It was
79 automatically copied to Ubuntu, and is available in their Raring
82 <p>But there is a strange problem with the build that block this new
83 version from being available on the i386 and kfreebsd-i386
84 architectures. For some strange reason, the autobuilders in Debian
85 for these architectures fail to run the test suite on these
86 architectures (
<a href=
"http://bugs.debian.org/672524">BTS #
672524</a>).
87 We are so far unable to reproduce it when building it manually, and
88 no-one have been able to propose a fix. If you got an idea what is
89 failing, please let us know via the BTS.
</p>
91 <p>One feature that is annoying me with of the bitcoin client, because
92 I often run low on disk space, is the fact that the client will exit
93 if it run short on space (
<a href=
"http://bugs.debian.org/696715">BTS
94 #
696715</a>). So make sure you have enough disk space when you run
97 <p>As usual, if you use bitcoin and want to show your support of my
98 activities, please send Bitcoin donations to my address
99 <b><a href=
"bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&label=PetterReinholdtsenBlog">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a></b>.
</p>
104 Tags:
<a href=
"http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/debian">debian
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/english">english
</a>.
109 <div class=
"padding"></div>
112 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">Welcome to the world, Isenkram!
</a></div>
113 <div class=
"date">22nd January
2013</div>
114 <div class=
"body"><p>Yesterday, I
115 <a href=
"http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html">asked
116 for testers
</a> for my prototype for making Debian better at handling
117 pluggable hardware devices, which I
118 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">set
119 out to create
</a> earlier this month. Several valuable testers showed
120 up, and caused me to really want to to open up the development to more
121 people. But before I did this, I want to come up with a sensible name
122 for this project. Today I finally decided on a new name, and I have
123 renamed the project from hw-support-handler to this new name. In the
124 process, I moved the source to git and made it available as a
125 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git">collab-maint
</a>
126 repository in Debian. The new name? It is
<strong>Isenkram
</strong>.
127 To fetch and build the latest version of the source, use
</p>
130 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
131 cd isenkram && git-buildpackage -us -uc
134 <p>I have not yet adjusted all files to use the new name yet. If you
135 want to hack on the source or improve the package, please go ahead.
136 But please talk to me first on IRC or via email before you do major
137 changes, to make sure we do not step on each others toes. :)
</p>
139 <p>If you wonder what 'isenkram' is, it is a Norwegian word for iron
140 stuff, typically meaning tools, nails, screws, etc. Typical hardware
141 stuff, in other words. I've been told it is the Norwegian variant of
142 the German word eisenkram, for those that are familiar with that
145 <p><strong>Update
2013-
01-
26</strong>: Added -us -us to build
146 instructions, to avoid confusing people with an error from the signing
149 <p><strong>Update
2013-
01-
27</strong>: Switch to HTTP URL for the git
150 clone argument to avoid the need for authentication.
</p>
155 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>.
160 <div class=
"padding"></div>
163 <div class=
"title"><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></div>
164 <div class=
"date">21st January
2013</div>
165 <div class=
"body"><p>Early this month I set out to try to
166 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">improve
167 the Debian support for pluggable hardware devices
</a>. Now my
168 prototype is working, and it is ready for a larger audience. To test
170 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">source
171 from the Debian Edu subversion repository
</a>, build and install the
172 package. You might have to log out and in again activate the
173 autostart script.
</p>
175 <p>The design is simple:
</p>
179 <li>Add desktop entry in /usr/share/autostart/ causing a program
180 hw-support-handlerd to start when the user log in.
</li>
182 <li>This program listen for kernel events about new hardware (directly
183 from the kernel like udev does), not using HAL dbus events as I
186 <li>When new hardware is inserted, look up the hardware modalias in
187 the APT database, a database
188 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup">available
189 via HTTP
</a> and a database available as part of the package.
</li>
191 <li>If a package is mapped to the hardware in question, the package
192 isn't installed yet and this is the first time the hardware was
193 plugged in, show a desktop notification suggesting to install the
194 package or packages.
</li>
196 <li>If the user click on the 'install package now' button, ask
197 aptdaemon via the PackageKit API to install the requrired package.
</li>
199 <li>aptdaemon ask for root password or sudo password, and install the
200 package while showing progress information in a window.
</li>
204 <p>I still need to come up with a better name for the system. Here
205 are some screen shots showing the prototype in action. First the
206 notification, then the password request, and finally the request to
207 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.
</p>
209 <p><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-1-notification.png">
210 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-2-password.png">
211 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-3-dependencies.png">
212 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-4-installing.png">
213 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-5-installing-details.png" width=
"70%"></p>
215 <p>The prototype still need to be improved with longer timeouts, but
216 is already useful. The database of hardware to package mappings also
217 need more work. It is currently compatible with the Ubuntu way of
218 storing such information in the package control file, but could be
219 changed to use other formats instead or in addition to the current
220 method. I've dropped the use of discover for this mapping, as the
221 modalias approach is more flexible and easier to use on Linux as long
222 as the Linux kernel expose its modalias strings directly.
</p>
224 <p><strong>Update
2013-
01-
21 16:
50</strong>: Due to popular demand,
225 here is the command required to check out and build the source: Use
227 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
228 hw-support-handler; debuild
</tt>'. If you lack debuild, install the
229 devscripts package.
</p>
231 <p><strong>Update
2013-
01-
23 12:
00</strong>: The project is now
232 renamed to Isenkram and the source moved from the Debian Edu
233 subversion repository to a Debian collab-maint git repository. See
234 <a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">build
235 instructions
</a> for details.
</p>
240 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>.
245 <div class=
"padding"></div>
248 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/Thank_you_Thinkpad_X41__for_your_long_and_trustworthy_service.html">Thank you Thinkpad X41, for your long and trustworthy service
</a></div>
249 <div class=
"date">19th January
2013</div>
250 <div class=
"body"><p>This Christmas my trusty old laptop died. It died quietly and
251 suddenly in bed. With a quiet whimper, it went completely quiet and
252 black. The power button was no longer able to turn it on. It was a
253 IBM Thinkpad X41, and the best laptop I ever had. Better than both
254 Thinkpads X30, X31, X40, X60, X61 and X61S. Far better than the
255 Compaq I had before that. Now I need to find a replacement. To keep
256 going during Christmas, I moved the one year old SSD disk to my old
257 X40 where it fitted (only one I had left that could use it), but it is
258 not a durable solution.
260 <p>My laptop needs are fairly modest. This is my wishlist from when I
261 got a new one more than
10 years ago. It still holds true.:)
</p>
265 <li>Lightweight (around
1 kg) and small volume (preferably smaller
267 <li>Robust, it will be in my backpack every day.
</li>
268 <li>Three button mouse and a mouse pin instead of touch pad.
</li>
269 <li>Long battery life time. Preferable a week.
</li>
270 <li>Internal WIFI network card.
</li>
271 <li>Internal Twisted Pair network card.
</li>
272 <li>Some USB slots (
2-
3 is plenty)
</li>
273 <li>Good keyboard - similar to the Thinkpad.
</li>
274 <li>Video resolution at least
1024x768, with size around
12" (A4 paper
276 <li>Hardware supported by Debian Stable, ie the default kernel and
278 <li>Quiet, preferably fan free (or at least not using the fan most of
283 <p>You will notice that there are no RAM and CPU requirements in the
284 list. The reason is simply that the specifications on laptops the
285 last
10-
15 years have been sufficient for my needs, and I have to look
286 at other features to choose my laptop. But are there still made as
287 robust laptops as my X41? The Thinkpad X60/X61 proved to be less
288 robust, and Thinkpads seem to be heading in the wrong direction since
289 Lenovo took over. But I've been told that X220 and X1 Carbon might
292 <p>Perhaps I should rethink my needs, and look for a pad with an
293 external keyboard? I'll have to check the
294 <a href=
"http://www.linux-laptop.net/">Linux Laptops site
</a> for
295 well-supported laptops, or perhaps just buy one preinstalled from one
296 of the vendors listed on the
<a href=
"http://linuxpreloaded.com/">Linux
297 Pre-loaded site
</a>.
</p>
302 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>.
307 <div class=
"padding"></div>
310 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/How_to_find_a_browser_plugin_supporting_a_given_MIME_type.html">How to find a browser plugin supporting a given MIME type
</a></div>
311 <div class=
"date">18th January
2013</div>
312 <div class=
"body"><p>Some times I try to figure out which Iceweasel browser plugin to
313 install to get support for a given MIME type. Thanks to
314 <a href=
"https://wiki.ubuntu.com/MozillaTeam/Plugins">specifications
315 done by Ubuntu
</a> and Mozilla, it is possible to do this in Debian.
316 Unfortunately, not very many packages provide the needed meta
317 information, Anyway, here is a small script to look up all browser
318 plugin packages announcing ther MIME support using this specification:
</p>
324 def pkgs_handling_mimetype(mimetype):
329 version = pkg.candidate
331 version = pkg.installed
334 record = version.record
335 if not record.has_key('Npp-MimeType'):
337 mime_types = record['Npp-MimeType'].split(',')
339 t = t.rstrip().strip()
341 thepkgs.append(pkg.name)
343 mimetype = "audio/ogg"
344 if
1 < len(sys.argv):
345 mimetype = sys.argv[
1]
346 print "Browser plugin packages supporting %s:" % mimetype
347 for pkg in pkgs_handling_mimetype(mimetype):
351 <p>It can be used like this to look up a given MIME type:
</p>
354 % ./apt-find-browserplug-for-mimetype
355 Browser plugin packages supporting audio/ogg:
357 % ./apt-find-browserplug-for-mimetype application/x-shockwave-flash
358 Browser plugin packages supporting application/x-shockwave-flash:
363 <p>In Ubuntu this mechanism is combined with support in the browser
364 itself to query for plugins and propose to install the needed
365 packages. It would be great if Debian supported such feature too. Is
366 anyone working on adding it?
</p>
368 <p><strong>Update
2013-
01-
18 14:
20</strong>: The Debian BTS
369 request for icweasel support for this feature is
370 <a href=
"http://bugs.debian.org/484010">#
484010</a> from
2008 (and
371 <a href=
"http://bugs.debian.org/698426">#
698426</a> from today). Lack
372 of manpower and wish for a different design is the reason thus feature
373 is not yet in iceweasel from Debian.
</p>
378 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>.
383 <div class=
"padding"></div>
386 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html">What is the most supported MIME type in Debian?
</a></div>
387 <div class=
"date">16th January
2013</div>
388 <div class=
"body"><p>The
<a href=
"http://wiki.debian.org/AppStreamDebianProposal">DEP-
11
389 proposal to add AppStream information to the Debian archive
</a>, is a
390 proposal to make it possible for a Desktop application to propose to
391 the user some package to install to gain support for a given MIME
392 type, font, library etc. that is currently missing. With such
393 mechanism in place, it would be possible for the desktop to
394 automatically propose and install leocad if some LDraw file is
395 downloaded by the browser.
</p>
397 <p>To get some idea about the current content of the archive, I decided
398 to write a simple program to extract all .desktop files from the
399 Debian archive and look up the claimed MIME support there. The result
401 <a href=
"http://ftp.skolelinux.org/pub/AppStreamTest">Skolelinux FTP
402 site
</a>. Using the collected information, it become possible to
403 answer the question in the title. Here are the
20 most supported MIME
404 types in Debian stable (Squeeze), testing (Wheezy) and unstable (Sid).
405 The complete list is available from the link above.
</p>
407 <p><strong>Debian Stable:
</strong></p>
411 ----- -----------------------
434 <p><strong>Debian Testing:
</strong></p>
438 ----- -----------------------
461 <p><strong>Debian Unstable:
</strong></p>
465 ----- -----------------------
488 <p>I am told that PackageKit can provide an API to access the kind of
489 information mentioned in DEP-
11. I have not yet had time to look at
490 it, but hope the PackageKit people in Debian are on top of these
493 <p><strong>Update
2013-
01-
16 13:
35</strong>: Updated numbers after
494 discovering a typo in my script.
</p>
499 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>.
504 <div class=
"padding"></div>
507 <div class=
"title"><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></div>
508 <div class=
"date">15th January
2013</div>
509 <div class=
"body"><p>Yesterday, I wrote about the
510 <a href=
"http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">modalias
511 values provided by the Linux kernel
</a> following my hope for
512 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">better
513 dongle support in Debian
</a>. Using this knowledge, I have tested how
514 modalias values attached to package names can be used to map packages
515 to hardware. This allow the system to look up and suggest relevant
516 packages when I plug in some new hardware into my machine, and replace
517 discover and discover-data as the database used to map hardware to
520 <p>I create a modaliases file with entries like the following,
521 containing package name, kernel module name (if relevant, otherwise
522 the package name) and globs matching the relevant hardware
526 Package: package-name
527 <br>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)
</p>
530 <p>It is fairly trivial to write code to find the relevant packages
531 for a given modalias value using this file.
</p>
533 <p>An entry like this would suggest the video and picture application
534 cheese for many USB web cameras (interface bus class
0E01):
</p>
538 <br>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)
</p>
541 <p>An entry like this would suggest the pcmciautils package when a
542 CardBus bridge (bus class
0607) PCI device is present:
</p>
546 <br>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
549 <p>An entry like this would suggest the package colorhug-client when
550 plugging in a ColorHug with USB IDs
04D8:F8DA:
</p>
553 Package: colorhug-client
554 <br>Modaliases: colorhug-client(usb:v04D8pF8DAd*)
</p>
557 <p>I believe the format is compatible with the format of the Packages
558 file in the Debian archive. Ubuntu already uses their Packages file
559 to store their mappings from packages to hardware.
</p>
561 <p>By adding a XB-Modaliases: header in debian/control, any .deb can
562 announce the hardware it support in a way my prototype understand.
563 This allow those publishing packages in an APT source outside the
564 Debian archive as well as those backporting packages to make sure the
565 hardware mapping are included in the package meta information. I've
566 tested such header in the pymissile package, and its modalias mapping
567 is working as it should with my prototype. It even made it to Ubuntu
570 <p>To test if it was possible to look up supported hardware using only
571 the shell tools available in the Debian installer, I wrote a shell
572 implementation of the lookup code. The idea is to create files for
573 each modalias and let the shell do the matching. Please check out and
575 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co">hw-support-lookup
</a>
576 shell script. It run without any extra dependencies and fetch the
577 hardware mappings from the Debian archive and the subversion
578 repository where I currently work on my prototype.
</p>
580 <p>When I use it on a machine with a yubikey inserted, it suggest to
581 install yubikey-personalization:
</p>
584 % ./hw-support-lookup
585 <br>yubikey-personalization
589 <p>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
590 propose to install the pcmciautils package:
</p>
593 % ./hw-support-lookup
598 <p>If you know of any hardware-package mapping that should be added to
599 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co">my
600 database
</a>, please tell me about it.
</p>
602 <p>It could be possible to generate several of the mappings between
603 packages and hardware. One source would be to look at packages with
604 kernel modules, ie packages with *.ko files in /lib/modules/, and
605 extract their modalias information. Another would be to look at
606 packages with udev rules, ie packages with files in
607 /lib/udev/rules.d/, and extract their vendor/model information to
608 generate a modalias matching rule. I have not tested any of these to
611 <p>If you want to help implementing a system to let us propose what
612 packages to install when new hardware is plugged into a Debian
613 machine, please send me an email or talk to me on
614 <a href=
"irc://irc.debian.org/%23debian-devel">#debian-devel
</a>.
</p>
619 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>.
624 <div class=
"padding"></div>
627 <div class=
"title"><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></div>
628 <div class=
"date">14th January
2013</div>
629 <div class=
"body"><p>While looking into how to look up Debian packages based on hardware
630 information, to find the packages that support a given piece of
631 hardware, I refreshed my memory regarding modalias values, and decided
632 to document the details. Here are my findings so far, also available
634 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
635 Debian Edu subversion repository
</a>:
637 <p><strong>Modalias decoded
</strong></p>
639 <p>This document try to explain what the different types of modalias
640 values stands for. It is in part based on information from
641 <URL:
<a href=
"https://wiki.archlinux.org/index.php/Modalias">https://wiki.archlinux.org/index.php/Modalias
</a> >,
642 <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> >,
643 <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> > and
644 <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> >.
646 <p>The modalias entries for a given Linux machine can be found using
647 this shell script:
</p>
650 find /sys -name modalias -print0 | xargs -
0 cat | sort -u
653 <p>The supported modalias globs for a given kernel module can be found
657 % /sbin/modinfo psmouse | grep alias:
658 alias: serio:ty05pr*id*ex*
659 alias: serio:ty01pr*id*ex*
663 <p><strong>PCI subtype
</strong></p>
665 <p>A typical PCI entry can look like this. This is an Intel Host
666 Bridge memory controller:
</p>
669 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
672 <p>This represent these values:
</p>
677 sv
00001028 (subvendor)
678 sd
000001AD (subdevice)
684 <p>The vendor/device values are the same values outputted from 'lspci
685 -n' as
8086:
2770. The bus class/subclass is also shown by lspci as
686 0600. The
0600 class is a host bridge. Other useful bus values are
687 0300 (VGA compatible card) and
0200 (Ethernet controller).
</p>
689 <p>Not sure how to figure out the interface value, nor what it
692 <p><strong>USB subtype
</strong></p>
694 <p>Some typical USB entries can look like this. This is an internal
695 USB hub in a laptop:
</p>
698 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
701 <p>Here is the values included in this alias:
</p>
704 v
1D6B (device vendor)
705 p
0001 (device product)
708 dsc
00 (device subclass)
709 dp
00 (device protocol)
710 ic
09 (interface class)
711 isc
00 (interface subclass)
712 ip
00 (interface protocol)
715 <p>The
0900 device class/subclass means hub. Some times the relevant
716 class is in the interface class section. For a simple USB web camera,
717 these alias entries show up:
</p>
720 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
721 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
722 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
723 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
726 <p>Interface class
0E01 is video control,
0E02 is video streaming (aka
727 camera),
0101 is audio control device and
0102 is audio streaming (aka
728 microphone). Thus this is a camera with microphone included.
</p>
730 <p><strong>ACPI subtype
</strong></p>
732 <p>The ACPI type is used for several non-PCI/USB stuff. This is an IR
733 receiver in a Thinkpad X40:
</p>
736 acpi:IBM0071:PNP0511:
739 <p>The values between the colons are IDs.
</p>
741 <p><strong>DMI subtype
</strong></p>
743 <p>The DMI table contain lots of information about the computer case
744 and model. This is an entry for a IBM Thinkpad X40, fetched from
745 /sys/devices/virtual/dmi/id/modalias:
</p>
748 dmi:bvnIBM:bvr1UETB6WW(
1.66):bd06/
15/
2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
751 <p>The values present are
</p>
754 bvn IBM (BIOS vendor)
755 bvr
1UETB
6WW(
1.66) (BIOS version)
756 bd
06/
15/
2005 (BIOS date)
757 svn IBM (system vendor)
758 pn
2371H4G (product name)
759 pvr ThinkPadX40 (product version)
760 rvn IBM (board vendor)
761 rn
2371H4G (board name)
762 rvr NotAvailable (board version)
763 cvn IBM (chassis vendor)
765 cvr NotAvailable (chassis version)
768 <p>The chassis type
10 is Notebook. Other interesting values can be
769 found in the dmidecode source:
</p>
773 4 Low Profile Desktop
786 17 Main Server Chassis
789 20 Bus Expansion Chassis
790 21 Peripheral Chassis
792 23 Rack Mount Chassis
801 <p>The chassis type values are not always accurately set in the DMI
802 table. For example my home server is a tower, but the DMI modalias
803 claim it is a desktop.
</p>
805 <p><strong>SerIO subtype
</strong></p>
807 <p>This type is used for PS/
2 mouse plugs. One example is from my
811 serio:ty01pr00id00ex00
814 <p>The values present are
</p>
823 <p>This type is supported by the psmouse driver. I am not sure what
824 the valid values are.
</p>
826 <p><strong>Other subtypes
</strong></p>
828 <p>There are heaps of other modalias subtypes according to
829 file2alias.c. There is the rest of the list from that source: amba,
830 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
831 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
832 vmbus, x86cpu and zorro. I did not spend time documenting all of
833 these, as they do not seem relevant for my intended use with mapping
834 hardware to packages when new stuff is inserted during run time.
</p>
836 <p><strong>Looking up kernel modules using modalias values
</strong></p>
838 <p>To check which kernel modules provide support for a given modalias,
839 one can use the following shell script:
</p>
842 for id in $(find /sys -name modalias -print0 | xargs -
0 cat | sort -u); do \
844 /sbin/modprobe --show-depends "$id"|sed 's/^/ /' ; \
848 <p>The output can look like this (only the first few entries as the
849 list is very long on my test machine):
</p>
853 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/acpi/ac.ko
855 FATAL: Module acpi:device: not found.
857 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/char/nvram.ko
858 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/leds/led-class.ko
859 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/rfkill/rfkill.ko
860 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/platform/x86/thinkpad_acpi.ko
861 acpi:IBM0071:PNP0511:
862 insmod /lib/modules/
2.6.32-
5-
686/kernel/lib/crc-ccitt.ko
863 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/irda/irda.ko
864 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/net/irda/nsc-ircc.ko
868 <p>If you want to help implementing a system to let us propose what
869 packages to install when new hardware is plugged into a Debian
870 machine, please send me an email or talk to me on
871 <a href=
"irc://irc.debian.org/%23debian-devel">#debian-devel
</a>.
</p>
873 <p><strong>Update
2013-
01-
15:
</strong> Rewrite "cat $(find ...)" to
874 "find ... -print0 | xargs -
0 cat" to make sure it handle directories
875 in /sys/ with space in them.
</p>
880 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>.
885 <div class=
"padding"></div>
888 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html">Moved the pymissile Debian packaging to collab-maint
</a></div>
889 <div class=
"date">10th January
2013</div>
890 <div class=
"body"><p>As part of my investigation on how to improve the support in Debian
891 for hardware dongles, I dug up my old Mark and Spencer USB Rocket
892 Launcher and updated the Debian package
893 <a href=
"http://packages.qa.debian.org/pymissile">pymissile
</a> to make
894 sure udev will fix the device permissions when it is plugged in. I
895 also added a "Modaliases" header to test it in the Debian archive and
896 hopefully make the package be proposed by jockey in Ubuntu when a user
897 plug in his rocket launcher. In the process I moved the source to a
898 git repository under collab-maint, to make it easier for any DD to
899 contribute.
<a href=
"http://code.google.com/p/pymissile/">Upstream
</a>
900 is not very active, but the software still work for me even after five
901 years of relative silence. The new git repository is not listed in
902 the uploaded package yet, because I want to test the other changes a
903 bit more before I upload the new version. If you want to check out
904 the new version with a .desktop file included, visit the
905 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/pymissile.git">gitweb
906 view
</a> or use "
<tt>git clone
907 git://anonscm.debian.org/collab-maint/pymissile.git
</tt>".</p>
912 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/robot
">robot</a>.
917 <div class="padding
"></div>
919 <p style="text-align: right;
"><a href="index.rss
"><img src="http://people.skolelinux.org/pere/blog/xml.gif
" alt="RSS feed
" width="36" height="14" /></a></p>
930 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2013/
01/
">January (11)</a></li>
932 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2013/
02/
">February (2)</a></li>
939 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
01/
">January (7)</a></li>
941 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
02/
">February (10)</a></li>
943 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
03/
">March (17)</a></li>
945 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
04/
">April (12)</a></li>
947 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
05/
">May (12)</a></li>
949 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
06/
">June (20)</a></li>
951 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
07/
">July (17)</a></li>
953 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
08/
">August (6)</a></li>
955 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
09/
">September (9)</a></li>
957 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
10/
">October (17)</a></li>
959 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
11/
">November (10)</a></li>
961 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2012/
12/
">December (7)</a></li>
968 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
01/
">January (16)</a></li>
970 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
02/
">February (6)</a></li>
972 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
03/
">March (6)</a></li>
974 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
04/
">April (7)</a></li>
976 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
05/
">May (3)</a></li>
978 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
06/
">June (2)</a></li>
980 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
07/
">July (7)</a></li>
982 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
08/
">August (6)</a></li>
984 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
09/
">September (4)</a></li>
986 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
10/
">October (2)</a></li>
988 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
11/
">November (3)</a></li>
990 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2011/
12/
">December (1)</a></li>
997 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
01/
">January (2)</a></li>
999 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
02/
">February (1)</a></li>
1001 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
03/
">March (3)</a></li>
1003 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
04/
">April (3)</a></li>
1005 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
05/
">May (9)</a></li>
1007 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
06/
">June (14)</a></li>
1009 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
07/
">July (12)</a></li>
1011 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
08/
">August (13)</a></li>
1013 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
09/
">September (7)</a></li>
1015 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
10/
">October (9)</a></li>
1017 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
11/
">November (13)</a></li>
1019 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2010/
12/
">December (12)</a></li>
1026 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
01/
">January (8)</a></li>
1028 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
02/
">February (8)</a></li>
1030 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
03/
">March (12)</a></li>
1032 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
04/
">April (10)</a></li>
1034 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
05/
">May (9)</a></li>
1036 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
06/
">June (3)</a></li>
1038 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
07/
">July (4)</a></li>
1040 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
08/
">August (3)</a></li>
1042 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
09/
">September (1)</a></li>
1044 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
10/
">October (2)</a></li>
1046 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
11/
">November (3)</a></li>
1048 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2009/
12/
">December (3)</a></li>
1055 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2008/
11/
">November (5)</a></li>
1057 <li><a href="http://people.skolelinux.org/pere/blog/archive/
2008/
12/
">December (7)</a></li>
1068 <li><a href="http://people.skolelinux.org/pere/blog/tags/
3d-printer
">3d-printer (13)</a></li>
1070 <li><a href="http://people.skolelinux.org/pere/blog/tags/amiga
">amiga (1)</a></li>
1072 <li><a href="http://people.skolelinux.org/pere/blog/tags/aros
">aros (1)</a></li>
1074 <li><a href="http://people.skolelinux.org/pere/blog/tags/bankid
">bankid (4)</a></li>
1076 <li><a href="http://people.skolelinux.org/pere/blog/tags/bitcoin
">bitcoin (6)</a></li>
1078 <li><a href="http://people.skolelinux.org/pere/blog/tags/bootsystem
">bootsystem (12)</a></li>
1080 <li><a href="http://people.skolelinux.org/pere/blog/tags/bsa
">bsa (2)</a></li>
1082 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian
">debian (70)</a></li>
1084 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu
">debian edu (118)</a></li>
1086 <li><a href="http://people.skolelinux.org/pere/blog/tags/digistan
">digistan (9)</a></li>
1088 <li><a href="http://people.skolelinux.org/pere/blog/tags/docbook
">docbook (7)</a></li>
1090 <li><a href="http://people.skolelinux.org/pere/blog/tags/drivstoffpriser
">drivstoffpriser (4)</a></li>
1092 <li><a href="http://people.skolelinux.org/pere/blog/tags/english
">english (176)</a></li>
1094 <li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami
">fiksgatami (21)</a></li>
1096 <li><a href="http://people.skolelinux.org/pere/blog/tags/fildeling
">fildeling (12)</a></li>
1098 <li><a href="http://people.skolelinux.org/pere/blog/tags/freeculture
">freeculture (10)</a></li>
1100 <li><a href="http://people.skolelinux.org/pere/blog/tags/frikanalen
">frikanalen (9)</a></li>
1102 <li><a href="http://people.skolelinux.org/pere/blog/tags/intervju
">intervju (32)</a></li>
1104 <li><a href="http://people.skolelinux.org/pere/blog/tags/isenkram
">isenkram (5)</a></li>
1106 <li><a href="http://people.skolelinux.org/pere/blog/tags/kart
">kart (17)</a></li>
1108 <li><a href="http://people.skolelinux.org/pere/blog/tags/ldap
">ldap (8)</a></li>
1110 <li><a href="http://people.skolelinux.org/pere/blog/tags/lenker
">lenker (6)</a></li>
1112 <li><a href="http://people.skolelinux.org/pere/blog/tags/ltsp
">ltsp (1)</a></li>
1114 <li><a href="http://people.skolelinux.org/pere/blog/tags/multimedia
">multimedia (25)</a></li>
1116 <li><a href="http://people.skolelinux.org/pere/blog/tags/norsk
">norsk (220)</a></li>
1118 <li><a href="http://people.skolelinux.org/pere/blog/tags/nuug
">nuug (148)</a></li>
1120 <li><a href="http://people.skolelinux.org/pere/blog/tags/offentlig innsyn
">offentlig innsyn (6)</a></li>
1122 <li><a href="http://people.skolelinux.org/pere/blog/tags/open311
">open311 (2)</a></li>
1124 <li><a href="http://people.skolelinux.org/pere/blog/tags/opphavsrett
">opphavsrett (41)</a></li>
1126 <li><a href="http://people.skolelinux.org/pere/blog/tags/personvern
">personvern (62)</a></li>
1128 <li><a href="http://people.skolelinux.org/pere/blog/tags/raid
">raid (1)</a></li>
1130 <li><a href="http://people.skolelinux.org/pere/blog/tags/reprap
">reprap (11)</a></li>
1132 <li><a href="http://people.skolelinux.org/pere/blog/tags/rfid
">rfid (2)</a></li>
1134 <li><a href="http://people.skolelinux.org/pere/blog/tags/robot
">robot (6)</a></li>
1136 <li><a href="http://people.skolelinux.org/pere/blog/tags/rss
">rss (1)</a></li>
1138 <li><a href="http://people.skolelinux.org/pere/blog/tags/ruter
">ruter (4)</a></li>
1140 <li><a href="http://people.skolelinux.org/pere/blog/tags/scraperwiki
">scraperwiki (2)</a></li>
1142 <li><a href="http://people.skolelinux.org/pere/blog/tags/sikkerhet
">sikkerhet (28)</a></li>
1144 <li><a href="http://people.skolelinux.org/pere/blog/tags/sitesummary
">sitesummary (4)</a></li>
1146 <li><a href="http://people.skolelinux.org/pere/blog/tags/skepsis
">skepsis (4)</a></li>
1148 <li><a href="http://people.skolelinux.org/pere/blog/tags/standard
">standard (39)</a></li>
1150 <li><a href="http://people.skolelinux.org/pere/blog/tags/stavekontroll
">stavekontroll (3)</a></li>
1152 <li><a href="http://people.skolelinux.org/pere/blog/tags/stortinget
">stortinget (5)</a></li>
1154 <li><a href="http://people.skolelinux.org/pere/blog/tags/surveillance
">surveillance (13)</a></li>
1156 <li><a href="http://people.skolelinux.org/pere/blog/tags/sysadmin
">sysadmin (1)</a></li>
1158 <li><a href="http://people.skolelinux.org/pere/blog/tags/valg
">valg (7)</a></li>
1160 <li><a href="http://people.skolelinux.org/pere/blog/tags/video
">video (35)</a></li>
1162 <li><a href="http://people.skolelinux.org/pere/blog/tags/vitenskap
">vitenskap (4)</a></li>
1164 <li><a href="http://people.skolelinux.org/pere/blog/tags/web
">web (26)</a></li>
1170 <p style="text-align: right
">
1171 Created by <a href="http://steve.org.uk/Software/chronicle
">Chronicle v4.6</a>