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