]> pere.pagekite.me Git - homepage.git/blob - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom="http://www.w3.org/2005/Atom">
3 <channel>
4 <title>Petter Reinholdtsen</title>
5 <description></description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7 <atom:link href="http://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
8
9 <item>
10 <title>Welcome to the world, Isenkram!</title>
11 <link>http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html</guid>
13 <pubDate>Tue, 22 Jan 2013 22:00:00 +0100</pubDate>
14 <description>&lt;p&gt;Yesterday, I
15 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html&quot;&gt;asked
16 for testers&lt;/a&gt; for my prototype for making Debian better at handling
17 pluggable hardware devices, which I
18 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html&quot;&gt;set
19 out to create&lt;/a&gt; earlier this month. Several valuable testers showed
20 up, and caused me to really want to to open up the development to more
21 people. But before I did this, I want to come up with a sensible name
22 for this project. Today I finally decided on a new name, and I have
23 renamed the project from hw-support-handler to this new name. In the
24 process, I moved the source to git and made it available as a
25 &lt;a href=&quot;http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git&quot;&gt;collab-maint&lt;/a&gt;
26 repository in Debian. The new name? It is &lt;strong&gt;Isenkram&lt;/strong&gt;.
27 To fetch and build the latest version of the source, use&lt;/p&gt;
28
29 &lt;pre&gt;
30 git clone git://anonscm.debian.org/collab-maint/isenkram.git
31 cd isenkram &amp;&amp; git-buildpackage
32 &lt;/pre&gt;
33
34 &lt;p&gt;I have not yet adjusted all files to use the new name yet. If you
35 want to hack on the source or improve the package, please go ahead.
36 But please talk to me first on IRC or via email before you do major
37 changes, to make sure we do not step on each others toes. :)&lt;/p&gt;
38
39 &lt;p&gt;If you wonder what &#39;isenkram&#39; is, it is a Norwegian word for iron
40 stuff, typically meaning tools, nails, screws, etc. Typical hardware
41 stuff, in other words. I&#39;ve been told it is the Norwegian variant of
42 the German word eisenkram, for those that are familiar with that
43 word.&lt;/p&gt;
44 </description>
45 </item>
46
47 <item>
48 <title>First prototype ready making hardware easier to use in Debian</title>
49 <link>http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html</link>
50 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html</guid>
51 <pubDate>Mon, 21 Jan 2013 12:00:00 +0100</pubDate>
52 <description>&lt;p&gt;Early this month I set out to try to
53 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html&quot;&gt;improve
54 the Debian support for pluggable hardware devices&lt;/a&gt;. Now my
55 prototype is working, and it is ready for a larger audience. To test
56 it, fetch the
57 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/&quot;&gt;source
58 from the Debian Edu subversion repository&lt;/a&gt;, build and install the
59 package. You might have to log out and in again activate the
60 autostart script.&lt;/p&gt;
61
62 &lt;p&gt;The design is simple:&lt;/p&gt;
63
64 &lt;ul&gt;
65
66 &lt;li&gt;Add desktop entry in /usr/share/autostart/ causing a program
67 hw-support-handlerd to start when the user log in.&lt;/li&gt;
68
69 &lt;li&gt;This program listen for kernel events about new hardware (directly
70 from the kernel like udev does), not using HAL dbus events as I
71 initially did.&lt;/li&gt;
72
73 &lt;li&gt;When new hardware is inserted, look up the hardware modalias in
74 the APT database, a database
75 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup&quot;&gt;available
76 via HTTP&lt;/a&gt; and a database available as part of the package.&lt;/li&gt;
77
78 &lt;li&gt;If a package is mapped to the hardware in question, the package
79 isn&#39;t installed yet and this is the first time the hardware was
80 plugged in, show a desktop notification suggesting to install the
81 package or packages.&lt;/li&gt;
82
83 &lt;li&gt;If the user click on the &#39;install package now&#39; button, ask
84 aptdaemon via the PackageKit API to install the requrired package.&lt;/li&gt;
85
86 &lt;li&gt;aptdaemon ask for root password or sudo password, and install the
87 package while showing progress information in a window.&lt;/li&gt;
88
89 &lt;/ul&gt;
90
91 &lt;p&gt;I still need to come up with a better name for the system. Here
92 are some screen shots showing the prototype in action. First the
93 notification, then the password request, and finally the request to
94 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.&lt;/p&gt;
95
96 &lt;p&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-1-notification.png&quot;&gt;
97 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-2-password.png&quot;&gt;
98 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-3-dependencies.png&quot;&gt;
99 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-4-installing.png&quot;&gt;
100 &lt;br&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-5-installing-details.png&quot; width=&quot;70%&quot;&gt;&lt;/p&gt;
101
102 &lt;p&gt;The prototype still need to be improved with longer timeouts, but
103 is already useful. The database of hardware to package mappings also
104 need more work. It is currently compatible with the Ubuntu way of
105 storing such information in the package control file, but could be
106 changed to use other formats instead or in addition to the current
107 method. I&#39;ve dropped the use of discover for this mapping, as the
108 modalias approach is more flexible and easier to use on Linux as long
109 as the Linux kernel expose its modalias strings directly.&lt;/p&gt;
110
111 &lt;p&gt;&lt;strong&gt;Update 2013-01-21 16:50&lt;/strong&gt;: Due to popular demand,
112 here is the command required to check out and build the source: Use
113 &#39;&lt;tt&gt;svn checkout
114 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
115 hw-support-handler; debuild&lt;/tt&gt;&#39;. If you lack debuild, install the
116 devscripts package.&lt;/p&gt;
117
118 &lt;p&gt;&lt;strong&gt;Update 2013-01-23 12:00&lt;/strong&gt;: The project is now
119 renamed to Isenkram and the source moved from the Debian Edu
120 subversion repository to a Debian collab-maint git repository. See
121 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html&quot;&gt;build
122 instructions&lt;/a&gt; for details.&lt;/p&gt;
123 </description>
124 </item>
125
126 <item>
127 <title>Thank you Thinkpad X41, for your long and trustworthy service</title>
128 <link>http://people.skolelinux.org/pere/blog/Thank_you_Thinkpad_X41__for_your_long_and_trustworthy_service.html</link>
129 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Thank_you_Thinkpad_X41__for_your_long_and_trustworthy_service.html</guid>
130 <pubDate>Sat, 19 Jan 2013 09:20:00 +0100</pubDate>
131 <description>&lt;p&gt;This Christmas my trusty old laptop died. It died quietly and
132 suddenly in bed. With a quiet whimper, it went completely quiet and
133 black. The power button was no longer able to turn it on. It was a
134 IBM Thinkpad X41, and the best laptop I ever had. Better than both
135 Thinkpads X30, X31, X40, X60, X61 and X61S. Far better than the
136 Compaq I had before that. Now I need to find a replacement. To keep
137 going during Christmas, I moved the one year old SSD disk to my old
138 X40 where it fitted (only one I had left that could use it), but it is
139 not a durable solution.
140
141 &lt;p&gt;My laptop needs are fairly modest. This is my wishlist from when I
142 got a new one more than 10 years ago. It still holds true.:)&lt;/p&gt;
143
144 &lt;ul&gt;
145
146 &lt;li&gt;Lightweight (around 1 kg) and small volume (preferably smaller
147 than A4).&lt;/li&gt;
148 &lt;li&gt;Robust, it will be in my backpack every day.&lt;/li&gt;
149 &lt;li&gt;Three button mouse and a mouse pin instead of touch pad.&lt;/li&gt;
150 &lt;li&gt;Long battery life time. Preferable a week.&lt;/li&gt;
151 &lt;li&gt;Internal WIFI network card.&lt;/li&gt;
152 &lt;li&gt;Internal Twisted Pair network card.&lt;/li&gt;
153 &lt;li&gt;Some USB slots (2-3 is plenty)&lt;/li&gt;
154 &lt;li&gt;Good keyboard - similar to the Thinkpad.&lt;/li&gt;
155 &lt;li&gt;Video resolution at least 1024x768, with size around 12&quot; (A4 paper
156 size).&lt;/li&gt;
157 &lt;li&gt;Hardware supported by Debian Stable, ie the default kernel and
158 X.org packages.&lt;/li&gt;
159 &lt;li&gt;Quiet, preferably fan free (or at least not using the fan most of
160 the time).
161
162 &lt;/ul&gt;
163
164 &lt;p&gt;You will notice that there are no RAM and CPU requirements in the
165 list. The reason is simply that the specifications on laptops the
166 last 10-15 years have been sufficient for my needs, and I have to look
167 at other features to choose my laptop. But are there still made as
168 robust laptops as my X41? The Thinkpad X60/X61 proved to be less
169 robust, and Thinkpads seem to be heading in the wrong direction since
170 Lenovo took over. But I&#39;ve been told that X220 and X1 Carbon might
171 still be useful.&lt;/p&gt;
172
173 &lt;p&gt;Perhaps I should rethink my needs, and look for a pad with an
174 external keyboard? I&#39;ll have to check the
175 &lt;a href=&quot;http://www.linux-laptop.net/&quot;&gt;Linux Laptops site&lt;/a&gt; for
176 well-supported laptops, or perhaps just buy one preinstalled from one
177 of the vendors listed on the &lt;a href=&quot;http://linuxpreloaded.com/&quot;&gt;Linux
178 Pre-loaded site&lt;/a&gt;.&lt;/p&gt;
179 </description>
180 </item>
181
182 <item>
183 <title>How to find a browser plugin supporting a given MIME type</title>
184 <link>http://people.skolelinux.org/pere/blog/How_to_find_a_browser_plugin_supporting_a_given_MIME_type.html</link>
185 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/How_to_find_a_browser_plugin_supporting_a_given_MIME_type.html</guid>
186 <pubDate>Fri, 18 Jan 2013 10:40:00 +0100</pubDate>
187 <description>&lt;p&gt;Some times I try to figure out which Iceweasel browser plugin to
188 install to get support for a given MIME type. Thanks to
189 &lt;a href=&quot;https://wiki.ubuntu.com/MozillaTeam/Plugins&quot;&gt;specifications
190 done by Ubuntu&lt;/a&gt; and Mozilla, it is possible to do this in Debian.
191 Unfortunately, not very many packages provide the needed meta
192 information, Anyway, here is a small script to look up all browser
193 plugin packages announcing ther MIME support using this specification:&lt;/p&gt;
194
195 &lt;pre&gt;
196 #!/usr/bin/python
197 import sys
198 import apt
199 def pkgs_handling_mimetype(mimetype):
200 cache = apt.Cache()
201 cache.open(None)
202 thepkgs = []
203 for pkg in cache:
204 version = pkg.candidate
205 if version is None:
206 version = pkg.installed
207 if version is None:
208 continue
209 record = version.record
210 if not record.has_key(&#39;Npp-MimeType&#39;):
211 continue
212 mime_types = record[&#39;Npp-MimeType&#39;].split(&#39;,&#39;)
213 for t in mime_types:
214 t = t.rstrip().strip()
215 if t == mimetype:
216 thepkgs.append(pkg.name)
217 return thepkgs
218 mimetype = &quot;audio/ogg&quot;
219 if 1 &lt; len(sys.argv):
220 mimetype = sys.argv[1]
221 print &quot;Browser plugin packages supporting %s:&quot; % mimetype
222 for pkg in pkgs_handling_mimetype(mimetype):
223 print &quot; %s&quot; %pkg
224 &lt;/pre&gt;
225
226 &lt;p&gt;It can be used like this to look up a given MIME type:&lt;/p&gt;
227
228 &lt;pre&gt;
229 % ./apt-find-browserplug-for-mimetype
230 Browser plugin packages supporting audio/ogg:
231 gecko-mediaplayer
232 % ./apt-find-browserplug-for-mimetype application/x-shockwave-flash
233 Browser plugin packages supporting application/x-shockwave-flash:
234 browser-plugin-gnash
235 %
236 &lt;/pre&gt;
237
238 &lt;p&gt;In Ubuntu this mechanism is combined with support in the browser
239 itself to query for plugins and propose to install the needed
240 packages. It would be great if Debian supported such feature too. Is
241 anyone working on adding it?&lt;/p&gt;
242
243 &lt;p&gt;&lt;strong&gt;Update 2013-01-18 14:20&lt;/strong&gt;: The Debian BTS
244 request for icweasel support for this feature is
245 &lt;a href=&quot;http://bugs.debian.org/484010&quot;&gt;#484010&lt;/a&gt; from 2008 (and
246 &lt;a href=&quot;http://bugs.debian.org/698426&quot;&gt;#698426&lt;/a&gt; from today). Lack
247 of manpower and wish for a different design is the reason thus feature
248 is not yet in iceweasel from Debian.&lt;/p&gt;
249 </description>
250 </item>
251
252 <item>
253 <title>What is the most supported MIME type in Debian?</title>
254 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html</link>
255 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html</guid>
256 <pubDate>Wed, 16 Jan 2013 10:10:00 +0100</pubDate>
257 <description>&lt;p&gt;The &lt;a href=&quot;http://wiki.debian.org/AppStreamDebianProposal&quot;&gt;DEP-11
258 proposal to add AppStream information to the Debian archive&lt;/a&gt;, is a
259 proposal to make it possible for a Desktop application to propose to
260 the user some package to install to gain support for a given MIME
261 type, font, library etc. that is currently missing. With such
262 mechanism in place, it would be possible for the desktop to
263 automatically propose and install leocad if some LDraw file is
264 downloaded by the browser.&lt;/p&gt;
265
266 &lt;p&gt;To get some idea about the current content of the archive, I decided
267 to write a simple program to extract all .desktop files from the
268 Debian archive and look up the claimed MIME support there. The result
269 can be found on the
270 &lt;a href=&quot;http://ftp.skolelinux.org/pub/AppStreamTest&quot;&gt;Skolelinux FTP
271 site&lt;/a&gt;. Using the collected information, it become possible to
272 answer the question in the title. Here are the 20 most supported MIME
273 types in Debian stable (Squeeze), testing (Wheezy) and unstable (Sid).
274 The complete list is available from the link above.&lt;/p&gt;
275
276 &lt;p&gt;&lt;strong&gt;Debian Stable:&lt;/strong&gt;&lt;/p&gt;
277
278 &lt;pre&gt;
279 count MIME type
280 ----- -----------------------
281 32 text/plain
282 30 audio/mpeg
283 29 image/png
284 28 image/jpeg
285 27 application/ogg
286 26 audio/x-mp3
287 25 image/tiff
288 25 image/gif
289 22 image/bmp
290 22 audio/x-wav
291 20 audio/x-flac
292 19 audio/x-mpegurl
293 18 video/x-ms-asf
294 18 audio/x-musepack
295 18 audio/x-mpeg
296 18 application/x-ogg
297 17 video/mpeg
298 17 audio/x-scpls
299 17 audio/ogg
300 16 video/x-ms-wmv
301 &lt;/pre&gt;
302
303 &lt;p&gt;&lt;strong&gt;Debian Testing:&lt;/strong&gt;&lt;/p&gt;
304
305 &lt;pre&gt;
306 count MIME type
307 ----- -----------------------
308 33 text/plain
309 32 image/png
310 32 image/jpeg
311 29 audio/mpeg
312 27 image/gif
313 26 image/tiff
314 26 application/ogg
315 25 audio/x-mp3
316 22 image/bmp
317 21 audio/x-wav
318 19 audio/x-mpegurl
319 19 audio/x-mpeg
320 18 video/mpeg
321 18 audio/x-scpls
322 18 audio/x-flac
323 18 application/x-ogg
324 17 video/x-ms-asf
325 17 text/html
326 17 audio/x-musepack
327 16 image/x-xbitmap
328 &lt;/pre&gt;
329
330 &lt;p&gt;&lt;strong&gt;Debian Unstable:&lt;/strong&gt;&lt;/p&gt;
331
332 &lt;pre&gt;
333 count MIME type
334 ----- -----------------------
335 31 text/plain
336 31 image/png
337 31 image/jpeg
338 29 audio/mpeg
339 28 application/ogg
340 27 image/gif
341 26 image/tiff
342 26 audio/x-mp3
343 23 audio/x-wav
344 22 image/bmp
345 21 audio/x-flac
346 20 audio/x-mpegurl
347 19 audio/x-mpeg
348 18 video/x-ms-asf
349 18 video/mpeg
350 18 audio/x-scpls
351 18 application/x-ogg
352 17 audio/x-musepack
353 16 video/x-ms-wmv
354 16 video/x-msvideo
355 &lt;/pre&gt;
356
357 &lt;p&gt;I am told that PackageKit can provide an API to access the kind of
358 information mentioned in DEP-11. I have not yet had time to look at
359 it, but hope the PackageKit people in Debian are on top of these
360 issues.&lt;/p&gt;
361
362 &lt;p&gt;&lt;strong&gt;Update 2013-01-16 13:35&lt;/strong&gt;: Updated numbers after
363 discovering a typo in my script.&lt;/p&gt;
364 </description>
365 </item>
366
367 <item>
368 <title>Using modalias info to find packages handling my hardware</title>
369 <link>http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html</link>
370 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html</guid>
371 <pubDate>Tue, 15 Jan 2013 08:00:00 +0100</pubDate>
372 <description>&lt;p&gt;Yesterday, I wrote about the
373 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html&quot;&gt;modalias
374 values provided by the Linux kernel&lt;/a&gt; following my hope for
375 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html&quot;&gt;better
376 dongle support in Debian&lt;/a&gt;. Using this knowledge, I have tested how
377 modalias values attached to package names can be used to map packages
378 to hardware. This allow the system to look up and suggest relevant
379 packages when I plug in some new hardware into my machine, and replace
380 discover and discover-data as the database used to map hardware to
381 packages.&lt;/p&gt;
382
383 &lt;p&gt;I create a modaliases file with entries like the following,
384 containing package name, kernel module name (if relevant, otherwise
385 the package name) and globs matching the relevant hardware
386 modalias.&lt;/p&gt;
387
388 &lt;p&gt;&lt;blockquote&gt;
389 Package: package-name
390 &lt;br&gt;Modaliases: module(modaliasglob, modaliasglob, modaliasglob)&lt;/p&gt;
391 &lt;/blockquote&gt;&lt;/p&gt;
392
393 &lt;p&gt;It is fairly trivial to write code to find the relevant packages
394 for a given modalias value using this file.&lt;/p&gt;
395
396 &lt;p&gt;An entry like this would suggest the video and picture application
397 cheese for many USB web cameras (interface bus class 0E01):&lt;/p&gt;
398
399 &lt;p&gt;&lt;blockquote&gt;
400 Package: cheese
401 &lt;br&gt;Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)&lt;/p&gt;
402 &lt;/blockquote&gt;&lt;/p&gt;
403
404 &lt;p&gt;An entry like this would suggest the pcmciautils package when a
405 CardBus bridge (bus class 0607) PCI device is present:&lt;/p&gt;
406
407 &lt;p&gt;&lt;blockquote&gt;
408 Package: pcmciautils
409 &lt;br&gt;Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
410 &lt;/blockquote&gt;&lt;/p&gt;
411
412 &lt;p&gt;An entry like this would suggest the package colorhug-client when
413 plugging in a ColorHug with USB IDs 04D8:F8DA:&lt;/p&gt;
414
415 &lt;p&gt;&lt;blockquote&gt;
416 Package: colorhug-client
417 &lt;br&gt;Modaliases: colorhug-client(usb:v04D8pF8DAd*)&lt;/p&gt;
418 &lt;/blockquote&gt;&lt;/p&gt;
419
420 &lt;p&gt;I believe the format is compatible with the format of the Packages
421 file in the Debian archive. Ubuntu already uses their Packages file
422 to store their mappings from packages to hardware.&lt;/p&gt;
423
424 &lt;p&gt;By adding a XB-Modaliases: header in debian/control, any .deb can
425 announce the hardware it support in a way my prototype understand.
426 This allow those publishing packages in an APT source outside the
427 Debian archive as well as those backporting packages to make sure the
428 hardware mapping are included in the package meta information. I&#39;ve
429 tested such header in the pymissile package, and its modalias mapping
430 is working as it should with my prototype. It even made it to Ubuntu
431 Raring.&lt;/p&gt;
432
433 &lt;p&gt;To test if it was possible to look up supported hardware using only
434 the shell tools available in the Debian installer, I wrote a shell
435 implementation of the lookup code. The idea is to create files for
436 each modalias and let the shell do the matching. Please check out and
437 try the
438 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co&quot;&gt;hw-support-lookup&lt;/a&gt;
439 shell script. It run without any extra dependencies and fetch the
440 hardware mappings from the Debian archive and the subversion
441 repository where I currently work on my prototype.&lt;/p&gt;
442
443 &lt;p&gt;When I use it on a machine with a yubikey inserted, it suggest to
444 install yubikey-personalization:&lt;/p&gt;
445
446 &lt;p&gt;&lt;blockquote&gt;
447 % ./hw-support-lookup
448 &lt;br&gt;yubikey-personalization
449 &lt;br&gt;%
450 &lt;/blockquote&gt;&lt;/p&gt;
451
452 &lt;p&gt;When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
453 propose to install the pcmciautils package:&lt;/p&gt;
454
455 &lt;p&gt;&lt;blockquote&gt;
456 % ./hw-support-lookup
457 &lt;br&gt;pcmciautils
458 &lt;br&gt;%
459 &lt;/blockquote&gt;&lt;/p&gt;
460
461 &lt;p&gt;If you know of any hardware-package mapping that should be added to
462 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co&quot;&gt;my
463 database&lt;/a&gt;, please tell me about it.&lt;/p&gt;
464
465 &lt;p&gt;It could be possible to generate several of the mappings between
466 packages and hardware. One source would be to look at packages with
467 kernel modules, ie packages with *.ko files in /lib/modules/, and
468 extract their modalias information. Another would be to look at
469 packages with udev rules, ie packages with files in
470 /lib/udev/rules.d/, and extract their vendor/model information to
471 generate a modalias matching rule. I have not tested any of these to
472 see if it work.&lt;/p&gt;
473
474 &lt;p&gt;If you want to help implementing a system to let us propose what
475 packages to install when new hardware is plugged into a Debian
476 machine, please send me an email or talk to me on
477 &lt;a href=&quot;irc://irc.debian.org/%23debian-devel&quot;&gt;#debian-devel&lt;/a&gt;.&lt;/p&gt;
478 </description>
479 </item>
480
481 <item>
482 <title>Modalias strings - a practical way to map &quot;stuff&quot; to hardware</title>
483 <link>http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html</link>
484 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html</guid>
485 <pubDate>Mon, 14 Jan 2013 11:20:00 +0100</pubDate>
486 <description>&lt;p&gt;While looking into how to look up Debian packages based on hardware
487 information, to find the packages that support a given piece of
488 hardware, I refreshed my memory regarding modalias values, and decided
489 to document the details. Here are my findings so far, also available
490 in
491 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/&quot;&gt;the
492 Debian Edu subversion repository&lt;/a&gt;:
493
494 &lt;p&gt;&lt;strong&gt;Modalias decoded&lt;/strong&gt;&lt;/p&gt;
495
496 &lt;p&gt;This document try to explain what the different types of modalias
497 values stands for. It is in part based on information from
498 &amp;lt;URL: &lt;a href=&quot;https://wiki.archlinux.org/index.php/Modalias&quot;&gt;https://wiki.archlinux.org/index.php/Modalias&lt;/a&gt; &amp;gt;,
499 &amp;lt;URL: &lt;a href=&quot;http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device&quot;&gt;http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device&lt;/a&gt; &amp;gt;,
500 &amp;lt;URL: &lt;a href=&quot;http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c&quot;&gt;http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c&lt;/a&gt; &amp;gt; and
501 &amp;lt;URL: &lt;a href=&quot;http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&amp;view=markup&quot;&gt;http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&amp;view=markup&lt;/a&gt; &amp;gt;.
502
503 &lt;p&gt;The modalias entries for a given Linux machine can be found using
504 this shell script:&lt;/p&gt;
505
506 &lt;pre&gt;
507 find /sys -name modalias -print0 | xargs -0 cat | sort -u
508 &lt;/pre&gt;
509
510 &lt;p&gt;The supported modalias globs for a given kernel module can be found
511 using modinfo:&lt;/p&gt;
512
513 &lt;pre&gt;
514 % /sbin/modinfo psmouse | grep alias:
515 alias: serio:ty05pr*id*ex*
516 alias: serio:ty01pr*id*ex*
517 %
518 &lt;/pre&gt;
519
520 &lt;p&gt;&lt;strong&gt;PCI subtype&lt;/strong&gt;&lt;/p&gt;
521
522 &lt;p&gt;A typical PCI entry can look like this. This is an Intel Host
523 Bridge memory controller:&lt;/p&gt;
524
525 &lt;p&gt;&lt;blockquote&gt;
526 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
527 &lt;/blockquote&gt;&lt;/p&gt;
528
529 &lt;p&gt;This represent these values:&lt;/p&gt;
530
531 &lt;pre&gt;
532 v 00008086 (vendor)
533 d 00002770 (device)
534 sv 00001028 (subvendor)
535 sd 000001AD (subdevice)
536 bc 06 (bus class)
537 sc 00 (bus subclass)
538 i 00 (interface)
539 &lt;/pre&gt;
540
541 &lt;p&gt;The vendor/device values are the same values outputted from &#39;lspci
542 -n&#39; as 8086:2770. The bus class/subclass is also shown by lspci as
543 0600. The 0600 class is a host bridge. Other useful bus values are
544 0300 (VGA compatible card) and 0200 (Ethernet controller).&lt;/p&gt;
545
546 &lt;p&gt;Not sure how to figure out the interface value, nor what it
547 means.&lt;/p&gt;
548
549 &lt;p&gt;&lt;strong&gt;USB subtype&lt;/strong&gt;&lt;/p&gt;
550
551 &lt;p&gt;Some typical USB entries can look like this. This is an internal
552 USB hub in a laptop:&lt;/p&gt;
553
554 &lt;p&gt;&lt;blockquote&gt;
555 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
556 &lt;/blockquote&gt;&lt;/p&gt;
557
558 &lt;p&gt;Here is the values included in this alias:&lt;/p&gt;
559
560 &lt;pre&gt;
561 v 1D6B (device vendor)
562 p 0001 (device product)
563 d 0206 (bcddevice)
564 dc 09 (device class)
565 dsc 00 (device subclass)
566 dp 00 (device protocol)
567 ic 09 (interface class)
568 isc 00 (interface subclass)
569 ip 00 (interface protocol)
570 &lt;/pre&gt;
571
572 &lt;p&gt;The 0900 device class/subclass means hub. Some times the relevant
573 class is in the interface class section. For a simple USB web camera,
574 these alias entries show up:&lt;/p&gt;
575
576 &lt;p&gt;&lt;blockquote&gt;
577 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
578 &lt;br&gt;usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
579 &lt;br&gt;usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
580 &lt;br&gt;usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
581 &lt;/blockquote&gt;&lt;/p&gt;
582
583 &lt;p&gt;Interface class 0E01 is video control, 0E02 is video streaming (aka
584 camera), 0101 is audio control device and 0102 is audio streaming (aka
585 microphone). Thus this is a camera with microphone included.&lt;/p&gt;
586
587 &lt;p&gt;&lt;strong&gt;ACPI subtype&lt;/strong&gt;&lt;/p&gt;
588
589 &lt;p&gt;The ACPI type is used for several non-PCI/USB stuff. This is an IR
590 receiver in a Thinkpad X40:&lt;/p&gt;
591
592 &lt;p&gt;&lt;blockquote&gt;
593 acpi:IBM0071:PNP0511:
594 &lt;/blockquote&gt;&lt;/p&gt;
595
596 &lt;p&gt;The values between the colons are IDs.&lt;/p&gt;
597
598 &lt;p&gt;&lt;strong&gt;DMI subtype&lt;/strong&gt;&lt;/p&gt;
599
600 &lt;p&gt;The DMI table contain lots of information about the computer case
601 and model. This is an entry for a IBM Thinkpad X40, fetched from
602 /sys/devices/virtual/dmi/id/modalias:&lt;/p&gt;
603
604 &lt;p&gt;&lt;blockquote&gt;
605 dmi:bvnIBM:bvr1UETB6WW(1.66):bd06/15/2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
606 &lt;/blockquote&gt;&lt;/p&gt;
607
608 &lt;p&gt;The values present are&lt;/p&gt;
609
610 &lt;pre&gt;
611 bvn IBM (BIOS vendor)
612 bvr 1UETB6WW(1.66) (BIOS version)
613 bd 06/15/2005 (BIOS date)
614 svn IBM (system vendor)
615 pn 2371H4G (product name)
616 pvr ThinkPadX40 (product version)
617 rvn IBM (board vendor)
618 rn 2371H4G (board name)
619 rvr NotAvailable (board version)
620 cvn IBM (chassis vendor)
621 ct 10 (chassis type)
622 cvr NotAvailable (chassis version)
623 &lt;/pre&gt;
624
625 &lt;p&gt;The chassis type 10 is Notebook. Other interesting values can be
626 found in the dmidecode source:&lt;/p&gt;
627
628 &lt;pre&gt;
629 3 Desktop
630 4 Low Profile Desktop
631 5 Pizza Box
632 6 Mini Tower
633 7 Tower
634 8 Portable
635 9 Laptop
636 10 Notebook
637 11 Hand Held
638 12 Docking Station
639 13 All In One
640 14 Sub Notebook
641 15 Space-saving
642 16 Lunch Box
643 17 Main Server Chassis
644 18 Expansion Chassis
645 19 Sub Chassis
646 20 Bus Expansion Chassis
647 21 Peripheral Chassis
648 22 RAID Chassis
649 23 Rack Mount Chassis
650 24 Sealed-case PC
651 25 Multi-system
652 26 CompactPCI
653 27 AdvancedTCA
654 28 Blade
655 29 Blade Enclosing
656 &lt;/pre&gt;
657
658 &lt;p&gt;The chassis type values are not always accurately set in the DMI
659 table. For example my home server is a tower, but the DMI modalias
660 claim it is a desktop.&lt;/p&gt;
661
662 &lt;p&gt;&lt;strong&gt;SerIO subtype&lt;/strong&gt;&lt;/p&gt;
663
664 &lt;p&gt;This type is used for PS/2 mouse plugs. One example is from my
665 test machine:&lt;/p&gt;
666
667 &lt;p&gt;&lt;blockquote&gt;
668 serio:ty01pr00id00ex00
669 &lt;/blockquote&gt;&lt;/p&gt;
670
671 &lt;p&gt;The values present are&lt;/p&gt;
672
673 &lt;pre&gt;
674 ty 01 (type)
675 pr 00 (prototype)
676 id 00 (id)
677 ex 00 (extra)
678 &lt;/pre&gt;
679
680 &lt;p&gt;This type is supported by the psmouse driver. I am not sure what
681 the valid values are.&lt;/p&gt;
682
683 &lt;p&gt;&lt;strong&gt;Other subtypes&lt;/strong&gt;&lt;/p&gt;
684
685 &lt;p&gt;There are heaps of other modalias subtypes according to
686 file2alias.c. There is the rest of the list from that source: amba,
687 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
688 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
689 vmbus, x86cpu and zorro. I did not spend time documenting all of
690 these, as they do not seem relevant for my intended use with mapping
691 hardware to packages when new stuff is inserted during run time.&lt;/p&gt;
692
693 &lt;p&gt;&lt;strong&gt;Looking up kernel modules using modalias values&lt;/strong&gt;&lt;/p&gt;
694
695 &lt;p&gt;To check which kernel modules provide support for a given modalias,
696 one can use the following shell script:&lt;/p&gt;
697
698 &lt;pre&gt;
699 for id in $(find /sys -name modalias -print0 | xargs -0 cat | sort -u); do \
700 echo &quot;$id&quot; ; \
701 /sbin/modprobe --show-depends &quot;$id&quot;|sed &#39;s/^/ /&#39; ; \
702 done
703 &lt;/pre&gt;
704
705 &lt;p&gt;The output can look like this (only the first few entries as the
706 list is very long on my test machine):&lt;/p&gt;
707
708 &lt;pre&gt;
709 acpi:ACPI0003:
710 insmod /lib/modules/2.6.32-5-686/kernel/drivers/acpi/ac.ko
711 acpi:device:
712 FATAL: Module acpi:device: not found.
713 acpi:IBM0068:
714 insmod /lib/modules/2.6.32-5-686/kernel/drivers/char/nvram.ko
715 insmod /lib/modules/2.6.32-5-686/kernel/drivers/leds/led-class.ko
716 insmod /lib/modules/2.6.32-5-686/kernel/net/rfkill/rfkill.ko
717 insmod /lib/modules/2.6.32-5-686/kernel/drivers/platform/x86/thinkpad_acpi.ko
718 acpi:IBM0071:PNP0511:
719 insmod /lib/modules/2.6.32-5-686/kernel/lib/crc-ccitt.ko
720 insmod /lib/modules/2.6.32-5-686/kernel/net/irda/irda.ko
721 insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/irda/nsc-ircc.ko
722 [...]
723 &lt;/pre&gt;
724
725 &lt;p&gt;If you want to help implementing a system to let us propose what
726 packages to install when new hardware is plugged into a Debian
727 machine, please send me an email or talk to me on
728 &lt;a href=&quot;irc://irc.debian.org/%23debian-devel&quot;&gt;#debian-devel&lt;/a&gt;.&lt;/p&gt;
729
730 &lt;p&gt;&lt;strong&gt;Update 2013-01-15:&lt;/strong&gt; Rewrite &quot;cat $(find ...)&quot; to
731 &quot;find ... -print0 | xargs -0 cat&quot; to make sure it handle directories
732 in /sys/ with space in them.&lt;/p&gt;
733 </description>
734 </item>
735
736 <item>
737 <title>Moved the pymissile Debian packaging to collab-maint</title>
738 <link>http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html</link>
739 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html</guid>
740 <pubDate>Thu, 10 Jan 2013 20:40:00 +0100</pubDate>
741 <description>&lt;p&gt;As part of my investigation on how to improve the support in Debian
742 for hardware dongles, I dug up my old Mark and Spencer USB Rocket
743 Launcher and updated the Debian package
744 &lt;a href=&quot;http://packages.qa.debian.org/pymissile&quot;&gt;pymissile&lt;/a&gt; to make
745 sure udev will fix the device permissions when it is plugged in. I
746 also added a &quot;Modaliases&quot; header to test it in the Debian archive and
747 hopefully make the package be proposed by jockey in Ubuntu when a user
748 plug in his rocket launcher. In the process I moved the source to a
749 git repository under collab-maint, to make it easier for any DD to
750 contribute. &lt;a href=&quot;http://code.google.com/p/pymissile/&quot;&gt;Upstream&lt;/a&gt;
751 is not very active, but the software still work for me even after five
752 years of relative silence. The new git repository is not listed in
753 the uploaded package yet, because I want to test the other changes a
754 bit more before I upload the new version. If you want to check out
755 the new version with a .desktop file included, visit the
756 &lt;a href=&quot;http://anonscm.debian.org/gitweb/?p=collab-maint/pymissile.git&quot;&gt;gitweb
757 view&lt;/a&gt; or use &quot;&lt;tt&gt;git clone
758 git://anonscm.debian.org/collab-maint/pymissile.git&lt;/tt&gt;&quot;.&lt;/p&gt;
759 </description>
760 </item>
761
762 <item>
763 <title>Lets make hardware dongles easier to use in Debian</title>
764 <link>http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html</link>
765 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html</guid>
766 <pubDate>Wed, 9 Jan 2013 15:40:00 +0100</pubDate>
767 <description>&lt;p&gt;One thing that annoys me with Debian and Linux distributions in
768 general, is that there is a great package management system with the
769 ability to automatically install software packages by downloading them
770 from the distribution mirrors, but no way to get it to automatically
771 install the packages I need to use the hardware I plug into my
772 machine. Even if the package to use it is easily available from the
773 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
774 suggest to automatically install the python-nxt, nbc and t2n packages
775 I need to talk to it. When I plug in a Yubikey, it could propose the
776 yubikey-personalization package. The information required to do this
777 is available, but no-one have pulled all the pieces together.&lt;/p&gt;
778
779 &lt;p&gt;Some years ago, I proposed to
780 &lt;a href=&quot;http://lists.debian.org/debian-devel/2010/05/msg01206.html&quot;&gt;use
781 the discover subsystem to implement this&lt;/a&gt;. The idea is fairly
782 simple:
783
784 &lt;ul&gt;
785
786 &lt;li&gt;Add a desktop entry in /usr/share/autostart/ pointing to a program
787 starting when a user log in.&lt;/li&gt;
788
789 &lt;li&gt;Set this program up to listen for kernel events emitted when new
790 hardware is inserted into the computer.&lt;/li&gt;
791
792 &lt;li&gt;When new hardware is inserted, look up the hardware ID in a
793 database mapping to packages, and take note of any non-installed
794 packages.&lt;/li&gt;
795
796 &lt;li&gt;Show a message to the user proposing to install the discovered
797 package, and make it easy to install it.&lt;/li&gt;
798
799 &lt;/ul&gt;
800
801 &lt;p&gt;I am not sure what the best way to implement this is, but my
802 initial idea was to use dbus events to discover new hardware, the
803 discover database to find packages and
804 &lt;a href=&quot;http://www.packagekit.org/&quot;&gt;PackageKit&lt;/a&gt; to install
805 packages.&lt;/p&gt;
806
807 &lt;p&gt;Yesterday, I found time to try to implement this idea, and the
808 draft package is now checked into
809 &lt;a href=&quot;http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/&quot;&gt;the
810 Debian Edu subversion repository&lt;/a&gt;. In the process, I updated the
811 &lt;a href=&quot;http://packages.qa.debian.org/d/discover-data.html&quot;&gt;discover-data&lt;/a&gt;
812 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
813 the relevant packages in Debian, and uploaded a new version
814 2.2013.01.09 to unstable. I also discovered that the current
815 &lt;a href=&quot;http://packages.qa.debian.org/d/discover.html&quot;&gt;discover&lt;/a&gt;
816 package in Debian no longer discovered any USB devices, because
817 /proc/bus/usb/devices is no longer present. I ported it to use
818 libusb as a fall back option to get it working. The fixed package
819 version 2.1.2-6 is now in experimental (didn&#39;t upload it to unstable
820 because of the freeze).&lt;/p&gt;
821
822 &lt;p&gt;With this prototype in place, I can insert my Yubikey, and get this
823 desktop notification to show up (only once, the first time it is
824 inserted):&lt;/p&gt;
825
826 &lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;http://people.skolelinux.org/pere/blog/images/2013-01-09-hw-autoinstall.png&quot;&gt;&lt;/p&gt;
827
828 &lt;p&gt;For this prototype to be really useful, some way to automatically
829 install the proposed packages by pressing the &quot;Please install
830 program(s)&quot; button should to be implemented.&lt;/p&gt;
831
832 &lt;p&gt;If this idea seem useful to you, and you want to help make it
833 happen, please help me update the discover-data database with mappings
834 from hardware to Debian packages. Check if &#39;discover-pkginstall -l&#39;
835 list the package you would like to have installed when a given
836 hardware device is inserted into your computer, and report bugs using
837 reportbug if it isn&#39;t. Or, if you know of a better way to provide
838 such mapping, please let me know.&lt;/p&gt;
839
840 &lt;p&gt;This prototype need more work, and there are several questions that
841 should be considered before it is ready for production use. Is dbus
842 the correct way to detect new hardware? At the moment I look for HAL
843 dbus events on the system bus, because that is the events I could see
844 on my Debian Squeeze KDE desktop. Are there better events to use?
845 How should the user be notified? Is the desktop notification
846 mechanism the best option, or should the background daemon raise a
847 popup instead? How should packages be installed? When should they
848 not be installed?&lt;/p&gt;
849
850 &lt;p&gt;If you want to help getting such feature implemented in Debian,
851 please send me an email. :)&lt;/p&gt;
852 </description>
853 </item>
854
855 <item>
856 <title>New IRC channel for LEGO designers using Debian</title>
857 <link>http://people.skolelinux.org/pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html</link>
858 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/New_IRC_channel_for_LEGO_designers_using_Debian.html</guid>
859 <pubDate>Wed, 2 Jan 2013 15:40:00 +0100</pubDate>
860 <description>&lt;p&gt;During Christmas, I have worked a bit on the Debian support for
861 &lt;a href=&quot;http://mindstorms.lego.com/en-us/Default.aspx&quot;&gt;LEGO Mindstorm
862 NXT&lt;/a&gt;. My son and I have played a bit with my NXT set, and I
863 discovered I had to build all the tools myself because none were
864 already in Debian Squeeze. If Debian support for LEGO is something
865 you care about, please join me on the IRC channel
866 &lt;a href=&quot;irc://irc.debian.org/%23debian-lego&quot;&gt;#debian-lego&lt;/a&gt; (server
867 irc.debian.org). There is a lot that could be done to improve the
868 Debian support for LEGO designers. For example both CAD software
869 and Mindstorm compilers are missing. :)&lt;/p&gt;
870
871 &lt;p&gt;Update 2012-01-03: A
872 &lt;a href=&quot;http://wiki.debian.org/LegoDesigners&quot;&gt;project page&lt;/a&gt;
873 including links to Lego related packages is now available.&lt;/p&gt;
874 </description>
875 </item>
876
877 </channel>
878 </rss>