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/Hva_stemte_hver_stortingsrepresentant_i_voteringene_om_datalagringsdirektivet_.html">Hva stemte hver stortingsrepresentant i voteringene om datalagringsdirektivet?
</a></div>
24 <div class=
"date"> 9th February
2013</div>
25 <div class=
"body"><p>Nytt stortingsvalg er på trappene, og folket får igjen mulighet til
26 å påvirke sammensetningen i vår lovgivende forsamling. Da er det
27 relevant å vite hvilke representanter og partier som har støttet
28 innføringen av brev- og besøkskontroll av hele den norske
29 befolkningen, det vil si datalagringsdirektivet.
</p>
31 <p>Hvis du vil vite hva hver enkelt stortingsrepresentant har stemt i
32 stortingsvoteringene om datalagringsdirektivet, så har nettstedet til
33 <a href=
"http://www.holderdeord.no/">Holder De Ord
</a> den (så vidt jeg
34 vet) eneste komplette oversikten på sin temaside om
35 <a href=
"http://beta.holderdeord.no/issues/innfore-datalagringsdirektivet">innføringen
36 av datalagringsdirektivet
</a>. Den har detaljene fra de
11 relevante
37 forslagene som har vært fremmet så lagt. De har vært votert over
38 2011-
04-
04,
2011-
04-
11,
2012-
06-
11,
2012-
10-
05 og
2012-
12-
06.
</p>
40 <p>Hvis du lurer på hva som er problemet med datalagringsdirektivet,
41 anbefaler jeg å lese
<a href=
"http://www.uhuru.biz/?cat=84">artiklene
42 fra Jon Wessel-Aas
</a> om temaet, samt informasjon fra foreningen
43 <a href=
"http://www.digitaltpersonvern.no/">Digitalt
49 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/stortinget">stortinget
</a>,
<a href=
"http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance
</a>.
54 <div class=
"padding"></div>
57 <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>
58 <div class=
"date"> 4th February
2013</div>
59 <div class=
"body"><p>Jeg ser med gru at Arbeiderpartiet, Høyre og Fremskrittspartiet
60 <a href=
"http://www.aftenposten.no/nyheter/iriks/Positive-til-mer-smuglerovervaking-7110348.html">applauderer
61 tollvesenets forslag
</a> om å øke overvåkningen i Norge nok et hakk.
62 Det er ikke så rart, da de som uttaler seg jo også har støttet
63 innføringen av datalagringsdirektivet eller i hvert fall ikke veldig
64 aktivt har motarbeidet det. Innføringen av datalagringsdirektivet er
65 en lovendring som innebærer brev og besøkskontroll for hele
68 <p><a href=
"http://www.stortinget.no/no/Saker-og-publikasjoner/Saker/Sak/?p=48717">Datalagringsdirektivet
</a>
69 har vært oppe til votering i stortinget tre ganger så langt. Det ble
70 <a href=
"http://svartelisten.org/">vedtatt første gang
2011-
04-
04</a>
72 <a href=
"https://github.com/holderdeord/hdo-folketingparser/blob/master/data/votering-2011-04-11.xml">andre
73 gang
2011-
04-
11</a> (lovendringer voteres to ganger), og forslag om å
75 <a href=
"http://www.stortinget.no/no/Saker-og-publikasjoner/Saker/Sak/Voteringsoversikt/?p=53844&dnid=1">nedstemt
76 2012-
12-
06</a> (se også
77 <a href=
"http://beta.holderdeord.no/issues/innfore-datalagringsdirektivet">oversikt fra Holder De
80 <p>Jan Bøhler i Arbeiderpartiet stemte for å innføre
81 datalagringsdirektivet i lovverket i første votering, var ikke
82 tilstede i andre votering og støttet loven i tredje votering. André
83 Oktay Dahl i Høyre var ikke til stede i første og andre votering men
84 støttet loven i tredje votering. Ulf Leirstein i Fremskrittspartiet
85 stemte mot loven i første votering men var ikke til stede i andre og
88 <p>Hvis du lurer på hva som er problemet med datalagringsdirektivet,
89 anbefaler jeg å lese
<a href=
"http://www.uhuru.biz/?cat=84">artiklene
90 fra Jon Wessel-Aas
</a> om temaet, samt informasjon fra foreningen
91 <a href=
"http://www.digitaltpersonvern.no/">Digitalt
94 <p><strong>Oppdatering
2013-
03-
09</strong>: Endret lenke til Holder De
95 Ord, som har byttet mange lenker i forbindelse med import av
96 voteringsdata for
2010-
2011.
</p>
101 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>.
106 <div class=
"padding"></div>
109 <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>
110 <div class=
"date"> 2nd February
2013</div>
111 <div class=
"body"><p>My
112 <a href=
"http://people.skolelinux.org/pere/blog/How_to_backport_bitcoin_qt_version_0_7_2_2_to_Debian_Squeeze.html">last
113 bitcoin related blog post
</a> mentioned that the new
114 <a href=
"http://packages.qa.debian.org/bitcoin">bitcoin package
</a> for
115 Debian was waiting in NEW. It was accepted by the Debian ftp-masters
116 2013-
01-
19, and have been available in unstable since then. It was
117 automatically copied to Ubuntu, and is available in their Raring
120 <p>But there is a strange problem with the build that block this new
121 version from being available on the i386 and kfreebsd-i386
122 architectures. For some strange reason, the autobuilders in Debian
123 for these architectures fail to run the test suite on these
124 architectures (
<a href=
"http://bugs.debian.org/672524">BTS #
672524</a>).
125 We are so far unable to reproduce it when building it manually, and
126 no-one have been able to propose a fix. If you got an idea what is
127 failing, please let us know via the BTS.
</p>
129 <p>One feature that is annoying me with of the bitcoin client, because
130 I often run low on disk space, is the fact that the client will exit
131 if it run short on space (
<a href=
"http://bugs.debian.org/696715">BTS
132 #
696715</a>). So make sure you have enough disk space when you run
135 <p>As usual, if you use bitcoin and want to show your support of my
136 activities, please send Bitcoin donations to my address
137 <b><a href=
"bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&label=PetterReinholdtsenBlog">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a></b>.
</p>
142 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>.
147 <div class=
"padding"></div>
150 <div class=
"title"><a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">Welcome to the world, Isenkram!
</a></div>
151 <div class=
"date">22nd January
2013</div>
152 <div class=
"body"><p>Yesterday, I
153 <a href=
"http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html">asked
154 for testers
</a> for my prototype for making Debian better at handling
155 pluggable hardware devices, which I
156 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">set
157 out to create
</a> earlier this month. Several valuable testers showed
158 up, and caused me to really want to to open up the development to more
159 people. But before I did this, I want to come up with a sensible name
160 for this project. Today I finally decided on a new name, and I have
161 renamed the project from hw-support-handler to this new name. In the
162 process, I moved the source to git and made it available as a
163 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git">collab-maint
</a>
164 repository in Debian. The new name? It is
<strong>Isenkram
</strong>.
165 To fetch and build the latest version of the source, use
</p>
168 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
169 cd isenkram && git-buildpackage -us -uc
172 <p>I have not yet adjusted all files to use the new name yet. If you
173 want to hack on the source or improve the package, please go ahead.
174 But please talk to me first on IRC or via email before you do major
175 changes, to make sure we do not step on each others toes. :)
</p>
177 <p>If you wonder what 'isenkram' is, it is a Norwegian word for iron
178 stuff, typically meaning tools, nails, screws, etc. Typical hardware
179 stuff, in other words. I've been told it is the Norwegian variant of
180 the German word eisenkram, for those that are familiar with that
183 <p><strong>Update
2013-
01-
26</strong>: Added -us -us to build
184 instructions, to avoid confusing people with an error from the signing
187 <p><strong>Update
2013-
01-
27</strong>: Switch to HTTP URL for the git
188 clone argument to avoid the need for authentication.
</p>
193 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>.
198 <div class=
"padding"></div>
201 <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>
202 <div class=
"date">21st January
2013</div>
203 <div class=
"body"><p>Early this month I set out to try to
204 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">improve
205 the Debian support for pluggable hardware devices
</a>. Now my
206 prototype is working, and it is ready for a larger audience. To test
208 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">source
209 from the Debian Edu subversion repository
</a>, build and install the
210 package. You might have to log out and in again activate the
211 autostart script.
</p>
213 <p>The design is simple:
</p>
217 <li>Add desktop entry in /usr/share/autostart/ causing a program
218 hw-support-handlerd to start when the user log in.
</li>
220 <li>This program listen for kernel events about new hardware (directly
221 from the kernel like udev does), not using HAL dbus events as I
224 <li>When new hardware is inserted, look up the hardware modalias in
225 the APT database, a database
226 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup">available
227 via HTTP
</a> and a database available as part of the package.
</li>
229 <li>If a package is mapped to the hardware in question, the package
230 isn't installed yet and this is the first time the hardware was
231 plugged in, show a desktop notification suggesting to install the
232 package or packages.
</li>
234 <li>If the user click on the 'install package now' button, ask
235 aptdaemon via the PackageKit API to install the requrired package.
</li>
237 <li>aptdaemon ask for root password or sudo password, and install the
238 package while showing progress information in a window.
</li>
242 <p>I still need to come up with a better name for the system. Here
243 are some screen shots showing the prototype in action. First the
244 notification, then the password request, and finally the request to
245 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.
</p>
247 <p><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-1-notification.png">
248 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-2-password.png">
249 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-3-dependencies.png">
250 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-4-installing.png">
251 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-5-installing-details.png" width=
"70%"></p>
253 <p>The prototype still need to be improved with longer timeouts, but
254 is already useful. The database of hardware to package mappings also
255 need more work. It is currently compatible with the Ubuntu way of
256 storing such information in the package control file, but could be
257 changed to use other formats instead or in addition to the current
258 method. I've dropped the use of discover for this mapping, as the
259 modalias approach is more flexible and easier to use on Linux as long
260 as the Linux kernel expose its modalias strings directly.
</p>
262 <p><strong>Update
2013-
01-
21 16:
50</strong>: Due to popular demand,
263 here is the command required to check out and build the source: Use
265 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
266 hw-support-handler; debuild
</tt>'. If you lack debuild, install the
267 devscripts package.
</p>
269 <p><strong>Update
2013-
01-
23 12:
00</strong>: The project is now
270 renamed to Isenkram and the source moved from the Debian Edu
271 subversion repository to a Debian collab-maint git repository. See
272 <a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">build
273 instructions
</a> for details.
</p>
278 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>.
283 <div class=
"padding"></div>
286 <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>
287 <div class=
"date">19th January
2013</div>
288 <div class=
"body"><p>This Christmas my trusty old laptop died. It died quietly and
289 suddenly in bed. With a quiet whimper, it went completely quiet and
290 black. The power button was no longer able to turn it on. It was a
291 IBM Thinkpad X41, and the best laptop I ever had. Better than both
292 Thinkpads X30, X31, X40, X60, X61 and X61S. Far better than the
293 Compaq I had before that. Now I need to find a replacement. To keep
294 going during Christmas, I moved the one year old SSD disk to my old
295 X40 where it fitted (only one I had left that could use it), but it is
296 not a durable solution.
298 <p>My laptop needs are fairly modest. This is my wishlist from when I
299 got a new one more than
10 years ago. It still holds true.:)
</p>
303 <li>Lightweight (around
1 kg) and small volume (preferably smaller
305 <li>Robust, it will be in my backpack every day.
</li>
306 <li>Three button mouse and a mouse pin instead of touch pad.
</li>
307 <li>Long battery life time. Preferable a week.
</li>
308 <li>Internal WIFI network card.
</li>
309 <li>Internal Twisted Pair network card.
</li>
310 <li>Some USB slots (
2-
3 is plenty)
</li>
311 <li>Good keyboard - similar to the Thinkpad.
</li>
312 <li>Video resolution at least
1024x768, with size around
12" (A4 paper
314 <li>Hardware supported by Debian Stable, ie the default kernel and
316 <li>Quiet, preferably fan free (or at least not using the fan most of
321 <p>You will notice that there are no RAM and CPU requirements in the
322 list. The reason is simply that the specifications on laptops the
323 last
10-
15 years have been sufficient for my needs, and I have to look
324 at other features to choose my laptop. But are there still made as
325 robust laptops as my X41? The Thinkpad X60/X61 proved to be less
326 robust, and Thinkpads seem to be heading in the wrong direction since
327 Lenovo took over. But I've been told that X220 and X1 Carbon might
330 <p>Perhaps I should rethink my needs, and look for a pad with an
331 external keyboard? I'll have to check the
332 <a href=
"http://www.linux-laptop.net/">Linux Laptops site
</a> for
333 well-supported laptops, or perhaps just buy one preinstalled from one
334 of the vendors listed on the
<a href=
"http://linuxpreloaded.com/">Linux
335 Pre-loaded site
</a>.
</p>
340 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>.
345 <div class=
"padding"></div>
348 <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>
349 <div class=
"date">18th January
2013</div>
350 <div class=
"body"><p>Some times I try to figure out which Iceweasel browser plugin to
351 install to get support for a given MIME type. Thanks to
352 <a href=
"https://wiki.ubuntu.com/MozillaTeam/Plugins">specifications
353 done by Ubuntu
</a> and Mozilla, it is possible to do this in Debian.
354 Unfortunately, not very many packages provide the needed meta
355 information, Anyway, here is a small script to look up all browser
356 plugin packages announcing ther MIME support using this specification:
</p>
362 def pkgs_handling_mimetype(mimetype):
367 version = pkg.candidate
369 version = pkg.installed
372 record = version.record
373 if not record.has_key('Npp-MimeType'):
375 mime_types = record['Npp-MimeType'].split(',')
377 t = t.rstrip().strip()
379 thepkgs.append(pkg.name)
381 mimetype = "audio/ogg"
382 if
1 < len(sys.argv):
383 mimetype = sys.argv[
1]
384 print "Browser plugin packages supporting %s:" % mimetype
385 for pkg in pkgs_handling_mimetype(mimetype):
389 <p>It can be used like this to look up a given MIME type:
</p>
392 % ./apt-find-browserplug-for-mimetype
393 Browser plugin packages supporting audio/ogg:
395 % ./apt-find-browserplug-for-mimetype application/x-shockwave-flash
396 Browser plugin packages supporting application/x-shockwave-flash:
401 <p>In Ubuntu this mechanism is combined with support in the browser
402 itself to query for plugins and propose to install the needed
403 packages. It would be great if Debian supported such feature too. Is
404 anyone working on adding it?
</p>
406 <p><strong>Update
2013-
01-
18 14:
20</strong>: The Debian BTS
407 request for icweasel support for this feature is
408 <a href=
"http://bugs.debian.org/484010">#
484010</a> from
2008 (and
409 <a href=
"http://bugs.debian.org/698426">#
698426</a> from today). Lack
410 of manpower and wish for a different design is the reason thus feature
411 is not yet in iceweasel from Debian.
</p>
416 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>.
421 <div class=
"padding"></div>
424 <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>
425 <div class=
"date">16th January
2013</div>
426 <div class=
"body"><p>The
<a href=
"http://wiki.debian.org/AppStreamDebianProposal">DEP-
11
427 proposal to add AppStream information to the Debian archive
</a>, is a
428 proposal to make it possible for a Desktop application to propose to
429 the user some package to install to gain support for a given MIME
430 type, font, library etc. that is currently missing. With such
431 mechanism in place, it would be possible for the desktop to
432 automatically propose and install leocad if some LDraw file is
433 downloaded by the browser.
</p>
435 <p>To get some idea about the current content of the archive, I decided
436 to write a simple program to extract all .desktop files from the
437 Debian archive and look up the claimed MIME support there. The result
439 <a href=
"http://ftp.skolelinux.org/pub/AppStreamTest">Skolelinux FTP
440 site
</a>. Using the collected information, it become possible to
441 answer the question in the title. Here are the
20 most supported MIME
442 types in Debian stable (Squeeze), testing (Wheezy) and unstable (Sid).
443 The complete list is available from the link above.
</p>
445 <p><strong>Debian Stable:
</strong></p>
449 ----- -----------------------
472 <p><strong>Debian Testing:
</strong></p>
476 ----- -----------------------
499 <p><strong>Debian Unstable:
</strong></p>
503 ----- -----------------------
526 <p>I am told that PackageKit can provide an API to access the kind of
527 information mentioned in DEP-
11. I have not yet had time to look at
528 it, but hope the PackageKit people in Debian are on top of these
531 <p><strong>Update
2013-
01-
16 13:
35</strong>: Updated numbers after
532 discovering a typo in my script.
</p>
537 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>.
542 <div class=
"padding"></div>
545 <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>
546 <div class=
"date">15th January
2013</div>
547 <div class=
"body"><p>Yesterday, I wrote about the
548 <a href=
"http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">modalias
549 values provided by the Linux kernel
</a> following my hope for
550 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">better
551 dongle support in Debian
</a>. Using this knowledge, I have tested how
552 modalias values attached to package names can be used to map packages
553 to hardware. This allow the system to look up and suggest relevant
554 packages when I plug in some new hardware into my machine, and replace
555 discover and discover-data as the database used to map hardware to
558 <p>I create a modaliases file with entries like the following,
559 containing package name, kernel module name (if relevant, otherwise
560 the package name) and globs matching the relevant hardware
564 Package: package-name
565 <br>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)
</p>
568 <p>It is fairly trivial to write code to find the relevant packages
569 for a given modalias value using this file.
</p>
571 <p>An entry like this would suggest the video and picture application
572 cheese for many USB web cameras (interface bus class
0E01):
</p>
576 <br>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)
</p>
579 <p>An entry like this would suggest the pcmciautils package when a
580 CardBus bridge (bus class
0607) PCI device is present:
</p>
584 <br>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
587 <p>An entry like this would suggest the package colorhug-client when
588 plugging in a ColorHug with USB IDs
04D8:F8DA:
</p>
591 Package: colorhug-client
592 <br>Modaliases: colorhug-client(usb:v04D8pF8DAd*)
</p>
595 <p>I believe the format is compatible with the format of the Packages
596 file in the Debian archive. Ubuntu already uses their Packages file
597 to store their mappings from packages to hardware.
</p>
599 <p>By adding a XB-Modaliases: header in debian/control, any .deb can
600 announce the hardware it support in a way my prototype understand.
601 This allow those publishing packages in an APT source outside the
602 Debian archive as well as those backporting packages to make sure the
603 hardware mapping are included in the package meta information. I've
604 tested such header in the pymissile package, and its modalias mapping
605 is working as it should with my prototype. It even made it to Ubuntu
608 <p>To test if it was possible to look up supported hardware using only
609 the shell tools available in the Debian installer, I wrote a shell
610 implementation of the lookup code. The idea is to create files for
611 each modalias and let the shell do the matching. Please check out and
613 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co">hw-support-lookup
</a>
614 shell script. It run without any extra dependencies and fetch the
615 hardware mappings from the Debian archive and the subversion
616 repository where I currently work on my prototype.
</p>
618 <p>When I use it on a machine with a yubikey inserted, it suggest to
619 install yubikey-personalization:
</p>
622 % ./hw-support-lookup
623 <br>yubikey-personalization
627 <p>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
628 propose to install the pcmciautils package:
</p>
631 % ./hw-support-lookup
636 <p>If you know of any hardware-package mapping that should be added to
637 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co">my
638 database
</a>, please tell me about it.
</p>
640 <p>It could be possible to generate several of the mappings between
641 packages and hardware. One source would be to look at packages with
642 kernel modules, ie packages with *.ko files in /lib/modules/, and
643 extract their modalias information. Another would be to look at
644 packages with udev rules, ie packages with files in
645 /lib/udev/rules.d/, and extract their vendor/model information to
646 generate a modalias matching rule. I have not tested any of these to
649 <p>If you want to help implementing a system to let us propose what
650 packages to install when new hardware is plugged into a Debian
651 machine, please send me an email or talk to me on
652 <a href=
"irc://irc.debian.org/%23debian-devel">#debian-devel
</a>.
</p>
657 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>.
662 <div class=
"padding"></div>
665 <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>
666 <div class=
"date">14th January
2013</div>
667 <div class=
"body"><p>While looking into how to look up Debian packages based on hardware
668 information, to find the packages that support a given piece of
669 hardware, I refreshed my memory regarding modalias values, and decided
670 to document the details. Here are my findings so far, also available
672 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
673 Debian Edu subversion repository
</a>:
675 <p><strong>Modalias decoded
</strong></p>
677 <p>This document try to explain what the different types of modalias
678 values stands for. It is in part based on information from
679 <URL:
<a href=
"https://wiki.archlinux.org/index.php/Modalias">https://wiki.archlinux.org/index.php/Modalias
</a> >,
680 <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> >,
681 <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
682 <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> >.
684 <p>The modalias entries for a given Linux machine can be found using
685 this shell script:
</p>
688 find /sys -name modalias -print0 | xargs -
0 cat | sort -u
691 <p>The supported modalias globs for a given kernel module can be found
695 % /sbin/modinfo psmouse | grep alias:
696 alias: serio:ty05pr*id*ex*
697 alias: serio:ty01pr*id*ex*
701 <p><strong>PCI subtype
</strong></p>
703 <p>A typical PCI entry can look like this. This is an Intel Host
704 Bridge memory controller:
</p>
707 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
710 <p>This represent these values:
</p>
715 sv
00001028 (subvendor)
716 sd
000001AD (subdevice)
722 <p>The vendor/device values are the same values outputted from 'lspci
723 -n' as
8086:
2770. The bus class/subclass is also shown by lspci as
724 0600. The
0600 class is a host bridge. Other useful bus values are
725 0300 (VGA compatible card) and
0200 (Ethernet controller).
</p>
727 <p>Not sure how to figure out the interface value, nor what it
730 <p><strong>USB subtype
</strong></p>
732 <p>Some typical USB entries can look like this. This is an internal
733 USB hub in a laptop:
</p>
736 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
739 <p>Here is the values included in this alias:
</p>
742 v
1D6B (device vendor)
743 p
0001 (device product)
746 dsc
00 (device subclass)
747 dp
00 (device protocol)
748 ic
09 (interface class)
749 isc
00 (interface subclass)
750 ip
00 (interface protocol)
753 <p>The
0900 device class/subclass means hub. Some times the relevant
754 class is in the interface class section. For a simple USB web camera,
755 these alias entries show up:
</p>
758 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
759 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
760 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
761 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
764 <p>Interface class
0E01 is video control,
0E02 is video streaming (aka
765 camera),
0101 is audio control device and
0102 is audio streaming (aka
766 microphone). Thus this is a camera with microphone included.
</p>
768 <p><strong>ACPI subtype
</strong></p>
770 <p>The ACPI type is used for several non-PCI/USB stuff. This is an IR
771 receiver in a Thinkpad X40:
</p>
774 acpi:IBM0071:PNP0511:
777 <p>The values between the colons are IDs.
</p>
779 <p><strong>DMI subtype
</strong></p>
781 <p>The DMI table contain lots of information about the computer case
782 and model. This is an entry for a IBM Thinkpad X40, fetched from
783 /sys/devices/virtual/dmi/id/modalias:
</p>
786 dmi:bvnIBM:bvr1UETB6WW(
1.66):bd06/
15/
2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
789 <p>The values present are
</p>
792 bvn IBM (BIOS vendor)
793 bvr
1UETB
6WW(
1.66) (BIOS version)
794 bd
06/
15/
2005 (BIOS date)
795 svn IBM (system vendor)
796 pn
2371H4G (product name)
797 pvr ThinkPadX40 (product version)
798 rvn IBM (board vendor)
799 rn
2371H4G (board name)
800 rvr NotAvailable (board version)
801 cvn IBM (chassis vendor)
803 cvr NotAvailable (chassis version)
806 <p>The chassis type
10 is Notebook. Other interesting values can be
807 found in the dmidecode source:
</p>
811 4 Low Profile Desktop
824 17 Main Server Chassis
827 20 Bus Expansion Chassis
828 21 Peripheral Chassis
830 23 Rack Mount Chassis
839 <p>The chassis type values are not always accurately set in the DMI
840 table. For example my home server is a tower, but the DMI modalias
841 claim it is a desktop.
</p>
843 <p><strong>SerIO subtype
</strong></p>
845 <p>This type is used for PS/
2 mouse plugs. One example is from my
849 serio:ty01pr00id00ex00
852 <p>The values present are
</p>
861 <p>This type is supported by the psmouse driver. I am not sure what
862 the valid values are.
</p>
864 <p><strong>Other subtypes
</strong></p>
866 <p>There are heaps of other modalias subtypes according to
867 file2alias.c. There is the rest of the list from that source: amba,
868 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
869 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
870 vmbus, x86cpu and zorro. I did not spend time documenting all of
871 these, as they do not seem relevant for my intended use with mapping
872 hardware to packages when new stuff is inserted during run time.
</p>
874 <p><strong>Looking up kernel modules using modalias values
</strong></p>
876 <p>To check which kernel modules provide support for a given modalias,
877 one can use the following shell script:
</p>
880 for id in $(find /sys -name modalias -print0 | xargs -
0 cat | sort -u); do \
882 /sbin/modprobe --show-depends "$id"|sed 's/^/ /' ; \
886 <p>The output can look like this (only the first few entries as the
887 list is very long on my test machine):
</p>
891 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/acpi/ac.ko
893 FATAL: Module acpi:device: not found.
895 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/char/nvram.ko
896 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/leds/led-class.ko
897 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/rfkill/rfkill.ko
898 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/platform/x86/thinkpad_acpi.ko
899 acpi:IBM0071:PNP0511:
900 insmod /lib/modules/
2.6.32-
5-
686/kernel/lib/crc-ccitt.ko
901 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/irda/irda.ko
902 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/net/irda/nsc-ircc.ko
906 <p>If you want to help implementing a system to let us propose what
907 packages to install when new hardware is plugged into a Debian
908 machine, please send me an email or talk to me on
909 <a href=
"irc://irc.debian.org/%23debian-devel">#debian-devel
</a>.
</p>
911 <p><strong>Update
2013-
01-
15:
</strong> Rewrite "cat $(find ...)" to
912 "find ... -print0 | xargs -
0 cat" to make sure it handle directories
913 in /sys/ with space in them.
</p>
918 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>.
923 <div class=
"padding"></div>
925 <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>
936 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/01/">January (
11)
</a></li>
938 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/02/">February (
3)
</a></li>
945 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/01/">January (
7)
</a></li>
947 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/02/">February (
10)
</a></li>
949 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/03/">March (
17)
</a></li>
951 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/04/">April (
12)
</a></li>
953 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/05/">May (
12)
</a></li>
955 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/06/">June (
20)
</a></li>
957 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/07/">July (
17)
</a></li>
959 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/08/">August (
6)
</a></li>
961 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/09/">September (
9)
</a></li>
963 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/10/">October (
17)
</a></li>
965 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/11/">November (
10)
</a></li>
967 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/12/">December (
7)
</a></li>
974 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/01/">January (
16)
</a></li>
976 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/02/">February (
6)
</a></li>
978 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/03/">March (
6)
</a></li>
980 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/04/">April (
7)
</a></li>
982 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/05/">May (
3)
</a></li>
984 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/06/">June (
2)
</a></li>
986 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/07/">July (
7)
</a></li>
988 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/08/">August (
6)
</a></li>
990 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/09/">September (
4)
</a></li>
992 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/10/">October (
2)
</a></li>
994 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/11/">November (
3)
</a></li>
996 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/12/">December (
1)
</a></li>
1003 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/01/">January (
2)
</a></li>
1005 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/02/">February (
1)
</a></li>
1007 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/03/">March (
3)
</a></li>
1009 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/04/">April (
3)
</a></li>
1011 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/05/">May (
9)
</a></li>
1013 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/06/">June (
14)
</a></li>
1015 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/07/">July (
12)
</a></li>
1017 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/08/">August (
13)
</a></li>
1019 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/09/">September (
7)
</a></li>
1021 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/10/">October (
9)
</a></li>
1023 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/11/">November (
13)
</a></li>
1025 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/12/">December (
12)
</a></li>
1032 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/01/">January (
8)
</a></li>
1034 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/02/">February (
8)
</a></li>
1036 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/03/">March (
12)
</a></li>
1038 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/04/">April (
10)
</a></li>
1040 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/05/">May (
9)
</a></li>
1042 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/06/">June (
3)
</a></li>
1044 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/07/">July (
4)
</a></li>
1046 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/08/">August (
3)
</a></li>
1048 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/09/">September (
1)
</a></li>
1050 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/10/">October (
2)
</a></li>
1052 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/11/">November (
3)
</a></li>
1054 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/12/">December (
3)
</a></li>
1061 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/11/">November (
5)
</a></li>
1063 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/12/">December (
7)
</a></li>
1074 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (
13)
</a></li>
1076 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/amiga">amiga (
1)
</a></li>
1078 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/aros">aros (
1)
</a></li>
1080 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bankid">bankid (
4)
</a></li>
1082 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin (
6)
</a></li>
1084 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (
12)
</a></li>
1086 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bsa">bsa (
2)
</a></li>
1088 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian">debian (
70)
</a></li>
1090 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (
118)
</a></li>
1092 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/digistan">digistan (
9)
</a></li>
1094 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/docbook">docbook (
7)
</a></li>
1096 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/drivstoffpriser">drivstoffpriser (
4)
</a></li>
1098 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/english">english (
176)
</a></li>
1100 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (
21)
</a></li>
1102 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (
12)
</a></li>
1104 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/freeculture">freeculture (
10)
</a></li>
1106 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/frikanalen">frikanalen (
9)
</a></li>
1108 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/intervju">intervju (
32)
</a></li>
1110 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram (
5)
</a></li>
1112 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/kart">kart (
17)
</a></li>
1114 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ldap">ldap (
8)
</a></li>
1116 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/lenker">lenker (
6)
</a></li>
1118 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (
1)
</a></li>
1120 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (
25)
</a></li>
1122 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/norsk">norsk (
221)
</a></li>
1124 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/nuug">nuug (
148)
</a></li>
1126 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/offentlig innsyn">offentlig innsyn (
6)
</a></li>
1128 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/open311">open311 (
2)
</a></li>
1130 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (
41)
</a></li>
1132 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/personvern">personvern (
63)
</a></li>
1134 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/raid">raid (
1)
</a></li>
1136 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/reprap">reprap (
11)
</a></li>
1138 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rfid">rfid (
2)
</a></li>
1140 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/robot">robot (
6)
</a></li>
1142 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rss">rss (
1)
</a></li>
1144 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ruter">ruter (
4)
</a></li>
1146 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/scraperwiki">scraperwiki (
2)
</a></li>
1148 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (
28)
</a></li>
1150 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (
4)
</a></li>
1152 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/skepsis">skepsis (
4)
</a></li>
1154 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/standard">standard (
39)
</a></li>
1156 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (
3)
</a></li>
1158 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stortinget">stortinget (
6)
</a></li>
1160 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance (
14)
</a></li>
1162 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sysadmin">sysadmin (
1)
</a></li>
1164 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/valg">valg (
7)
</a></li>
1166 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/video">video (
35)
</a></li>
1168 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (
4)
</a></li>
1170 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/web">web (
26)
</a></li>
1176 <p style=
"text-align: right">
1177 Created by
<a href=
"http://steve.org.uk/Software/chronicle">Chronicle v4.6
</a>