]> pere.pagekite.me Git - homepage.git/blob - blog/tags/isenkram/index.html
d2a6a3a9e0acc359a95060d812812dfb0f7b862c
[homepage.git] / blog / tags / isenkram / index.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
6 <title>Petter Reinholdtsen: Entries Tagged isenkram</title>
7 <link rel="stylesheet" type="text/css" media="screen" href="http://people.skolelinux.org/pere/blog/style.css" />
8 <link rel="stylesheet" type="text/css" media="screen" href="http://people.skolelinux.org/pere/blog/vim.css" />
9 <link rel="alternate" title="RSS Feed" href="isenkram.rss" type="application/rss+xml" />
10 </head>
11 <body>
12 <div class="title">
13 <h1>
14 <a href="http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen</a>
15
16 </h1>
17
18 </div>
19
20
21 <h3>Entries tagged "isenkram".</h3>
22
23 <div class="entry">
24 <div class="title">
25 <a href="http://people.skolelinux.org/pere/blog/Isenkram_with_PackageKit_support___new_version_0_23_available_in_Debian_unstable.html">Isenkram with PackageKit support - new version 0.23 available in Debian unstable</a>
26 </div>
27 <div class="date">
28 25th May 2016
29 </div>
30 <div class="body">
31 <p><a href="https://tracker.debian.org/pkg/isenkram">The isenkram
32 system</a> is a user-focused solution in Debian for handling hardware
33 related packages. The idea is to have a database of mappings between
34 hardware and packages, and pop up a dialog suggesting for the user to
35 install the packages to use a given hardware dongle. Some use cases
36 are when you insert a Yubikey, it proposes to install the software
37 needed to control it; when you insert a braille reader list it
38 proposes to install the packages needed to send text to the reader;
39 and when you insert a ColorHug screen calibrator it suggests to
40 install the driver for it. The system work well, and even have a few
41 command line tools to install firmware packages and packages for the
42 hardware already in the machine (as opposed to hotpluggable hardware).</p>
43
44 <p>The system was initially written using aptdaemon, because I found
45 good documentation and example code on how to use it. But aptdaemon
46 is going away and is generally being replaced by
47 <a href="http://www.freedesktop.org/software/PackageKit/">PackageKit</a>,
48 so Isenkram needed a rewrite. And today, thanks to the great patch
49 from my college Sunil Mohan Adapa in the FreedomBox project, the
50 rewrite finally took place. I've just uploaded a new version of
51 Isenkram into Debian Unstable with the patch included, and the default
52 for the background daemon is now to use PackageKit. To check it out,
53 install the <tt>isenkram</tt> package and insert some hardware dongle
54 and see if it is recognised.</p>
55
56 <p>If you want to know what kind of packages isenkram would propose for
57 the machine it is running on, you can check out the isenkram-lookup
58 program. This is what it look like on a Thinkpad X230:</p>
59
60 <p><blockquote><pre>
61 % isenkram-lookup
62 bluez
63 cheese
64 fprintd
65 fprintd-demo
66 gkrellm-thinkbat
67 hdapsd
68 libpam-fprintd
69 pidgin-blinklight
70 thinkfan
71 tleds
72 tp-smapi-dkms
73 tp-smapi-source
74 tpb
75 %p
76 </pre></blockquote></p>
77
78 <p>The hardware mappings come from several places. The preferred way
79 is for packages to announce their hardware support using
80 <a href="https://www.freedesktop.org/software/appstream/docs/">the
81 cross distribution appstream system</a>.
82 See
83 <a href="http://people.skolelinux.org/pere/blog/tags/isenkram/">previous
84 blog posts about isenkram</a> to learn how to do that.</p>
85
86 </div>
87 <div class="tags">
88
89
90 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
91
92
93 </div>
94 </div>
95 <div class="padding"></div>
96
97 <div class="entry">
98 <div class="title">
99 <a href="http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html">Using appstream with isenkram to install hardware related packages in Debian</a>
100 </div>
101 <div class="date">
102 20th December 2015
103 </div>
104 <div class="body">
105 <p>Around three years ago, I created
106 <a href="http://packages.qa.debian.org/isenkram">the isenkram
107 system</a> to get a more practical solution in Debian for handing
108 hardware related packages. A GUI system in the isenkram package will
109 present a pop-up dialog when some hardware dongle supported by
110 relevant packages in Debian is inserted into the machine. The same
111 lookup mechanism to detect packages is available as command line
112 tools in the isenkram-cli package. In addition to mapping hardware,
113 it will also map kernel firmware files to packages and make it easy to
114 install needed firmware packages automatically. The key for this
115 system to work is a good way to map hardware to packages, in other
116 words, allow packages to announce what hardware they will work
117 with.</p>
118
119 <p>I started by providing data files in the isenkram source, and
120 adding code to download the latest version of these data files at run
121 time, to ensure every user had the most up to date mapping available.
122 I also added support for storing the mapping in the Packages file in
123 the apt repositories, but did not push this approach because while I
124 was trying to figure out how to best store hardware/package mappings,
125 <a href="http://www.freedesktop.org/software/appstream/docs/">the
126 appstream system</a> was announced. I got in touch and suggested to
127 add the hardware mapping into that data set to be able to use
128 appstream as a data source, and this was accepted at least for the
129 Debian version of appstream.</p>
130
131 <p>A few days ago using appstream in Debian for this became possible,
132 and today I uploaded a new version 0.20 of isenkram adding support for
133 appstream as a data source for mapping hardware to packages. The only
134 package so far using appstream to announce its hardware support is my
135 pymissile package. I got help from Matthias Klumpp with figuring out
136 how do add the required
137 <a href="https://appstream.debian.org/html/sid/main/metainfo/pymissile.html">metadata
138 in pymissile</a>. I added a file debian/pymissile.metainfo.xml with
139 this content:</p>
140
141 <blockquote><pre>
142 &lt;?xml version="1.0" encoding="UTF-8"?&gt;
143 &lt;component&gt;
144 &lt;id&gt;pymissile&lt;/id&gt;
145 &lt;metadata_license&gt;MIT&lt;/metadata_license&gt;
146 &lt;name&gt;pymissile&lt;/name&gt;
147 &lt;summary&gt;Control original Striker USB Missile Launcher&lt;/summary&gt;
148 &lt;description&gt;
149 &lt;p&gt;
150 Pymissile provides a curses interface to control an original
151 Marks and Spencer / Striker USB Missile Launcher, as well as a
152 motion control script to allow a webcamera to control the
153 launcher.
154 &lt;/p&gt;
155 &lt;/description&gt;
156 &lt;provides&gt;
157 &lt;modalias&gt;usb:v1130p0202d*&lt;/modalias&gt;
158 &lt;/provides&gt;
159 &lt;/component&gt;
160 </pre></blockquote>
161
162 <p>The key for isenkram is the component/provides/modalias value,
163 which is a glob style match rule for hardware specific strings
164 (modalias strings) provided by the Linux kernel. In this case, it
165 will map to all USB devices with vendor code 1130 and product code
166 0202.</p>
167
168 <p>Note, it is important that the license of all the metadata files
169 are compatible to have permissions to aggregate them into archive wide
170 appstream files. Matthias suggested to use MIT or BSD licenses for
171 these files. A challenge is figuring out a good id for the data, as
172 it is supposed to be globally unique and shared across distributions
173 (in other words, best to coordinate with upstream what to use). But
174 it can be changed later or, so we went with the package name as
175 upstream for this project is dormant.</p>
176
177 <p>To get the metadata file installed in the correct location for the
178 mirror update scripts to pick it up and include its content the
179 appstream data source, the file must be installed in the binary
180 package under /usr/share/appdata/. I did this by adding the following
181 line to debian/pymissile.install:</p>
182
183 <blockquote><pre>
184 debian/pymissile.metainfo.xml usr/share/appdata
185 </pre></blockquote>
186
187 <p>With that in place, the command line tool isenkram-lookup will list
188 all packages useful on the current computer automatically, and the GUI
189 pop-up handler will propose to install the package not already
190 installed if a hardware dongle is inserted into the machine in
191 question.</p>
192
193 <p>Details of the modalias field in appstream is available from the
194 <a href="https://wiki.debian.org/DEP-11">DEP-11</a> proposal.</p>
195
196 <p>To locate the modalias values of all hardware present in a machine,
197 try running this command on the command line:</p>
198
199 <blockquote><pre>
200 cat $(find /sys/devices/|grep modalias)
201 </pre></blockquote>
202
203 <p>To learn more about the isenkram system, please check out
204 <a href="http://people.skolelinux.org/pere/blog/tags/isenkram/">my
205 blog posts tagged isenkram</a>.</p>
206
207 </div>
208 <div class="tags">
209
210
211 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
212
213
214 </div>
215 </div>
216 <div class="padding"></div>
217
218 <div class="entry">
219 <div class="title">
220 <a href="http://people.skolelinux.org/pere/blog/Debian_Jessie__PXE_and_automatic_firmware_installation.html">Debian Jessie, PXE and automatic firmware installation</a>
221 </div>
222 <div class="date">
223 17th October 2014
224 </div>
225 <div class="body">
226 <p>When PXE installing laptops with Debian, I often run into the
227 problem that the WiFi card require some firmware to work properly.
228 And it has been a pain to fix this using preseeding in Debian.
229 Normally something more is needed. But thanks to
230 <a href="https://packages.qa.debian.org/i/isenkram.html">my isenkram
231 package</a> and its recent tasksel extension, it has now become easy
232 to do this using simple preseeding.</p>
233
234 <p>The isenkram-cli package provide tasksel tasks which will install
235 firmware for the hardware found in the machine (actually, requested by
236 the kernel modules for the hardware). (It can also install user space
237 programs supporting the hardware detected, but that is not the focus
238 of this story.)</p>
239
240 <p>To get this working in the default installation, two preeseding
241 values are needed. First, the isenkram-cli package must be installed
242 into the target chroot (aka the hard drive) before tasksel is executed
243 in the pkgsel step of the debian-installer system. This is done by
244 preseeding the base-installer/includes debconf value to include the
245 isenkram-cli package. The package name is next passed to debootstrap
246 for installation. With the isenkram-cli package in place, tasksel
247 will automatically use the isenkram tasks to detect hardware specific
248 packages for the machine being installed and install them, because
249 isenkram-cli contain tasksel tasks.</p>
250
251 <p>Second, one need to enable the non-free APT repository, because
252 most firmware unfortunately is non-free. This is done by preseeding
253 the apt-mirror-setup step. This is unfortunate, but for a lot of
254 hardware it is the only option in Debian.</p>
255
256 <p>The end result is two lines needed in your preseeding file to get
257 firmware installed automatically by the installer:</p>
258
259 <p><blockquote><pre>
260 base-installer base-installer/includes string isenkram-cli
261 apt-mirror-setup apt-setup/non-free boolean true
262 </pre></blockquote></p>
263
264 <p>The current version of isenkram-cli in testing/jessie will install
265 both firmware and user space packages when using this method. It also
266 do not work well, so use version 0.15 or later. Installing both
267 firmware and user space packages might give you a bit more than you
268 want, so I decided to split the tasksel task in two, one for firmware
269 and one for user space programs. The firmware task is enabled by
270 default, while the one for user space programs is not. This split is
271 implemented in the package currently in unstable.</p>
272
273 <p>If you decide to give this a go, please let me know (via email) how
274 this recipe work for you. :)</p>
275
276 <p>So, I bet you are wondering, how can this work. First and
277 foremost, it work because tasksel is modular, and driven by whatever
278 files it find in /usr/lib/tasksel/ and /usr/share/tasksel/. So the
279 isenkram-cli package place two files for tasksel to find. First there
280 is the task description file (/usr/share/tasksel/descs/isenkram.desc):</p>
281
282 <p><blockquote><pre>
283 Task: isenkram-packages
284 Section: hardware
285 Description: Hardware specific packages (autodetected by isenkram)
286 Based on the detected hardware various hardware specific packages are
287 proposed.
288 Test-new-install: show show
289 Relevance: 8
290 Packages: for-current-hardware
291
292 Task: isenkram-firmware
293 Section: hardware
294 Description: Hardware specific firmware packages (autodetected by isenkram)
295 Based on the detected hardware various hardware specific firmware
296 packages are proposed.
297 Test-new-install: mark show
298 Relevance: 8
299 Packages: for-current-hardware-firmware
300 </pre></blockquote></p>
301
302 <p>The key parts are Test-new-install which indicate how the task
303 should be handled and the Packages line referencing to a script in
304 /usr/lib/tasksel/packages/. The scripts use other scripts to get a
305 list of packages to install. The for-current-hardware-firmware script
306 look like this to list relevant firmware for the machine:
307
308 <p><blockquote><pre>
309 #!/bin/sh
310 #
311 PATH=/usr/sbin:$PATH
312 export PATH
313 isenkram-autoinstall-firmware -l
314 </pre></blockquote></p>
315
316 <p>With those two pieces in place, the firmware is installed by
317 tasksel during the normal d-i run. :)</p>
318
319 <p>If you want to test what tasksel will install when isenkram-cli is
320 installed, run <tt>DEBIAN_PRIORITY=critical tasksel --test
321 --new-install</tt> to get the list of packages that tasksel would
322 install.</p>
323
324 <p><a href="https://wiki.debian.org/DebianEdu/">Debian Edu</a> will be
325 pilots in testing this feature, as isenkram is used there now to
326 install firmware, replacing the earlier scripts.</p>
327
328 </div>
329 <div class="tags">
330
331
332 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>, <a href="http://people.skolelinux.org/pere/blog/tags/sysadmin">sysadmin</a>.
333
334
335 </div>
336 </div>
337 <div class="padding"></div>
338
339 <div class="entry">
340 <div class="title">
341 <a href="http://people.skolelinux.org/pere/blog/Install_hardware_dependent_packages_using_tasksel__Isenkram_0_7_.html">Install hardware dependent packages using tasksel (Isenkram 0.7)</a>
342 </div>
343 <div class="date">
344 23rd April 2014
345 </div>
346 <div class="body">
347 <p>It would be nice if it was easier in Debian to get all the hardware
348 related packages relevant for the computer installed automatically.
349 So I implemented one, using
350 <a href="http://packages.qa.debian.org/isenkram">my Isenkram
351 package</a>. To use it, install the tasksel and isenkram packages and
352 run tasksel as user root. You should be presented with a new option,
353 "Hardware specific packages (autodetected by isenkram)". When you
354 select it, tasksel will install the packages isenkram claim is fit for
355 the current hardware, hot pluggable or not.<p>
356
357 <p>The implementation is in two files, one is the tasksel menu entry
358 description, and the other is the script used to extract the list of
359 packages to install. The first part is in
360 <tt>/usr/share/tasksel/descs/isenkram.desc</tt> and look like
361 this:</p>
362
363 <p><blockquote><pre>
364 Task: isenkram
365 Section: hardware
366 Description: Hardware specific packages (autodetected by isenkram)
367 Based on the detected hardware various hardware specific packages are
368 proposed.
369 Test-new-install: mark show
370 Relevance: 8
371 Packages: for-current-hardware
372 </pre></blockquote></p>
373
374 <p>The second part is in
375 <tt>/usr/lib/tasksel/packages/for-current-hardware</tt> and look like
376 this:</p>
377
378 <p><blockquote><pre>
379 #!/bin/sh
380 #
381 (
382 isenkram-lookup
383 isenkram-autoinstall-firmware -l
384 ) | sort -u
385 </pre></blockquote></p>
386
387 <p>All in all, a very short and simple implementation making it
388 trivial to install the hardware dependent package we all may want to
389 have installed on our machines. I've not been able to find a way to
390 get tasksel to tell you exactly which packages it plan to install
391 before doing the installation. So if you are curious or careful,
392 check the output from the isenkram-* command line tools first.</p>
393
394 <p>The information about which packages are handling which hardware is
395 fetched either from the isenkram package itself in
396 /usr/share/isenkram/, from git.debian.org or from the APT package
397 database (using the Modaliases header). The APT package database
398 parsing have caused a nasty resource leak in the isenkram daemon (bugs
399 <a href="http://bugs.debian.org/719837">#719837</a> and
400 <a href="http://bugs.debian.org/730704">#730704</a>). The cause is in
401 the python-apt code (bug
402 <a href="http://bugs.debian.org/745487">#745487</a>), but using a
403 workaround I was able to get rid of the file descriptor leak and
404 reduce the memory leak from ~30 MiB per hardware detection down to
405 around 2 MiB per hardware detection. It should make the desktop
406 daemon a lot more useful. The fix is in version 0.7 uploaded to
407 unstable today.</p>
408
409 <p>I believe the current way of mapping hardware to packages in
410 Isenkram is is a good draft, but in the future I expect isenkram to
411 use the AppStream data source for this. A proposal for getting proper
412 AppStream support into Debian is floating around as
413 <a href="https://wiki.debian.org/DEP-11">DEP-11</a>, and
414 <a href="https://wiki.debian.org/SummerOfCode2014/Projects#SummerOfCode2014.2FProjects.2FAppStreamDEP11Implementation.AppStream.2FDEP-11_for_the_Debian_Archive">GSoC
415 project</a> will take place this summer to improve the situation. I
416 look forward to seeing the result, and welcome patches for isenkram to
417 start using the information when it is ready.</p>
418
419 <p>If you want your package to map to some specific hardware, either
420 add a "Xb-Modaliases" header to your control file like I did in
421 <a href="http://packages.qa.debian.org/pymissile">the pymissile
422 package</a> or submit a bug report with the details to the isenkram
423 package. See also
424 <a href="http://people.skolelinux.org/pere/blog/tags/isenkram/">all my
425 blog posts tagged isenkram</a> for details on the notation. I expect
426 the information will be migrated to AppStream eventually, but for the
427 moment I got no better place to store it.</p>
428
429 </div>
430 <div class="tags">
431
432
433 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
434
435
436 </div>
437 </div>
438 <div class="padding"></div>
439
440 <div class="entry">
441 <div class="title">
442 <a href="http://people.skolelinux.org/pere/blog/Automatically_locate_and_install_required_firmware_packages_on_Debian__Isenkram_0_4_.html">Automatically locate and install required firmware packages on Debian (Isenkram 0.4)</a>
443 </div>
444 <div class="date">
445 25th June 2013
446 </div>
447 <div class="body">
448 <p>It annoys me when the computer fail to do automatically what it is
449 perfectly capable of, and I have to do it manually to get things
450 working. One such task is to find out what firmware packages are
451 needed to get the hardware on my computer working. Most often this
452 affect the wifi card, but some times it even affect the RAID
453 controller or the ethernet card. Today I pushed version 0.4 of the
454 <a href="http://packages.qa.debian.org/isenkram">Isenkram package</a>
455 including a new script isenkram-autoinstall-firmware handling the
456 process of asking all the loaded kernel modules what firmware files
457 they want, find debian packages providing these files and install the
458 debian packages. Here is a test run on my laptop:</p>
459
460 <p><pre>
461 # isenkram-autoinstall-firmware
462 info: kernel drivers requested extra firmware: ipw2200-bss.fw ipw2200-ibss.fw ipw2200-sniffer.fw
463 info: fetching http://http.debian.net/debian/dists/squeeze/Contents-i386.gz
464 info: locating packages with the requested firmware files
465 info: Updating APT sources after adding non-free APT source
466 info: trying to install firmware-ipw2x00
467 firmware-ipw2x00
468 firmware-ipw2x00
469 Preconfiguring packages ...
470 Selecting previously deselected package firmware-ipw2x00.
471 (Reading database ... 259727 files and directories currently installed.)
472 Unpacking firmware-ipw2x00 (from .../firmware-ipw2x00_0.28+squeeze1_all.deb) ...
473 Setting up firmware-ipw2x00 (0.28+squeeze1) ...
474 #
475 </pre></p>
476
477 <p>When all the requested firmware is present, a simple message is
478 printed instead:</p>
479
480 <p><pre>
481 # isenkram-autoinstall-firmware
482 info: did not find any firmware files requested by loaded kernel modules. exiting
483 #
484 </pre></p>
485
486 <p>It could use some polish, but it is already working well and saving
487 me some time when setting up new machines. :)</p>
488
489 <p>So, how does it work? It look at the set of currently loaded
490 kernel modules, and look up each one of them using modinfo, to find
491 the firmware files listed in the module meta-information. Next, it
492 download the Contents file from a nearby APT mirror, and search for
493 the firmware files in this file to locate the package with the
494 requested firmware file. If the package is in the non-free section, a
495 non-free APT source is added and the package is installed using
496 <tt>apt-get install</tt>. The end result is a slightly better working
497 machine.</p>
498
499 <p>I hope someone find time to implement a more polished version of
500 this script as part of the hw-detect debian-installer module, to
501 finally fix <a href="http://bugs.debian.org/655507">BTS report
502 #655507</a>. There really is no need to insert USB sticks with
503 firmware during a PXE install when the packages already are available
504 from the nearby Debian mirror.</p>
505
506 </div>
507 <div class="tags">
508
509
510 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
511
512
513 </div>
514 </div>
515 <div class="padding"></div>
516
517 <div class="entry">
518 <div class="title">
519 <a href="http://people.skolelinux.org/pere/blog/Isenkram_0_2_finally_in_the_Debian_archive.html">Isenkram 0.2 finally in the Debian archive</a>
520 </div>
521 <div class="date">
522 3rd April 2013
523 </div>
524 <div class="body">
525 <p>Today the <a href="http://packages.qa.debian.org/isenkram">Isenkram
526 package</a> finally made it into the archive, after lingering in NEW
527 for many months. I uploaded it to the Debian experimental suite
528 2013-01-27, and today it was accepted into the archive.</p>
529
530 <p>Isenkram is a system for suggesting to users what packages to
531 install to work with a pluggable hardware device. The suggestion pop
532 up when the device is plugged in. For example if a Lego Mindstorm NXT
533 is inserted, it will suggest to install the program needed to program
534 the NXT controller. Give it a go, and report bugs and suggestions to
535 BTS. :)</p>
536
537 </div>
538 <div class="tags">
539
540
541 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
542
543
544 </div>
545 </div>
546 <div class="padding"></div>
547
548 <div class="entry">
549 <div class="title">
550 <a href="http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">Welcome to the world, Isenkram!</a>
551 </div>
552 <div class="date">
553 22nd January 2013
554 </div>
555 <div class="body">
556 <p>Yesterday, I
557 <a href="http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html">asked
558 for testers</a> for my prototype for making Debian better at handling
559 pluggable hardware devices, which I
560 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">set
561 out to create</a> earlier this month. Several valuable testers showed
562 up, and caused me to really want to to open up the development to more
563 people. But before I did this, I want to come up with a sensible name
564 for this project. Today I finally decided on a new name, and I have
565 renamed the project from hw-support-handler to this new name. In the
566 process, I moved the source to git and made it available as a
567 <a href="http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git">collab-maint</a>
568 repository in Debian. The new name? It is <strong>Isenkram</strong>.
569 To fetch and build the latest version of the source, use</p>
570
571 <pre>
572 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
573 cd isenkram && git-buildpackage -us -uc
574 </pre>
575
576 <p>I have not yet adjusted all files to use the new name yet. If you
577 want to hack on the source or improve the package, please go ahead.
578 But please talk to me first on IRC or via email before you do major
579 changes, to make sure we do not step on each others toes. :)</p>
580
581 <p>If you wonder what 'isenkram' is, it is a Norwegian word for iron
582 stuff, typically meaning tools, nails, screws, etc. Typical hardware
583 stuff, in other words. I've been told it is the Norwegian variant of
584 the German word eisenkram, for those that are familiar with that
585 word.</p>
586
587 <p><strong>Update 2013-01-26</strong>: Added -us -us to build
588 instructions, to avoid confusing people with an error from the signing
589 process.</p>
590
591 <p><strong>Update 2013-01-27</strong>: Switch to HTTP URL for the git
592 clone argument to avoid the need for authentication.</p>
593
594 </div>
595 <div class="tags">
596
597
598 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
599
600
601 </div>
602 </div>
603 <div class="padding"></div>
604
605 <div class="entry">
606 <div class="title">
607 <a href="http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html">First prototype ready making hardware easier to use in Debian</a>
608 </div>
609 <div class="date">
610 21st January 2013
611 </div>
612 <div class="body">
613 <p>Early this month I set out to try to
614 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">improve
615 the Debian support for pluggable hardware devices</a>. Now my
616 prototype is working, and it is ready for a larger audience. To test
617 it, fetch the
618 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">source
619 from the Debian Edu subversion repository</a>, build and install the
620 package. You might have to log out and in again activate the
621 autostart script.</p>
622
623 <p>The design is simple:</p>
624
625 <ul>
626
627 <li>Add desktop entry in /usr/share/autostart/ causing a program
628 hw-support-handlerd to start when the user log in.</li>
629
630 <li>This program listen for kernel events about new hardware (directly
631 from the kernel like udev does), not using HAL dbus events as I
632 initially did.</li>
633
634 <li>When new hardware is inserted, look up the hardware modalias in
635 the APT database, a database
636 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup">available
637 via HTTP</a> and a database available as part of the package.</li>
638
639 <li>If a package is mapped to the hardware in question, the package
640 isn't installed yet and this is the first time the hardware was
641 plugged in, show a desktop notification suggesting to install the
642 package or packages.</li>
643
644 <li>If the user click on the 'install package now' button, ask
645 aptdaemon via the PackageKit API to install the requrired package.</li>
646
647 <li>aptdaemon ask for root password or sudo password, and install the
648 package while showing progress information in a window.</li>
649
650 </ul>
651
652 <p>I still need to come up with a better name for the system. Here
653 are some screen shots showing the prototype in action. First the
654 notification, then the password request, and finally the request to
655 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.</p>
656
657 <p><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-1-notification.png">
658 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-2-password.png">
659 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-3-dependencies.png">
660 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-4-installing.png">
661 <br><img src="http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-5-installing-details.png" width="70%"></p>
662
663 <p>The prototype still need to be improved with longer timeouts, but
664 is already useful. The database of hardware to package mappings also
665 need more work. It is currently compatible with the Ubuntu way of
666 storing such information in the package control file, but could be
667 changed to use other formats instead or in addition to the current
668 method. I've dropped the use of discover for this mapping, as the
669 modalias approach is more flexible and easier to use on Linux as long
670 as the Linux kernel expose its modalias strings directly.</p>
671
672 <p><strong>Update 2013-01-21 16:50</strong>: Due to popular demand,
673 here is the command required to check out and build the source: Use
674 '<tt>svn checkout
675 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
676 hw-support-handler; debuild</tt>'. If you lack debuild, install the
677 devscripts package.</p>
678
679 <p><strong>Update 2013-01-23 12:00</strong>: The project is now
680 renamed to Isenkram and the source moved from the Debian Edu
681 subversion repository to a Debian collab-maint git repository. See
682 <a href="http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">build
683 instructions</a> for details.</p>
684
685 </div>
686 <div class="tags">
687
688
689 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
690
691
692 </div>
693 </div>
694 <div class="padding"></div>
695
696 <div class="entry">
697 <div class="title">
698 <a href="http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html">Using modalias info to find packages handling my hardware</a>
699 </div>
700 <div class="date">
701 15th January 2013
702 </div>
703 <div class="body">
704 <p>Yesterday, I wrote about the
705 <a href="http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">modalias
706 values provided by the Linux kernel</a> following my hope for
707 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">better
708 dongle support in Debian</a>. Using this knowledge, I have tested how
709 modalias values attached to package names can be used to map packages
710 to hardware. This allow the system to look up and suggest relevant
711 packages when I plug in some new hardware into my machine, and replace
712 discover and discover-data as the database used to map hardware to
713 packages.</p>
714
715 <p>I create a modaliases file with entries like the following,
716 containing package name, kernel module name (if relevant, otherwise
717 the package name) and globs matching the relevant hardware
718 modalias.</p>
719
720 <p><blockquote>
721 Package: package-name
722 <br>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)</p>
723 </blockquote></p>
724
725 <p>It is fairly trivial to write code to find the relevant packages
726 for a given modalias value using this file.</p>
727
728 <p>An entry like this would suggest the video and picture application
729 cheese for many USB web cameras (interface bus class 0E01):</p>
730
731 <p><blockquote>
732 Package: cheese
733 <br>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)</p>
734 </blockquote></p>
735
736 <p>An entry like this would suggest the pcmciautils package when a
737 CardBus bridge (bus class 0607) PCI device is present:</p>
738
739 <p><blockquote>
740 Package: pcmciautils
741 <br>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
742 </blockquote></p>
743
744 <p>An entry like this would suggest the package colorhug-client when
745 plugging in a ColorHug with USB IDs 04D8:F8DA:</p>
746
747 <p><blockquote>
748 Package: colorhug-client
749 <br>Modaliases: colorhug-client(usb:v04D8pF8DAd*)</p>
750 </blockquote></p>
751
752 <p>I believe the format is compatible with the format of the Packages
753 file in the Debian archive. Ubuntu already uses their Packages file
754 to store their mappings from packages to hardware.</p>
755
756 <p>By adding a XB-Modaliases: header in debian/control, any .deb can
757 announce the hardware it support in a way my prototype understand.
758 This allow those publishing packages in an APT source outside the
759 Debian archive as well as those backporting packages to make sure the
760 hardware mapping are included in the package meta information. I've
761 tested such header in the pymissile package, and its modalias mapping
762 is working as it should with my prototype. It even made it to Ubuntu
763 Raring.</p>
764
765 <p>To test if it was possible to look up supported hardware using only
766 the shell tools available in the Debian installer, I wrote a shell
767 implementation of the lookup code. The idea is to create files for
768 each modalias and let the shell do the matching. Please check out and
769 try the
770 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co">hw-support-lookup</a>
771 shell script. It run without any extra dependencies and fetch the
772 hardware mappings from the Debian archive and the subversion
773 repository where I currently work on my prototype.</p>
774
775 <p>When I use it on a machine with a yubikey inserted, it suggest to
776 install yubikey-personalization:</p>
777
778 <p><blockquote>
779 % ./hw-support-lookup
780 <br>yubikey-personalization
781 <br>%
782 </blockquote></p>
783
784 <p>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
785 propose to install the pcmciautils package:</p>
786
787 <p><blockquote>
788 % ./hw-support-lookup
789 <br>pcmciautils
790 <br>%
791 </blockquote></p>
792
793 <p>If you know of any hardware-package mapping that should be added to
794 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co">my
795 database</a>, please tell me about it.</p>
796
797 <p>It could be possible to generate several of the mappings between
798 packages and hardware. One source would be to look at packages with
799 kernel modules, ie packages with *.ko files in /lib/modules/, and
800 extract their modalias information. Another would be to look at
801 packages with udev rules, ie packages with files in
802 /lib/udev/rules.d/, and extract their vendor/model information to
803 generate a modalias matching rule. I have not tested any of these to
804 see if it work.</p>
805
806 <p>If you want to help implementing a system to let us propose what
807 packages to install when new hardware is plugged into a Debian
808 machine, please send me an email or talk to me on
809 <a href="irc://irc.debian.org/%23debian-devel">#debian-devel</a>.</p>
810
811 </div>
812 <div class="tags">
813
814
815 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
816
817
818 </div>
819 </div>
820 <div class="padding"></div>
821
822 <div class="entry">
823 <div class="title">
824 <a href="http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">Modalias strings - a practical way to map "stuff" to hardware</a>
825 </div>
826 <div class="date">
827 14th January 2013
828 </div>
829 <div class="body">
830 <p>While looking into how to look up Debian packages based on hardware
831 information, to find the packages that support a given piece of
832 hardware, I refreshed my memory regarding modalias values, and decided
833 to document the details. Here are my findings so far, also available
834 in
835 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
836 Debian Edu subversion repository</a>:
837
838 <p><strong>Modalias decoded</strong></p>
839
840 <p>This document try to explain what the different types of modalias
841 values stands for. It is in part based on information from
842 &lt;URL: <a href="https://wiki.archlinux.org/index.php/Modalias">https://wiki.archlinux.org/index.php/Modalias</a> &gt;,
843 &lt;URL: <a href="http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device">http://unix.stackexchange.com/questions/26132/how-to-assign-usb-driver-to-device</a> &gt;,
844 &lt;URL: <a href="http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c">http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c</a> &gt; and
845 &lt;URL: <a href="http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&view=markup">http://cvs.savannah.gnu.org/viewvc/dmidecode/dmidecode.c?root=dmidecode&view=markup</a> &gt;.
846
847 <p>The modalias entries for a given Linux machine can be found using
848 this shell script:</p>
849
850 <pre>
851 find /sys -name modalias -print0 | xargs -0 cat | sort -u
852 </pre>
853
854 <p>The supported modalias globs for a given kernel module can be found
855 using modinfo:</p>
856
857 <pre>
858 % /sbin/modinfo psmouse | grep alias:
859 alias: serio:ty05pr*id*ex*
860 alias: serio:ty01pr*id*ex*
861 %
862 </pre>
863
864 <p><strong>PCI subtype</strong></p>
865
866 <p>A typical PCI entry can look like this. This is an Intel Host
867 Bridge memory controller:</p>
868
869 <p><blockquote>
870 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
871 </blockquote></p>
872
873 <p>This represent these values:</p>
874
875 <pre>
876 v 00008086 (vendor)
877 d 00002770 (device)
878 sv 00001028 (subvendor)
879 sd 000001AD (subdevice)
880 bc 06 (bus class)
881 sc 00 (bus subclass)
882 i 00 (interface)
883 </pre>
884
885 <p>The vendor/device values are the same values outputted from 'lspci
886 -n' as 8086:2770. The bus class/subclass is also shown by lspci as
887 0600. The 0600 class is a host bridge. Other useful bus values are
888 0300 (VGA compatible card) and 0200 (Ethernet controller).</p>
889
890 <p>Not sure how to figure out the interface value, nor what it
891 means.</p>
892
893 <p><strong>USB subtype</strong></p>
894
895 <p>Some typical USB entries can look like this. This is an internal
896 USB hub in a laptop:</p>
897
898 <p><blockquote>
899 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
900 </blockquote></p>
901
902 <p>Here is the values included in this alias:</p>
903
904 <pre>
905 v 1D6B (device vendor)
906 p 0001 (device product)
907 d 0206 (bcddevice)
908 dc 09 (device class)
909 dsc 00 (device subclass)
910 dp 00 (device protocol)
911 ic 09 (interface class)
912 isc 00 (interface subclass)
913 ip 00 (interface protocol)
914 </pre>
915
916 <p>The 0900 device class/subclass means hub. Some times the relevant
917 class is in the interface class section. For a simple USB web camera,
918 these alias entries show up:</p>
919
920 <p><blockquote>
921 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
922 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
923 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
924 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
925 </blockquote></p>
926
927 <p>Interface class 0E01 is video control, 0E02 is video streaming (aka
928 camera), 0101 is audio control device and 0102 is audio streaming (aka
929 microphone). Thus this is a camera with microphone included.</p>
930
931 <p><strong>ACPI subtype</strong></p>
932
933 <p>The ACPI type is used for several non-PCI/USB stuff. This is an IR
934 receiver in a Thinkpad X40:</p>
935
936 <p><blockquote>
937 acpi:IBM0071:PNP0511:
938 </blockquote></p>
939
940 <p>The values between the colons are IDs.</p>
941
942 <p><strong>DMI subtype</strong></p>
943
944 <p>The DMI table contain lots of information about the computer case
945 and model. This is an entry for a IBM Thinkpad X40, fetched from
946 /sys/devices/virtual/dmi/id/modalias:</p>
947
948 <p><blockquote>
949 dmi:bvnIBM:bvr1UETB6WW(1.66):bd06/15/2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
950 </blockquote></p>
951
952 <p>The values present are</p>
953
954 <pre>
955 bvn IBM (BIOS vendor)
956 bvr 1UETB6WW(1.66) (BIOS version)
957 bd 06/15/2005 (BIOS date)
958 svn IBM (system vendor)
959 pn 2371H4G (product name)
960 pvr ThinkPadX40 (product version)
961 rvn IBM (board vendor)
962 rn 2371H4G (board name)
963 rvr NotAvailable (board version)
964 cvn IBM (chassis vendor)
965 ct 10 (chassis type)
966 cvr NotAvailable (chassis version)
967 </pre>
968
969 <p>The chassis type 10 is Notebook. Other interesting values can be
970 found in the dmidecode source:</p>
971
972 <pre>
973 3 Desktop
974 4 Low Profile Desktop
975 5 Pizza Box
976 6 Mini Tower
977 7 Tower
978 8 Portable
979 9 Laptop
980 10 Notebook
981 11 Hand Held
982 12 Docking Station
983 13 All In One
984 14 Sub Notebook
985 15 Space-saving
986 16 Lunch Box
987 17 Main Server Chassis
988 18 Expansion Chassis
989 19 Sub Chassis
990 20 Bus Expansion Chassis
991 21 Peripheral Chassis
992 22 RAID Chassis
993 23 Rack Mount Chassis
994 24 Sealed-case PC
995 25 Multi-system
996 26 CompactPCI
997 27 AdvancedTCA
998 28 Blade
999 29 Blade Enclosing
1000 </pre>
1001
1002 <p>The chassis type values are not always accurately set in the DMI
1003 table. For example my home server is a tower, but the DMI modalias
1004 claim it is a desktop.</p>
1005
1006 <p><strong>SerIO subtype</strong></p>
1007
1008 <p>This type is used for PS/2 mouse plugs. One example is from my
1009 test machine:</p>
1010
1011 <p><blockquote>
1012 serio:ty01pr00id00ex00
1013 </blockquote></p>
1014
1015 <p>The values present are</p>
1016
1017 <pre>
1018 ty 01 (type)
1019 pr 00 (prototype)
1020 id 00 (id)
1021 ex 00 (extra)
1022 </pre>
1023
1024 <p>This type is supported by the psmouse driver. I am not sure what
1025 the valid values are.</p>
1026
1027 <p><strong>Other subtypes</strong></p>
1028
1029 <p>There are heaps of other modalias subtypes according to
1030 file2alias.c. There is the rest of the list from that source: amba,
1031 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
1032 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
1033 vmbus, x86cpu and zorro. I did not spend time documenting all of
1034 these, as they do not seem relevant for my intended use with mapping
1035 hardware to packages when new stuff is inserted during run time.</p>
1036
1037 <p><strong>Looking up kernel modules using modalias values</strong></p>
1038
1039 <p>To check which kernel modules provide support for a given modalias,
1040 one can use the following shell script:</p>
1041
1042 <pre>
1043 for id in $(find /sys -name modalias -print0 | xargs -0 cat | sort -u); do \
1044 echo "$id" ; \
1045 /sbin/modprobe --show-depends "$id"|sed 's/^/ /' ; \
1046 done
1047 </pre>
1048
1049 <p>The output can look like this (only the first few entries as the
1050 list is very long on my test machine):</p>
1051
1052 <pre>
1053 acpi:ACPI0003:
1054 insmod /lib/modules/2.6.32-5-686/kernel/drivers/acpi/ac.ko
1055 acpi:device:
1056 FATAL: Module acpi:device: not found.
1057 acpi:IBM0068:
1058 insmod /lib/modules/2.6.32-5-686/kernel/drivers/char/nvram.ko
1059 insmod /lib/modules/2.6.32-5-686/kernel/drivers/leds/led-class.ko
1060 insmod /lib/modules/2.6.32-5-686/kernel/net/rfkill/rfkill.ko
1061 insmod /lib/modules/2.6.32-5-686/kernel/drivers/platform/x86/thinkpad_acpi.ko
1062 acpi:IBM0071:PNP0511:
1063 insmod /lib/modules/2.6.32-5-686/kernel/lib/crc-ccitt.ko
1064 insmod /lib/modules/2.6.32-5-686/kernel/net/irda/irda.ko
1065 insmod /lib/modules/2.6.32-5-686/kernel/drivers/net/irda/nsc-ircc.ko
1066 [...]
1067 </pre>
1068
1069 <p>If you want to help implementing a system to let us propose what
1070 packages to install when new hardware is plugged into a Debian
1071 machine, please send me an email or talk to me on
1072 <a href="irc://irc.debian.org/%23debian-devel">#debian-devel</a>.</p>
1073
1074 <p><strong>Update 2013-01-15:</strong> Rewrite "cat $(find ...)" to
1075 "find ... -print0 | xargs -0 cat" to make sure it handle directories
1076 in /sys/ with space in them.</p>
1077
1078 </div>
1079 <div class="tags">
1080
1081
1082 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
1083
1084
1085 </div>
1086 </div>
1087 <div class="padding"></div>
1088
1089 <div class="entry">
1090 <div class="title">
1091 <a href="http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html">Moved the pymissile Debian packaging to collab-maint</a>
1092 </div>
1093 <div class="date">
1094 10th January 2013
1095 </div>
1096 <div class="body">
1097 <p>As part of my investigation on how to improve the support in Debian
1098 for hardware dongles, I dug up my old Mark and Spencer USB Rocket
1099 Launcher and updated the Debian package
1100 <a href="http://packages.qa.debian.org/pymissile">pymissile</a> to make
1101 sure udev will fix the device permissions when it is plugged in. I
1102 also added a "Modaliases" header to test it in the Debian archive and
1103 hopefully make the package be proposed by jockey in Ubuntu when a user
1104 plug in his rocket launcher. In the process I moved the source to a
1105 git repository under collab-maint, to make it easier for any DD to
1106 contribute. <a href="http://code.google.com/p/pymissile/">Upstream</a>
1107 is not very active, but the software still work for me even after five
1108 years of relative silence. The new git repository is not listed in
1109 the uploaded package yet, because I want to test the other changes a
1110 bit more before I upload the new version. If you want to check out
1111 the new version with a .desktop file included, visit the
1112 <a href="http://anonscm.debian.org/gitweb/?p=collab-maint/pymissile.git">gitweb
1113 view</a> or use "<tt>git clone
1114 git://anonscm.debian.org/collab-maint/pymissile.git</tt>".</p>
1115
1116 </div>
1117 <div class="tags">
1118
1119
1120 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>, <a href="http://people.skolelinux.org/pere/blog/tags/robot">robot</a>.
1121
1122
1123 </div>
1124 </div>
1125 <div class="padding"></div>
1126
1127 <div class="entry">
1128 <div class="title">
1129 <a href="http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">Lets make hardware dongles easier to use in Debian</a>
1130 </div>
1131 <div class="date">
1132 9th January 2013
1133 </div>
1134 <div class="body">
1135 <p>One thing that annoys me with Debian and Linux distributions in
1136 general, is that there is a great package management system with the
1137 ability to automatically install software packages by downloading them
1138 from the distribution mirrors, but no way to get it to automatically
1139 install the packages I need to use the hardware I plug into my
1140 machine. Even if the package to use it is easily available from the
1141 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
1142 suggest to automatically install the python-nxt, nbc and t2n packages
1143 I need to talk to it. When I plug in a Yubikey, it could propose the
1144 yubikey-personalization package. The information required to do this
1145 is available, but no-one have pulled all the pieces together.</p>
1146
1147 <p>Some years ago, I proposed to
1148 <a href="http://lists.debian.org/debian-devel/2010/05/msg01206.html">use
1149 the discover subsystem to implement this</a>. The idea is fairly
1150 simple:
1151
1152 <ul>
1153
1154 <li>Add a desktop entry in /usr/share/autostart/ pointing to a program
1155 starting when a user log in.</li>
1156
1157 <li>Set this program up to listen for kernel events emitted when new
1158 hardware is inserted into the computer.</li>
1159
1160 <li>When new hardware is inserted, look up the hardware ID in a
1161 database mapping to packages, and take note of any non-installed
1162 packages.</li>
1163
1164 <li>Show a message to the user proposing to install the discovered
1165 package, and make it easy to install it.</li>
1166
1167 </ul>
1168
1169 <p>I am not sure what the best way to implement this is, but my
1170 initial idea was to use dbus events to discover new hardware, the
1171 discover database to find packages and
1172 <a href="http://www.packagekit.org/">PackageKit</a> to install
1173 packages.</p>
1174
1175 <p>Yesterday, I found time to try to implement this idea, and the
1176 draft package is now checked into
1177 <a href="http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
1178 Debian Edu subversion repository</a>. In the process, I updated the
1179 <a href="http://packages.qa.debian.org/d/discover-data.html">discover-data</a>
1180 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
1181 the relevant packages in Debian, and uploaded a new version
1182 2.2013.01.09 to unstable. I also discovered that the current
1183 <a href="http://packages.qa.debian.org/d/discover.html">discover</a>
1184 package in Debian no longer discovered any USB devices, because
1185 /proc/bus/usb/devices is no longer present. I ported it to use
1186 libusb as a fall back option to get it working. The fixed package
1187 version 2.1.2-6 is now in experimental (didn't upload it to unstable
1188 because of the freeze).</p>
1189
1190 <p>With this prototype in place, I can insert my Yubikey, and get this
1191 desktop notification to show up (only once, the first time it is
1192 inserted):</p>
1193
1194 <p align="center"><img src="http://people.skolelinux.org/pere/blog/images/2013-01-09-hw-autoinstall.png"></p>
1195
1196 <p>For this prototype to be really useful, some way to automatically
1197 install the proposed packages by pressing the "Please install
1198 program(s)" button should to be implemented.</p>
1199
1200 <p>If this idea seem useful to you, and you want to help make it
1201 happen, please help me update the discover-data database with mappings
1202 from hardware to Debian packages. Check if 'discover-pkginstall -l'
1203 list the package you would like to have installed when a given
1204 hardware device is inserted into your computer, and report bugs using
1205 reportbug if it isn't. Or, if you know of a better way to provide
1206 such mapping, please let me know.</p>
1207
1208 <p>This prototype need more work, and there are several questions that
1209 should be considered before it is ready for production use. Is dbus
1210 the correct way to detect new hardware? At the moment I look for HAL
1211 dbus events on the system bus, because that is the events I could see
1212 on my Debian Squeeze KDE desktop. Are there better events to use?
1213 How should the user be notified? Is the desktop notification
1214 mechanism the best option, or should the background daemon raise a
1215 popup instead? How should packages be installed? When should they
1216 not be installed?</p>
1217
1218 <p>If you want to help getting such feature implemented in Debian,
1219 please send me an email. :)</p>
1220
1221 </div>
1222 <div class="tags">
1223
1224
1225 Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram</a>.
1226
1227
1228 </div>
1229 </div>
1230 <div class="padding"></div>
1231
1232 <p style="text-align: right;"><a href="isenkram.rss"><img src="http://people.skolelinux.org/pere/blog/xml.gif" alt="RSS Feed" width="36" height="14" /></a></p>
1233 <div id="sidebar">
1234
1235
1236
1237 <h2>Archive</h2>
1238 <ul>
1239
1240 <li>2016
1241 <ul>
1242
1243 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/01/">January (3)</a></li>
1244
1245 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/02/">February (2)</a></li>
1246
1247 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/03/">March (3)</a></li>
1248
1249 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/04/">April (8)</a></li>
1250
1251 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/05/">May (8)</a></li>
1252
1253 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/06/">June (2)</a></li>
1254
1255 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/07/">July (2)</a></li>
1256
1257 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/08/">August (5)</a></li>
1258
1259 <li><a href="http://people.skolelinux.org/pere/blog/archive/2016/09/">September (1)</a></li>
1260
1261 </ul></li>
1262
1263 <li>2015
1264 <ul>
1265
1266 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/01/">January (7)</a></li>
1267
1268 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/02/">February (6)</a></li>
1269
1270 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/03/">March (1)</a></li>
1271
1272 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/04/">April (4)</a></li>
1273
1274 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/05/">May (3)</a></li>
1275
1276 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/06/">June (4)</a></li>
1277
1278 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/07/">July (6)</a></li>
1279
1280 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/08/">August (2)</a></li>
1281
1282 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/09/">September (2)</a></li>
1283
1284 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/10/">October (9)</a></li>
1285
1286 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/11/">November (6)</a></li>
1287
1288 <li><a href="http://people.skolelinux.org/pere/blog/archive/2015/12/">December (3)</a></li>
1289
1290 </ul></li>
1291
1292 <li>2014
1293 <ul>
1294
1295 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/01/">January (2)</a></li>
1296
1297 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/02/">February (3)</a></li>
1298
1299 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/03/">March (8)</a></li>
1300
1301 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/04/">April (7)</a></li>
1302
1303 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/05/">May (1)</a></li>
1304
1305 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/06/">June (2)</a></li>
1306
1307 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/07/">July (2)</a></li>
1308
1309 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/08/">August (2)</a></li>
1310
1311 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/09/">September (5)</a></li>
1312
1313 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/10/">October (6)</a></li>
1314
1315 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/11/">November (3)</a></li>
1316
1317 <li><a href="http://people.skolelinux.org/pere/blog/archive/2014/12/">December (5)</a></li>
1318
1319 </ul></li>
1320
1321 <li>2013
1322 <ul>
1323
1324 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/01/">January (11)</a></li>
1325
1326 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/02/">February (9)</a></li>
1327
1328 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/03/">March (9)</a></li>
1329
1330 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/04/">April (6)</a></li>
1331
1332 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/05/">May (9)</a></li>
1333
1334 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/06/">June (10)</a></li>
1335
1336 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/07/">July (7)</a></li>
1337
1338 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/08/">August (3)</a></li>
1339
1340 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/09/">September (5)</a></li>
1341
1342 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/10/">October (7)</a></li>
1343
1344 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/11/">November (9)</a></li>
1345
1346 <li><a href="http://people.skolelinux.org/pere/blog/archive/2013/12/">December (3)</a></li>
1347
1348 </ul></li>
1349
1350 <li>2012
1351 <ul>
1352
1353 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/01/">January (7)</a></li>
1354
1355 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/02/">February (10)</a></li>
1356
1357 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/03/">March (17)</a></li>
1358
1359 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/04/">April (12)</a></li>
1360
1361 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/05/">May (12)</a></li>
1362
1363 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/06/">June (20)</a></li>
1364
1365 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/07/">July (17)</a></li>
1366
1367 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/08/">August (6)</a></li>
1368
1369 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/09/">September (9)</a></li>
1370
1371 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/10/">October (17)</a></li>
1372
1373 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/11/">November (10)</a></li>
1374
1375 <li><a href="http://people.skolelinux.org/pere/blog/archive/2012/12/">December (7)</a></li>
1376
1377 </ul></li>
1378
1379 <li>2011
1380 <ul>
1381
1382 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/01/">January (16)</a></li>
1383
1384 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/02/">February (6)</a></li>
1385
1386 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/03/">March (6)</a></li>
1387
1388 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/04/">April (7)</a></li>
1389
1390 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/05/">May (3)</a></li>
1391
1392 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/06/">June (2)</a></li>
1393
1394 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/07/">July (7)</a></li>
1395
1396 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/08/">August (6)</a></li>
1397
1398 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/09/">September (4)</a></li>
1399
1400 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/10/">October (2)</a></li>
1401
1402 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/11/">November (3)</a></li>
1403
1404 <li><a href="http://people.skolelinux.org/pere/blog/archive/2011/12/">December (1)</a></li>
1405
1406 </ul></li>
1407
1408 <li>2010
1409 <ul>
1410
1411 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/01/">January (2)</a></li>
1412
1413 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/02/">February (1)</a></li>
1414
1415 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/03/">March (3)</a></li>
1416
1417 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/04/">April (3)</a></li>
1418
1419 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/05/">May (9)</a></li>
1420
1421 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/06/">June (14)</a></li>
1422
1423 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/07/">July (12)</a></li>
1424
1425 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/08/">August (13)</a></li>
1426
1427 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/09/">September (7)</a></li>
1428
1429 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/10/">October (9)</a></li>
1430
1431 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/11/">November (13)</a></li>
1432
1433 <li><a href="http://people.skolelinux.org/pere/blog/archive/2010/12/">December (12)</a></li>
1434
1435 </ul></li>
1436
1437 <li>2009
1438 <ul>
1439
1440 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/01/">January (8)</a></li>
1441
1442 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/02/">February (8)</a></li>
1443
1444 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/03/">March (12)</a></li>
1445
1446 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/04/">April (10)</a></li>
1447
1448 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/05/">May (9)</a></li>
1449
1450 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/06/">June (3)</a></li>
1451
1452 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/07/">July (4)</a></li>
1453
1454 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/08/">August (3)</a></li>
1455
1456 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/09/">September (1)</a></li>
1457
1458 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/10/">October (2)</a></li>
1459
1460 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/11/">November (3)</a></li>
1461
1462 <li><a href="http://people.skolelinux.org/pere/blog/archive/2009/12/">December (3)</a></li>
1463
1464 </ul></li>
1465
1466 <li>2008
1467 <ul>
1468
1469 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/11/">November (5)</a></li>
1470
1471 <li><a href="http://people.skolelinux.org/pere/blog/archive/2008/12/">December (7)</a></li>
1472
1473 </ul></li>
1474
1475 </ul>
1476
1477
1478
1479 <h2>Tags</h2>
1480 <ul>
1481
1482 <li><a href="http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (13)</a></li>
1483
1484 <li><a href="http://people.skolelinux.org/pere/blog/tags/amiga">amiga (1)</a></li>
1485
1486 <li><a href="http://people.skolelinux.org/pere/blog/tags/aros">aros (1)</a></li>
1487
1488 <li><a href="http://people.skolelinux.org/pere/blog/tags/bankid">bankid (4)</a></li>
1489
1490 <li><a href="http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin (9)</a></li>
1491
1492 <li><a href="http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (16)</a></li>
1493
1494 <li><a href="http://people.skolelinux.org/pere/blog/tags/bsa">bsa (2)</a></li>
1495
1496 <li><a href="http://people.skolelinux.org/pere/blog/tags/chrpath">chrpath (2)</a></li>
1497
1498 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (135)</a></li>
1499
1500 <li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (157)</a></li>
1501
1502 <li><a href="http://people.skolelinux.org/pere/blog/tags/digistan">digistan (10)</a></li>
1503
1504 <li><a href="http://people.skolelinux.org/pere/blog/tags/dld">dld (15)</a></li>
1505
1506 <li><a href="http://people.skolelinux.org/pere/blog/tags/docbook">docbook (23)</a></li>
1507
1508 <li><a href="http://people.skolelinux.org/pere/blog/tags/drivstoffpriser">drivstoffpriser (4)</a></li>
1509
1510 <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (327)</a></li>
1511
1512 <li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (23)</a></li>
1513
1514 <li><a href="http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (12)</a></li>
1515
1516 <li><a href="http://people.skolelinux.org/pere/blog/tags/freeculture">freeculture (28)</a></li>
1517
1518 <li><a href="http://people.skolelinux.org/pere/blog/tags/freedombox">freedombox (9)</a></li>
1519
1520 <li><a href="http://people.skolelinux.org/pere/blog/tags/frikanalen">frikanalen (18)</a></li>
1521
1522 <li><a href="http://people.skolelinux.org/pere/blog/tags/h264">h264 (20)</a></li>
1523
1524 <li><a href="http://people.skolelinux.org/pere/blog/tags/intervju">intervju (42)</a></li>
1525
1526 <li><a href="http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram (12)</a></li>
1527
1528 <li><a href="http://people.skolelinux.org/pere/blog/tags/kart">kart (19)</a></li>
1529
1530 <li><a href="http://people.skolelinux.org/pere/blog/tags/ldap">ldap (9)</a></li>
1531
1532 <li><a href="http://people.skolelinux.org/pere/blog/tags/lenker">lenker (8)</a></li>
1533
1534 <li><a href="http://people.skolelinux.org/pere/blog/tags/lsdvd">lsdvd (2)</a></li>
1535
1536 <li><a href="http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (1)</a></li>
1537
1538 <li><a href="http://people.skolelinux.org/pere/blog/tags/mesh network">mesh network (8)</a></li>
1539
1540 <li><a href="http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (39)</a></li>
1541
1542 <li><a href="http://people.skolelinux.org/pere/blog/tags/nice free software">nice free software (8)</a></li>
1543
1544 <li><a href="http://people.skolelinux.org/pere/blog/tags/norsk">norsk (277)</a></li>
1545
1546 <li><a href="http://people.skolelinux.org/pere/blog/tags/nuug">nuug (182)</a></li>
1547
1548 <li><a href="http://people.skolelinux.org/pere/blog/tags/offentlig innsyn">offentlig innsyn (26)</a></li>
1549
1550 <li><a href="http://people.skolelinux.org/pere/blog/tags/open311">open311 (2)</a></li>
1551
1552 <li><a href="http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (61)</a></li>
1553
1554 <li><a href="http://people.skolelinux.org/pere/blog/tags/personvern">personvern (92)</a></li>
1555
1556 <li><a href="http://people.skolelinux.org/pere/blog/tags/raid">raid (1)</a></li>
1557
1558 <li><a href="http://people.skolelinux.org/pere/blog/tags/reactos">reactos (1)</a></li>
1559
1560 <li><a href="http://people.skolelinux.org/pere/blog/tags/reprap">reprap (11)</a></li>
1561
1562 <li><a href="http://people.skolelinux.org/pere/blog/tags/rfid">rfid (3)</a></li>
1563
1564 <li><a href="http://people.skolelinux.org/pere/blog/tags/robot">robot (9)</a></li>
1565
1566 <li><a href="http://people.skolelinux.org/pere/blog/tags/rss">rss (1)</a></li>
1567
1568 <li><a href="http://people.skolelinux.org/pere/blog/tags/ruter">ruter (4)</a></li>
1569
1570 <li><a href="http://people.skolelinux.org/pere/blog/tags/scraperwiki">scraperwiki (2)</a></li>
1571
1572 <li><a href="http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (48)</a></li>
1573
1574 <li><a href="http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (4)</a></li>
1575
1576 <li><a href="http://people.skolelinux.org/pere/blog/tags/skepsis">skepsis (5)</a></li>
1577
1578 <li><a href="http://people.skolelinux.org/pere/blog/tags/standard">standard (49)</a></li>
1579
1580 <li><a href="http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (4)</a></li>
1581
1582 <li><a href="http://people.skolelinux.org/pere/blog/tags/stortinget">stortinget (10)</a></li>
1583
1584 <li><a href="http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance (38)</a></li>
1585
1586 <li><a href="http://people.skolelinux.org/pere/blog/tags/sysadmin">sysadmin (2)</a></li>
1587
1588 <li><a href="http://people.skolelinux.org/pere/blog/tags/usenix">usenix (2)</a></li>
1589
1590 <li><a href="http://people.skolelinux.org/pere/blog/tags/valg">valg (8)</a></li>
1591
1592 <li><a href="http://people.skolelinux.org/pere/blog/tags/video">video (59)</a></li>
1593
1594 <li><a href="http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (4)</a></li>
1595
1596 <li><a href="http://people.skolelinux.org/pere/blog/tags/web">web (38)</a></li>
1597
1598 </ul>
1599
1600
1601 </div>
1602 <p style="text-align: right">
1603 Created by <a href="http://steve.org.uk/Software/chronicle">Chronicle v4.6</a>
1604 </p>
1605
1606 </body>
1607 </html>