1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" dir=
"ltr">
5 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8" />
6 <title>Petter Reinholdtsen: 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" />
14 <a href=
"http://people.skolelinux.org/pere/blog/">Petter Reinholdtsen
</a>
21 <h3>Entries tagged "isenkram".
</h3>
25 <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>
31 <p>It annoys me when the computer fail to do automatically what it is
32 perfectly capable of, and I have to do it manually to get things
33 working. One such task is to find out what firmware packages are
34 needed to get the hardware on my computer working. Most often this
35 affect the wifi card, but some times it even affect the RAID
36 controller or the ethernet card. Today I pushed version
0.4 of the
37 <a href=
"http://packages.qa.debian.org/isenkram">Isenkram package
</a>
38 including a new script isenkram-autoinstall-firmware handling the
39 process of asking all the loaded kernel modules what firmware files
40 they want, find debian packages providing these files and install the
41 debian packages. Here is a test run on my laptop:
</p>
44 # isenkram-autoinstall-firmware
45 info: kernel drivers requested extra firmware: ipw2200-bss.fw ipw2200-ibss.fw ipw2200-sniffer.fw
46 info: fetching http://http.debian.net/debian/dists/squeeze/Contents-i386.gz
47 info: locating packages with the requested firmware files
48 info: Updating APT sources after adding non-free APT source
49 info: trying to install firmware-ipw2x00
52 Preconfiguring packages ...
53 Selecting previously deselected package firmware-ipw2x00.
54 (Reading database ...
259727 files and directories currently installed.)
55 Unpacking firmware-ipw2x00 (from .../firmware-ipw2x00_0.28+squeeze1_all.deb) ...
56 Setting up firmware-ipw2x00 (
0.28+squeeze1) ...
60 <p>When all the requested firmware is present, a simple message is
64 # isenkram-autoinstall-firmware
65 info: did not find any firmware files requested by loaded kernel modules. exiting
69 <p>It could use some polish, but it is already working well and saving
70 me some time when setting up new machines. :)
</p>
72 <p>So, how does it work? It look at the set of currently loaded
73 kernel modules, and look up each one of them using modinfo, to find
74 the firmware files listed in the module meta-information. Next, it
75 download the Contents file from a nearby APT mirror, and search for
76 the firmware files in this file to locate the package with the
77 requested firmware file. If the package is in the non-free section, a
78 non-free APT source is added and the package is installed using
79 <tt>apt-get install
</tt>. The end result is a slightly better working
82 <p>I hope someone find time to implement a more polished version of
83 this script as part of the hw-detect debian-installer module, to
84 finally fix
<a href=
"http://bugs.debian.org/655507">BTS report
85 #
655507</a>. There really is no need to insert USB sticks with
86 firmware during a PXE install when the packages already are available
87 from the nearby Debian mirror.
</p>
93 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>.
98 <div class=
"padding"></div>
102 <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>
108 <p>Today the
<a href=
"http://packages.qa.debian.org/isenkram">Isenkram
109 package
</a> finally made it into the archive, after lingering in NEW
110 for many months. I uploaded it to the Debian experimental suite
111 2013-
01-
27, and today it was accepted into the archive.
</p>
113 <p>Isenkram is a system for suggesting to users what packages to
114 install to work with a pluggable hardware device. The suggestion pop
115 up when the device is plugged in. For example if a Lego Mindstorm NXT
116 is inserted, it will suggest to install the program needed to program
117 the NXT controller. Give it a go, and report bugs and suggestions to
124 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>.
129 <div class=
"padding"></div>
133 <a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">Welcome to the world, Isenkram!
</a>
140 <a href=
"http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html">asked
141 for testers
</a> for my prototype for making Debian better at handling
142 pluggable hardware devices, which I
143 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">set
144 out to create
</a> earlier this month. Several valuable testers showed
145 up, and caused me to really want to to open up the development to more
146 people. But before I did this, I want to come up with a sensible name
147 for this project. Today I finally decided on a new name, and I have
148 renamed the project from hw-support-handler to this new name. In the
149 process, I moved the source to git and made it available as a
150 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git">collab-maint
</a>
151 repository in Debian. The new name? It is
<strong>Isenkram
</strong>.
152 To fetch and build the latest version of the source, use
</p>
155 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
156 cd isenkram && git-buildpackage -us -uc
159 <p>I have not yet adjusted all files to use the new name yet. If you
160 want to hack on the source or improve the package, please go ahead.
161 But please talk to me first on IRC or via email before you do major
162 changes, to make sure we do not step on each others toes. :)
</p>
164 <p>If you wonder what 'isenkram' is, it is a Norwegian word for iron
165 stuff, typically meaning tools, nails, screws, etc. Typical hardware
166 stuff, in other words. I've been told it is the Norwegian variant of
167 the German word eisenkram, for those that are familiar with that
170 <p><strong>Update
2013-
01-
26</strong>: Added -us -us to build
171 instructions, to avoid confusing people with an error from the signing
174 <p><strong>Update
2013-
01-
27</strong>: Switch to HTTP URL for the git
175 clone argument to avoid the need for authentication.
</p>
181 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>.
186 <div class=
"padding"></div>
190 <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>
196 <p>Early this month I set out to try to
197 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">improve
198 the Debian support for pluggable hardware devices
</a>. Now my
199 prototype is working, and it is ready for a larger audience. To test
201 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">source
202 from the Debian Edu subversion repository
</a>, build and install the
203 package. You might have to log out and in again activate the
204 autostart script.
</p>
206 <p>The design is simple:
</p>
210 <li>Add desktop entry in /usr/share/autostart/ causing a program
211 hw-support-handlerd to start when the user log in.
</li>
213 <li>This program listen for kernel events about new hardware (directly
214 from the kernel like udev does), not using HAL dbus events as I
217 <li>When new hardware is inserted, look up the hardware modalias in
218 the APT database, a database
219 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup">available
220 via HTTP
</a> and a database available as part of the package.
</li>
222 <li>If a package is mapped to the hardware in question, the package
223 isn't installed yet and this is the first time the hardware was
224 plugged in, show a desktop notification suggesting to install the
225 package or packages.
</li>
227 <li>If the user click on the 'install package now' button, ask
228 aptdaemon via the PackageKit API to install the requrired package.
</li>
230 <li>aptdaemon ask for root password or sudo password, and install the
231 package while showing progress information in a window.
</li>
235 <p>I still need to come up with a better name for the system. Here
236 are some screen shots showing the prototype in action. First the
237 notification, then the password request, and finally the request to
238 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.
</p>
240 <p><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-1-notification.png">
241 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-2-password.png">
242 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-3-dependencies.png">
243 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-4-installing.png">
244 <br><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-21-hw-support-5-installing-details.png" width=
"70%"></p>
246 <p>The prototype still need to be improved with longer timeouts, but
247 is already useful. The database of hardware to package mappings also
248 need more work. It is currently compatible with the Ubuntu way of
249 storing such information in the package control file, but could be
250 changed to use other formats instead or in addition to the current
251 method. I've dropped the use of discover for this mapping, as the
252 modalias approach is more flexible and easier to use on Linux as long
253 as the Linux kernel expose its modalias strings directly.
</p>
255 <p><strong>Update
2013-
01-
21 16:
50</strong>: Due to popular demand,
256 here is the command required to check out and build the source: Use
258 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
259 hw-support-handler; debuild
</tt>'. If you lack debuild, install the
260 devscripts package.
</p>
262 <p><strong>Update
2013-
01-
23 12:
00</strong>: The project is now
263 renamed to Isenkram and the source moved from the Debian Edu
264 subversion repository to a Debian collab-maint git repository. See
265 <a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html">build
266 instructions
</a> for details.
</p>
272 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>.
277 <div class=
"padding"></div>
281 <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>
287 <p>Yesterday, I wrote about the
288 <a href=
"http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html">modalias
289 values provided by the Linux kernel
</a> following my hope for
290 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html">better
291 dongle support in Debian
</a>. Using this knowledge, I have tested how
292 modalias values attached to package names can be used to map packages
293 to hardware. This allow the system to look up and suggest relevant
294 packages when I plug in some new hardware into my machine, and replace
295 discover and discover-data as the database used to map hardware to
298 <p>I create a modaliases file with entries like the following,
299 containing package name, kernel module name (if relevant, otherwise
300 the package name) and globs matching the relevant hardware
304 Package: package-name
305 <br>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)
</p>
308 <p>It is fairly trivial to write code to find the relevant packages
309 for a given modalias value using this file.
</p>
311 <p>An entry like this would suggest the video and picture application
312 cheese for many USB web cameras (interface bus class
0E01):
</p>
316 <br>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)
</p>
319 <p>An entry like this would suggest the pcmciautils package when a
320 CardBus bridge (bus class
0607) PCI device is present:
</p>
324 <br>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
327 <p>An entry like this would suggest the package colorhug-client when
328 plugging in a ColorHug with USB IDs
04D8:F8DA:
</p>
331 Package: colorhug-client
332 <br>Modaliases: colorhug-client(usb:v04D8pF8DAd*)
</p>
335 <p>I believe the format is compatible with the format of the Packages
336 file in the Debian archive. Ubuntu already uses their Packages file
337 to store their mappings from packages to hardware.
</p>
339 <p>By adding a XB-Modaliases: header in debian/control, any .deb can
340 announce the hardware it support in a way my prototype understand.
341 This allow those publishing packages in an APT source outside the
342 Debian archive as well as those backporting packages to make sure the
343 hardware mapping are included in the package meta information. I've
344 tested such header in the pymissile package, and its modalias mapping
345 is working as it should with my prototype. It even made it to Ubuntu
348 <p>To test if it was possible to look up supported hardware using only
349 the shell tools available in the Debian installer, I wrote a shell
350 implementation of the lookup code. The idea is to create files for
351 each modalias and let the shell do the matching. Please check out and
353 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co">hw-support-lookup
</a>
354 shell script. It run without any extra dependencies and fetch the
355 hardware mappings from the Debian archive and the subversion
356 repository where I currently work on my prototype.
</p>
358 <p>When I use it on a machine with a yubikey inserted, it suggest to
359 install yubikey-personalization:
</p>
362 % ./hw-support-lookup
363 <br>yubikey-personalization
367 <p>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
368 propose to install the pcmciautils package:
</p>
371 % ./hw-support-lookup
376 <p>If you know of any hardware-package mapping that should be added to
377 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co">my
378 database
</a>, please tell me about it.
</p>
380 <p>It could be possible to generate several of the mappings between
381 packages and hardware. One source would be to look at packages with
382 kernel modules, ie packages with *.ko files in /lib/modules/, and
383 extract their modalias information. Another would be to look at
384 packages with udev rules, ie packages with files in
385 /lib/udev/rules.d/, and extract their vendor/model information to
386 generate a modalias matching rule. I have not tested any of these to
389 <p>If you want to help implementing a system to let us propose what
390 packages to install when new hardware is plugged into a Debian
391 machine, please send me an email or talk to me on
392 <a href=
"irc://irc.debian.org/%23debian-devel">#debian-devel
</a>.
</p>
398 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>.
403 <div class=
"padding"></div>
407 <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>
413 <p>While looking into how to look up Debian packages based on hardware
414 information, to find the packages that support a given piece of
415 hardware, I refreshed my memory regarding modalias values, and decided
416 to document the details. Here are my findings so far, also available
418 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
419 Debian Edu subversion repository
</a>:
421 <p><strong>Modalias decoded
</strong></p>
423 <p>This document try to explain what the different types of modalias
424 values stands for. It is in part based on information from
425 <URL:
<a href=
"https://wiki.archlinux.org/index.php/Modalias">https://wiki.archlinux.org/index.php/Modalias
</a> >,
426 <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> >,
427 <URL:
<a href=
"http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c">http://code.metager.de/source/history/linux/stable/scripts/mod/file2alias.c
</a> > and
428 <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> >.
430 <p>The modalias entries for a given Linux machine can be found using
431 this shell script:
</p>
434 find /sys -name modalias -print0 | xargs -
0 cat | sort -u
437 <p>The supported modalias globs for a given kernel module can be found
441 % /sbin/modinfo psmouse | grep alias:
442 alias: serio:ty05pr*id*ex*
443 alias: serio:ty01pr*id*ex*
447 <p><strong>PCI subtype
</strong></p>
449 <p>A typical PCI entry can look like this. This is an Intel Host
450 Bridge memory controller:
</p>
453 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
456 <p>This represent these values:
</p>
461 sv
00001028 (subvendor)
462 sd
000001AD (subdevice)
468 <p>The vendor/device values are the same values outputted from 'lspci
469 -n' as
8086:
2770. The bus class/subclass is also shown by lspci as
470 0600. The
0600 class is a host bridge. Other useful bus values are
471 0300 (VGA compatible card) and
0200 (Ethernet controller).
</p>
473 <p>Not sure how to figure out the interface value, nor what it
476 <p><strong>USB subtype
</strong></p>
478 <p>Some typical USB entries can look like this. This is an internal
479 USB hub in a laptop:
</p>
482 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
485 <p>Here is the values included in this alias:
</p>
488 v
1D6B (device vendor)
489 p
0001 (device product)
492 dsc
00 (device subclass)
493 dp
00 (device protocol)
494 ic
09 (interface class)
495 isc
00 (interface subclass)
496 ip
00 (interface protocol)
499 <p>The
0900 device class/subclass means hub. Some times the relevant
500 class is in the interface class section. For a simple USB web camera,
501 these alias entries show up:
</p>
504 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
505 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
506 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
507 <br>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
510 <p>Interface class
0E01 is video control,
0E02 is video streaming (aka
511 camera),
0101 is audio control device and
0102 is audio streaming (aka
512 microphone). Thus this is a camera with microphone included.
</p>
514 <p><strong>ACPI subtype
</strong></p>
516 <p>The ACPI type is used for several non-PCI/USB stuff. This is an IR
517 receiver in a Thinkpad X40:
</p>
520 acpi:IBM0071:PNP0511:
523 <p>The values between the colons are IDs.
</p>
525 <p><strong>DMI subtype
</strong></p>
527 <p>The DMI table contain lots of information about the computer case
528 and model. This is an entry for a IBM Thinkpad X40, fetched from
529 /sys/devices/virtual/dmi/id/modalias:
</p>
532 dmi:bvnIBM:bvr1UETB6WW(
1.66):bd06/
15/
2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
535 <p>The values present are
</p>
538 bvn IBM (BIOS vendor)
539 bvr
1UETB
6WW(
1.66) (BIOS version)
540 bd
06/
15/
2005 (BIOS date)
541 svn IBM (system vendor)
542 pn
2371H4G (product name)
543 pvr ThinkPadX40 (product version)
544 rvn IBM (board vendor)
545 rn
2371H4G (board name)
546 rvr NotAvailable (board version)
547 cvn IBM (chassis vendor)
549 cvr NotAvailable (chassis version)
552 <p>The chassis type
10 is Notebook. Other interesting values can be
553 found in the dmidecode source:
</p>
557 4 Low Profile Desktop
570 17 Main Server Chassis
573 20 Bus Expansion Chassis
574 21 Peripheral Chassis
576 23 Rack Mount Chassis
585 <p>The chassis type values are not always accurately set in the DMI
586 table. For example my home server is a tower, but the DMI modalias
587 claim it is a desktop.
</p>
589 <p><strong>SerIO subtype
</strong></p>
591 <p>This type is used for PS/
2 mouse plugs. One example is from my
595 serio:ty01pr00id00ex00
598 <p>The values present are
</p>
607 <p>This type is supported by the psmouse driver. I am not sure what
608 the valid values are.
</p>
610 <p><strong>Other subtypes
</strong></p>
612 <p>There are heaps of other modalias subtypes according to
613 file2alias.c. There is the rest of the list from that source: amba,
614 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
615 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
616 vmbus, x86cpu and zorro. I did not spend time documenting all of
617 these, as they do not seem relevant for my intended use with mapping
618 hardware to packages when new stuff is inserted during run time.
</p>
620 <p><strong>Looking up kernel modules using modalias values
</strong></p>
622 <p>To check which kernel modules provide support for a given modalias,
623 one can use the following shell script:
</p>
626 for id in $(find /sys -name modalias -print0 | xargs -
0 cat | sort -u); do \
628 /sbin/modprobe --show-depends "$id"|sed 's/^/ /' ; \
632 <p>The output can look like this (only the first few entries as the
633 list is very long on my test machine):
</p>
637 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/acpi/ac.ko
639 FATAL: Module acpi:device: not found.
641 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/char/nvram.ko
642 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/leds/led-class.ko
643 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/rfkill/rfkill.ko
644 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/platform/x86/thinkpad_acpi.ko
645 acpi:IBM0071:PNP0511:
646 insmod /lib/modules/
2.6.32-
5-
686/kernel/lib/crc-ccitt.ko
647 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/irda/irda.ko
648 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/net/irda/nsc-ircc.ko
652 <p>If you want to help implementing a system to let us propose what
653 packages to install when new hardware is plugged into a Debian
654 machine, please send me an email or talk to me on
655 <a href=
"irc://irc.debian.org/%23debian-devel">#debian-devel
</a>.
</p>
657 <p><strong>Update
2013-
01-
15:
</strong> Rewrite "cat $(find ...)" to
658 "find ... -print0 | xargs -
0 cat" to make sure it handle directories
659 in /sys/ with space in them.
</p>
665 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>.
670 <div class=
"padding"></div>
674 <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>
680 <p>One thing that annoys me with Debian and Linux distributions in
681 general, is that there is a great package management system with the
682 ability to automatically install software packages by downloading them
683 from the distribution mirrors, but no way to get it to automatically
684 install the packages I need to use the hardware I plug into my
685 machine. Even if the package to use it is easily available from the
686 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
687 suggest to automatically install the python-nxt, nbc and t2n packages
688 I need to talk to it. When I plug in a Yubikey, it could propose the
689 yubikey-personalization package. The information required to do this
690 is available, but no-one have pulled all the pieces together.
</p>
692 <p>Some years ago, I proposed to
693 <a href=
"http://lists.debian.org/debian-devel/2010/05/msg01206.html">use
694 the discover subsystem to implement this
</a>. The idea is fairly
699 <li>Add a desktop entry in /usr/share/autostart/ pointing to a program
700 starting when a user log in.
</li>
702 <li>Set this program up to listen for kernel events emitted when new
703 hardware is inserted into the computer.
</li>
705 <li>When new hardware is inserted, look up the hardware ID in a
706 database mapping to packages, and take note of any non-installed
709 <li>Show a message to the user proposing to install the discovered
710 package, and make it easy to install it.
</li>
714 <p>I am not sure what the best way to implement this is, but my
715 initial idea was to use dbus events to discover new hardware, the
716 discover database to find packages and
717 <a href=
"http://www.packagekit.org/">PackageKit
</a> to install
720 <p>Yesterday, I found time to try to implement this idea, and the
721 draft package is now checked into
722 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/">the
723 Debian Edu subversion repository
</a>. In the process, I updated the
724 <a href=
"http://packages.qa.debian.org/d/discover-data.html">discover-data
</a>
725 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
726 the relevant packages in Debian, and uploaded a new version
727 2.2013.01.09 to unstable. I also discovered that the current
728 <a href=
"http://packages.qa.debian.org/d/discover.html">discover
</a>
729 package in Debian no longer discovered any USB devices, because
730 /proc/bus/usb/devices is no longer present. I ported it to use
731 libusb as a fall back option to get it working. The fixed package
732 version
2.1.2-
6 is now in experimental (didn't upload it to unstable
733 because of the freeze).
</p>
735 <p>With this prototype in place, I can insert my Yubikey, and get this
736 desktop notification to show up (only once, the first time it is
739 <p align=
"center"><img src=
"http://people.skolelinux.org/pere/blog/images/2013-01-09-hw-autoinstall.png"></p>
741 <p>For this prototype to be really useful, some way to automatically
742 install the proposed packages by pressing the "Please install
743 program(s)" button should to be implemented.
</p>
745 <p>If this idea seem useful to you, and you want to help make it
746 happen, please help me update the discover-data database with mappings
747 from hardware to Debian packages. Check if 'discover-pkginstall -l'
748 list the package you would like to have installed when a given
749 hardware device is inserted into your computer, and report bugs using
750 reportbug if it isn't. Or, if you know of a better way to provide
751 such mapping, please let me know.
</p>
753 <p>This prototype need more work, and there are several questions that
754 should be considered before it is ready for production use. Is dbus
755 the correct way to detect new hardware? At the moment I look for HAL
756 dbus events on the system bus, because that is the events I could see
757 on my Debian Squeeze KDE desktop. Are there better events to use?
758 How should the user be notified? Is the desktop notification
759 mechanism the best option, or should the background daemon raise a
760 popup instead? How should packages be installed? When should they
761 not be installed?
</p>
763 <p>If you want to help getting such feature implemented in Debian,
764 please send me an email. :)
</p>
770 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>.
775 <div class=
"padding"></div>
777 <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>
788 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2014/01/">January (
2)
</a></li>
790 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2014/02/">February (
3)
</a></li>
792 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2014/03/">March (
8)
</a></li>
794 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2014/04/">April (
1)
</a></li>
801 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/01/">January (
11)
</a></li>
803 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/02/">February (
9)
</a></li>
805 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/03/">March (
9)
</a></li>
807 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/04/">April (
6)
</a></li>
809 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/05/">May (
9)
</a></li>
811 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/06/">June (
10)
</a></li>
813 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/07/">July (
7)
</a></li>
815 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/08/">August (
3)
</a></li>
817 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/09/">September (
5)
</a></li>
819 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/10/">October (
7)
</a></li>
821 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/11/">November (
9)
</a></li>
823 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2013/12/">December (
3)
</a></li>
830 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/01/">January (
7)
</a></li>
832 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/02/">February (
10)
</a></li>
834 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/03/">March (
17)
</a></li>
836 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/04/">April (
12)
</a></li>
838 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/05/">May (
12)
</a></li>
840 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/06/">June (
20)
</a></li>
842 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/07/">July (
17)
</a></li>
844 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/08/">August (
6)
</a></li>
846 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/09/">September (
9)
</a></li>
848 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/10/">October (
17)
</a></li>
850 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/11/">November (
10)
</a></li>
852 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2012/12/">December (
7)
</a></li>
859 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/01/">January (
16)
</a></li>
861 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/02/">February (
6)
</a></li>
863 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/03/">March (
6)
</a></li>
865 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/04/">April (
7)
</a></li>
867 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/05/">May (
3)
</a></li>
869 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/06/">June (
2)
</a></li>
871 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/07/">July (
7)
</a></li>
873 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/08/">August (
6)
</a></li>
875 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/09/">September (
4)
</a></li>
877 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/10/">October (
2)
</a></li>
879 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/11/">November (
3)
</a></li>
881 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2011/12/">December (
1)
</a></li>
888 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/01/">January (
2)
</a></li>
890 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/02/">February (
1)
</a></li>
892 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/03/">March (
3)
</a></li>
894 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/04/">April (
3)
</a></li>
896 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/05/">May (
9)
</a></li>
898 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/06/">June (
14)
</a></li>
900 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/07/">July (
12)
</a></li>
902 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/08/">August (
13)
</a></li>
904 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/09/">September (
7)
</a></li>
906 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/10/">October (
9)
</a></li>
908 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/11/">November (
13)
</a></li>
910 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2010/12/">December (
12)
</a></li>
917 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/01/">January (
8)
</a></li>
919 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/02/">February (
8)
</a></li>
921 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/03/">March (
12)
</a></li>
923 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/04/">April (
10)
</a></li>
925 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/05/">May (
9)
</a></li>
927 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/06/">June (
3)
</a></li>
929 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/07/">July (
4)
</a></li>
931 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/08/">August (
3)
</a></li>
933 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/09/">September (
1)
</a></li>
935 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/10/">October (
2)
</a></li>
937 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/11/">November (
3)
</a></li>
939 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2009/12/">December (
3)
</a></li>
946 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/11/">November (
5)
</a></li>
948 <li><a href=
"http://people.skolelinux.org/pere/blog/archive/2008/12/">December (
7)
</a></li>
959 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/3d-printer">3d-printer (
13)
</a></li>
961 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/amiga">amiga (
1)
</a></li>
963 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/aros">aros (
1)
</a></li>
965 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bankid">bankid (
4)
</a></li>
967 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bitcoin">bitcoin (
8)
</a></li>
969 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bootsystem">bootsystem (
14)
</a></li>
971 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/bsa">bsa (
2)
</a></li>
973 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/chrpath">chrpath (
2)
</a></li>
975 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian">debian (
95)
</a></li>
977 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (
146)
</a></li>
979 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/digistan">digistan (
10)
</a></li>
981 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/docbook">docbook (
10)
</a></li>
983 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/drivstoffpriser">drivstoffpriser (
4)
</a></li>
985 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/english">english (
242)
</a></li>
987 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (
21)
</a></li>
989 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/fildeling">fildeling (
12)
</a></li>
991 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/freeculture">freeculture (
12)
</a></li>
993 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/freedombox">freedombox (
7)
</a></li>
995 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/frikanalen">frikanalen (
11)
</a></li>
997 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/intervju">intervju (
40)
</a></li>
999 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram">isenkram (
7)
</a></li>
1001 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/kart">kart (
18)
</a></li>
1003 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ldap">ldap (
9)
</a></li>
1005 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/lenker">lenker (
7)
</a></li>
1007 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ltsp">ltsp (
1)
</a></li>
1009 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/mesh network">mesh network (
8)
</a></li>
1011 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/multimedia">multimedia (
26)
</a></li>
1013 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/norsk">norsk (
243)
</a></li>
1015 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/nuug">nuug (
162)
</a></li>
1017 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/offentlig innsyn">offentlig innsyn (
11)
</a></li>
1019 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/open311">open311 (
2)
</a></li>
1021 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/opphavsrett">opphavsrett (
46)
</a></li>
1023 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/personvern">personvern (
70)
</a></li>
1025 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/raid">raid (
1)
</a></li>
1027 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/reactos">reactos (
1)
</a></li>
1029 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/reprap">reprap (
11)
</a></li>
1031 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rfid">rfid (
2)
</a></li>
1033 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/robot">robot (
9)
</a></li>
1035 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/rss">rss (
1)
</a></li>
1037 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/ruter">ruter (
4)
</a></li>
1039 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/scraperwiki">scraperwiki (
2)
</a></li>
1041 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sikkerhet">sikkerhet (
37)
</a></li>
1043 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sitesummary">sitesummary (
4)
</a></li>
1045 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/skepsis">skepsis (
4)
</a></li>
1047 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/standard">standard (
44)
</a></li>
1049 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stavekontroll">stavekontroll (
3)
</a></li>
1051 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/stortinget">stortinget (
9)
</a></li>
1053 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/surveillance">surveillance (
23)
</a></li>
1055 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/sysadmin">sysadmin (
1)
</a></li>
1057 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/valg">valg (
8)
</a></li>
1059 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/video">video (
40)
</a></li>
1061 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/vitenskap">vitenskap (
4)
</a></li>
1063 <li><a href=
"http://people.skolelinux.org/pere/blog/tags/web">web (
29)
</a></li>
1069 <p style=
"text-align: right">
1070 Created by
<a href=
"http://steve.org.uk/Software/chronicle">Chronicle v4.6
</a>