1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
4 <title>Petter Reinholdtsen - Entries tagged isenkram
</title>
5 <description>Entries tagged isenkram
</description>
6 <link>http://people.skolelinux.org/pere/blog/
</link>
10 <title>Appstream just learned how to map hardware to packages too!
</title>
11 <link>http://people.skolelinux.org/pere/blog/Appstream_just_learned_how_to_map_hardware_to_packages_too_.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Appstream_just_learned_how_to_map_hardware_to_packages_too_.html
</guid>
13 <pubDate>Fri,
23 Dec
2016 10:
30:
00 +
0100</pubDate>
14 <description><p
>I received a very nice Christmas present today. As my regular
15 readers probably know, I have been working on the
16 <a href=
"http://packages.qa.debian.org/isenkram
">the Isenkram
17 system
</a
> for many years. The goal of the Isenkram system is to make
18 it easier for users to figure out what to install to get a given piece
19 of hardware to work in Debian, and a key part of this system is a way
20 to map hardware to packages. Isenkram have its own mapping database,
21 and also uses data provided by each package using the AppStream
22 metadata format. And today,
23 <a href=
"https://tracker.debian.org/pkg/appstream
">AppStream
</a
> in
24 Debian learned to look up hardware the same way Isenkram is doing it,
25 ie using fnmatch():
</p
>
28 % appstreamcli what-provides modalias \
29 usb:v1130p0202d0100dc00dsc00dp00ic03isc00ip00in00
30 Identifier: pymissile [generic]
32 Summary: Control original Striker USB Missile Launcher
34 % appstreamcli what-provides modalias usb:v0694p0002d0000
35 Identifier: libnxt [generic]
37 Summary: utility library for talking to the LEGO Mindstorms NXT brick
40 Identifier: t2n [generic]
42 Summary: Simple command-line tool for Lego NXT
45 Identifier: python-nxt [generic]
47 Summary: Python driver/interface/wrapper for the Lego Mindstorms NXT robot
50 Identifier: nbc [generic]
52 Summary: C compiler for LEGO Mindstorms NXT bricks
55 </pre
></p
>
57 <p
>A similar query can be done using the combined AppStream and
58 Isenkram databases using the isenkram-lookup tool:
</p
>
61 % isenkram-lookup usb:v1130p0202d0100dc00dsc00dp00ic03isc00ip00in00
63 % isenkram-lookup usb:v0694p0002d0000
69 </pre
></p
>
71 <p
>You can find modalias values relevant for your machine using
72 <tt
>cat $(find /sys/devices/ -name modalias)
</tt
>.
74 <p
>If you want to make this system a success and help Debian users
75 make the most of the hardware they have, please
76 help
<a href=
"https://wiki.debian.org/AppStream/Guidelines
">add
77 AppStream metadata for your package following the guidelines
</a
>
78 documented in the wiki. So far only
11 packages provide such
79 information, among the several hundred hardware specific packages in
80 Debian. The Isenkram database on the other hand contain
101 packages,
81 mostly related to USB dongles. Most of the packages with hardware
82 mapping in AppStream are LEGO Mindstorms related, because I have, as
83 part of my involvement in
84 <a href=
"https://wiki.debian.org/LegoDesigners
">the Debian LEGO
85 team
</a
> given priority to making sure LEGO users get proposed the
86 complete set of packages in Debian for that particular hardware. The
87 team also got a nice Christmas present today. The
88 <a href=
"https://tracker.debian.org/pkg/nxt-firmware
">nxt-firmware
89 package
</a
> made it into Debian. With this package in place, it is
90 now possible to use the LEGO Mindstorms NXT unit with only free
91 software, as the nxt-firmware package contain the source and firmware
92 binaries for the NXT brick.
</p
>
94 <p
>As usual, if you use Bitcoin and want to show your support of my
95 activities, please send Bitcoin donations to my address
96 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
&label=PetterReinholdtsenBlog
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
101 <title>Isenkram updated with a lot more hardware-package mappings
</title>
102 <link>http://people.skolelinux.org/pere/blog/Isenkram_updated_with_a_lot_more_hardware_package_mappings.html
</link>
103 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram_updated_with_a_lot_more_hardware_package_mappings.html
</guid>
104 <pubDate>Tue,
20 Dec
2016 11:
55:
00 +
0100</pubDate>
105 <description><p
><a href=
"http://packages.qa.debian.org/isenkram
">The Isenkram
106 system
</a
> I wrote two years ago to make it easier in Debian to find
107 and install packages to get your hardware dongles to work, is still
108 going strong. It is a system to look up the hardware present on or
109 connected to the current system, and map the hardware to Debian
110 packages. It can either be done using the tools in isenkram-cli or
111 using the user space daemon in the isenkram package. The latter will
112 notify you, when inserting new hardware, about what packages to
113 install to get the dongle working. It will even provide a button to
114 click on to ask packagekit to install the packages.
</p
>
116 <p
>Here is an command line example from my Thinkpad laptop:
</p
>
135 </pre
></p
>
137 <p
>It can also list the firware package providing firmware requested
138 by the load kernel modules, which in my case is an empty list because
139 I have all the firmware my machine need:
142 % /usr/sbin/isenkram-autoinstall-firmware -l
143 info: did not find any firmware files requested by loaded kernel modules. exiting
145 </pre
></p
>
147 <p
>The last few days I had a look at several of the around
250
148 packages in Debian with udev rules. These seem like good candidates
149 to install when a given hardware dongle is inserted, and I found
150 several that should be proposed by isenkram. I have not had time to
151 check all of them, but am happy to report that now there are
97
152 packages packages mapped to hardware by Isenkram.
11 of these
153 packages provide hardware mapping using AppStream, while the rest are
154 listed in the modaliases file provided in isenkram.
</p
>
156 <p
>These are the packages with hardware mappings at the moment. The
157 <strong
>marked packages
</strong
> are also announcing their hardware
158 support using AppStream, for everyone to use:
</p
>
160 <p
>air-quality-sensor, alsa-firmware-loaders, argyll,
161 <strong
>array-info
</strong
>, avarice, avrdude, b43-fwcutter,
162 bit-babbler, bluez, bluez-firmware,
<strong
>brltty
</strong
>,
163 <strong
>broadcom-sta-dkms
</strong
>, calibre, cgminer, cheese, colord,
164 <strong
>colorhug-client
</strong
>, dahdi-firmware-nonfree, dahdi-linux,
165 dfu-util, dolphin-emu, ekeyd, ethtool, firmware-ipw2x00, fprintd,
166 fprintd-demo,
<strong
>galileo
</strong
>, gkrellm-thinkbat, gphoto2,
167 gpsbabel, gpsbabel-gui, gpsman, gpstrans, gqrx-sdr, gr-fcdproplus,
168 gr-osmosdr, gtkpod, hackrf, hdapsd, hdmi2usb-udev, hpijs-ppds, hplip,
169 ipw3945-source, ipw3945d, kde-config-tablet, kinect-audio-setup,
170 <strong
>libnxt
</strong
>, libpam-fprintd,
<strong
>lomoco
</strong
>,
171 madwimax, minidisc-utils, mkgmap, msi-keyboard, mtkbabel,
172 <strong
>nbc
</strong
>,
<strong
>nqc
</strong
>, nut-hal-drivers, ola,
173 open-vm-toolbox, open-vm-tools, openambit, pcgminer, pcmciautils,
174 pcscd, pidgin-blinklight, printer-driver-splix,
175 <strong
>pymissile
</strong
>, python-nxt, qlandkartegt,
176 qlandkartegt-garmin, rosegarden, rt2x00-source, sispmctl,
177 soapysdr-module-hackrf, solaar, squeak-plugins-scratch, sunxi-tools,
178 <strong
>t2n
</strong
>, thinkfan, thinkfinger-tools, tlp, tp-smapi-dkms,
179 tp-smapi-source, tpb, tucnak, uhd-host, usbmuxd, viking,
180 virtualbox-ose-guest-x11, w1retap, xawtv, xserver-xorg-input-vmmouse,
181 xserver-xorg-input-wacom, xserver-xorg-video-qxl,
182 xserver-xorg-video-vmware, yubikey-personalization and
183 zd1211-firmware
</p
>
185 <p
>If you know of other packages, please let me know with a wishlist
186 bug report against the isenkram-cli package, and ask the package
188 <a href=
"https://wiki.debian.org/AppStream/Guidelines
">add AppStream
189 metadata according to the guidelines
</a
> to provide the information
190 for everyone. In time, I hope to get rid of the isenkram specific
191 hardware mapping and depend exclusively on AppStream.
</p
>
193 <p
>Note, the AppStream metadata for broadcom-sta-dkms is matching too
194 much hardware, and suggest that the package with with any ethernet
195 card. See
<a href=
"http://bugs.debian.org/
838735">bug #
838735</a
> for
196 the details. I hope the maintainer find time to address it soon. In
197 the mean time I provide an override in isenkram.
</p
>
202 <title>Isenkram, Appstream and udev make life as a LEGO builder easier
</title>
203 <link>http://people.skolelinux.org/pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html
</link>
204 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html
</guid>
205 <pubDate>Fri,
7 Oct
2016 09:
50:
00 +
0200</pubDate>
206 <description><p
><a href=
"http://packages.qa.debian.org/isenkram
">The Isenkram
207 system
</a
> provide a practical and easy way to figure out which
208 packages support the hardware in a given machine. The command line
209 tool
<tt
>isenkram-lookup
</tt
> and the tasksel options provide a
210 convenient way to list and install packages relevant for the current
211 hardware during system installation, both user space packages and
212 firmware packages. The GUI background daemon on the other hand provide
213 a pop-up proposing to install packages when a new dongle is inserted
214 while using the computer. For example, if you plug in a smart card
215 reader, the system will ask if you want to install
<tt
>pcscd
</tt
> if
216 that package isn
't already installed, and if you plug in a USB video
217 camera the system will ask if you want to install
<tt
>cheese
</tt
> if
218 cheese is currently missing. This already work just fine.
</p
>
220 <p
>But Isenkram depend on a database mapping from hardware IDs to
221 package names. When I started no such database existed in Debian, so
222 I made my own data set and included it with the isenkram package and
223 made isenkram fetch the latest version of this database from git using
224 http. This way the isenkram users would get updated package proposals
225 as soon as I learned more about hardware related packages.
</p
>
227 <p
>The hardware is identified using modalias strings. The modalias
228 design is from the Linux kernel where most hardware descriptors are
229 made available as a strings that can be matched using filename style
230 globbing. It handle USB, PCI, DMI and a lot of other hardware related
231 identifiers.
</p
>
233 <p
>The downside to the Isenkram specific database is that there is no
234 information about relevant distribution / Debian version, making
235 isenkram propose obsolete packages too. But along came AppStream, a
236 cross distribution mechanism to store and collect metadata about
237 software packages. When I heard about the proposal, I contacted the
238 people involved and suggested to add a hardware matching rule using
239 modalias strings in the specification, to be able to use AppStream for
240 mapping hardware to packages. This idea was accepted and AppStream is
241 now a great way for a package to announce the hardware it support in a
242 distribution neutral way. I wrote
243 <a href=
"http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
">a
244 recipe on how to add such meta-information
</a
> in a blog post last
245 December. If you have a hardware related package in Debian, please
246 announce the relevant hardware IDs using AppStream.
</p
>
248 <p
>In Debian, almost all packages that can talk to a LEGO Mindestorms
249 RCX or NXT unit, announce this support using AppStream. The effect is
250 that when you insert such LEGO robot controller into your Debian
251 machine, Isenkram will propose to install the packages needed to get
252 it working. The intention is that this should allow the local user to
253 start programming his robot controller right away without having to
254 guess what packages to use or which permissions to fix.
</p
>
256 <p
>But when I sat down with my son the other day to program our NXT
257 unit using his Debian Stretch computer, I discovered something
258 annoying. The local console user (ie my son) did not get access to
259 the USB device for programming the unit. This used to work, but no
260 longer in Jessie and Stretch. After some investigation and asking
261 around on #debian-devel, I discovered that this was because udev had
262 changed the mechanism used to grant access to local devices. The
263 ConsoleKit mechanism from
<tt
>/lib/udev/rules.d/
70-udev-acl.rules
</tt
>
264 no longer applied, because LDAP users no longer was added to the
265 plugdev group during login. Michael Biebl told me that this method
266 was obsolete and the new method used ACLs instead. This was good
267 news, as the plugdev mechanism is a mess when using a remote user
268 directory like LDAP. Using ACLs would make sure a user lost device
269 access when she logged out, even if the user left behind a background
270 process which would retain the plugdev membership with the ConsoleKit
271 setup. Armed with this knowledge I moved on to fix the access problem
272 for the LEGO Mindstorms related packages.
</p
>
274 <p
>The new system uses a udev tag,
'uaccess
'. It can either be
275 applied directly for a device, or is applied in
276 /lib/udev/rules.d/
70-uaccess.rules for classes of devices. As the
277 LEGO Mindstorms udev rules did not have a class, I decided to add the
278 tag directly in the udev rules files included in the packages. Here
279 is one example. For the nqc C compiler for the RCX, the
280 <tt
>/lib/udev/rules.d/
60-nqc.rules
</tt
> file now look like this:
283 SUBSYSTEM==
"usb
", ACTION==
"add
", ATTR{idVendor}==
"0694", ATTR{idProduct}==
"0001", \
284 SYMLINK+=
"rcx-%k
", TAG+=
"uaccess
"
285 </pre
></p
>
287 <p
>The key part is the
'TAG+=
"uaccess
"' at the end. I suspect all
288 packages using plugdev in their /lib/udev/rules.d/ files should be
289 changed to use this tag (either directly or indirectly via
290 <tt
>70-uaccess.rules
</tt
>). Perhaps a lintian check should be created
291 to detect this?
</p
>
293 <p
>I
've been unable to find good documentation on the uaccess feature.
294 It is unclear to me if the uaccess tag is an internal implementation
295 detail like the udev-acl tag used by
296 <tt
>/lib/udev/rules.d/
70-udev-acl.rules
</tt
>. If it is, I guess the
297 indirect method is the preferred way. Michael
298 <a href=
"https://github.com/systemd/systemd/issues/
4288">asked for more
299 documentation from the systemd project
</a
> and I hope it will make
300 this clearer. For now I use the generic classes when they exist and
301 is already handled by
<tt
>70-uaccess.rules
</tt
>, and add the tag
302 directly if no such class exist.
</p
>
304 <p
>To learn more about the isenkram system, please check out
305 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">my
306 blog posts tagged isenkram
</a
>.
</p
>
308 <p
>To help out making life for LEGO constructors in Debian easier,
309 please join us on our IRC channel
310 <a href=
"irc://irc.debian.org/%
23debian-lego
">#debian-lego
</a
> and join
311 the
<a href=
"https://alioth.debian.org/projects/debian-lego/
">Debian
312 LEGO team
</a
> in the Alioth project we created yesterday. A mailing
313 list is not yet created, but we are working on it. :)
</p
>
315 <p
>As usual, if you use Bitcoin and want to show your support of my
316 activities, please send Bitcoin donations to my address
317 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
&label=PetterReinholdtsenBlog
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
322 <title>Isenkram with PackageKit support - new version
0.23 available in Debian unstable
</title>
323 <link>http://people.skolelinux.org/pere/blog/Isenkram_with_PackageKit_support___new_version_0_23_available_in_Debian_unstable.html
</link>
324 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram_with_PackageKit_support___new_version_0_23_available_in_Debian_unstable.html
</guid>
325 <pubDate>Wed,
25 May
2016 10:
20:
00 +
0200</pubDate>
326 <description><p
><a href=
"https://tracker.debian.org/pkg/isenkram
">The isenkram
327 system
</a
> is a user-focused solution in Debian for handling hardware
328 related packages. The idea is to have a database of mappings between
329 hardware and packages, and pop up a dialog suggesting for the user to
330 install the packages to use a given hardware dongle. Some use cases
331 are when you insert a Yubikey, it proposes to install the software
332 needed to control it; when you insert a braille reader list it
333 proposes to install the packages needed to send text to the reader;
334 and when you insert a ColorHug screen calibrator it suggests to
335 install the driver for it. The system work well, and even have a few
336 command line tools to install firmware packages and packages for the
337 hardware already in the machine (as opposed to hotpluggable hardware).
</p
>
339 <p
>The system was initially written using aptdaemon, because I found
340 good documentation and example code on how to use it. But aptdaemon
341 is going away and is generally being replaced by
342 <a href=
"http://www.freedesktop.org/software/PackageKit/
">PackageKit
</a
>,
343 so Isenkram needed a rewrite. And today, thanks to the great patch
344 from my college Sunil Mohan Adapa in the FreedomBox project, the
345 rewrite finally took place. I
've just uploaded a new version of
346 Isenkram into Debian Unstable with the patch included, and the default
347 for the background daemon is now to use PackageKit. To check it out,
348 install the
<tt
>isenkram
</tt
> package and insert some hardware dongle
349 and see if it is recognised.
</p
>
351 <p
>If you want to know what kind of packages isenkram would propose for
352 the machine it is running on, you can check out the isenkram-lookup
353 program. This is what it look like on a Thinkpad X230:
</p
>
355 <p
><blockquote
><pre
>
371 </pre
></blockquote
></p
>
373 <p
>The hardware mappings come from several places. The preferred way
374 is for packages to announce their hardware support using
375 <a href=
"https://www.freedesktop.org/software/appstream/docs/
">the
376 cross distribution appstream system
</a
>.
378 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">previous
379 blog posts about isenkram
</a
> to learn how to do that.
</p
>
384 <title>Using appstream with isenkram to install hardware related packages in Debian
</title>
385 <link>http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</link>
386 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</guid>
387 <pubDate>Sun,
20 Dec
2015 12:
20:
00 +
0100</pubDate>
388 <description><p
>Around three years ago, I created
389 <a href=
"http://packages.qa.debian.org/isenkram
">the isenkram
390 system
</a
> to get a more practical solution in Debian for handing
391 hardware related packages. A GUI system in the isenkram package will
392 present a pop-up dialog when some hardware dongle supported by
393 relevant packages in Debian is inserted into the machine. The same
394 lookup mechanism to detect packages is available as command line
395 tools in the isenkram-cli package. In addition to mapping hardware,
396 it will also map kernel firmware files to packages and make it easy to
397 install needed firmware packages automatically. The key for this
398 system to work is a good way to map hardware to packages, in other
399 words, allow packages to announce what hardware they will work
402 <p
>I started by providing data files in the isenkram source, and
403 adding code to download the latest version of these data files at run
404 time, to ensure every user had the most up to date mapping available.
405 I also added support for storing the mapping in the Packages file in
406 the apt repositories, but did not push this approach because while I
407 was trying to figure out how to best store hardware/package mappings,
408 <a href=
"http://www.freedesktop.org/software/appstream/docs/
">the
409 appstream system
</a
> was announced. I got in touch and suggested to
410 add the hardware mapping into that data set to be able to use
411 appstream as a data source, and this was accepted at least for the
412 Debian version of appstream.
</p
>
414 <p
>A few days ago using appstream in Debian for this became possible,
415 and today I uploaded a new version
0.20 of isenkram adding support for
416 appstream as a data source for mapping hardware to packages. The only
417 package so far using appstream to announce its hardware support is my
418 pymissile package. I got help from Matthias Klumpp with figuring out
419 how do add the required
420 <a href=
"https://appstream.debian.org/html/sid/main/metainfo/pymissile.html
">metadata
421 in pymissile
</a
>. I added a file debian/pymissile.metainfo.xml with
422 this content:
</p
>
424 <blockquote
><pre
>
425 &lt;?xml version=
"1.0" encoding=
"UTF-
8"?
&gt;
426 &lt;component
&gt;
427 &lt;id
&gt;pymissile
&lt;/id
&gt;
428 &lt;metadata_license
&gt;MIT
&lt;/metadata_license
&gt;
429 &lt;name
&gt;pymissile
&lt;/name
&gt;
430 &lt;summary
&gt;Control original Striker USB Missile Launcher
&lt;/summary
&gt;
431 &lt;description
&gt;
433 Pymissile provides a curses interface to control an original
434 Marks and Spencer / Striker USB Missile Launcher, as well as a
435 motion control script to allow a webcamera to control the
438 &lt;/description
&gt;
439 &lt;provides
&gt;
440 &lt;modalias
&gt;usb:v1130p0202d*
&lt;/modalias
&gt;
441 &lt;/provides
&gt;
442 &lt;/component
&gt;
443 </pre
></blockquote
>
445 <p
>The key for isenkram is the component/provides/modalias value,
446 which is a glob style match rule for hardware specific strings
447 (modalias strings) provided by the Linux kernel. In this case, it
448 will map to all USB devices with vendor code
1130 and product code
451 <p
>Note, it is important that the license of all the metadata files
452 are compatible to have permissions to aggregate them into archive wide
453 appstream files. Matthias suggested to use MIT or BSD licenses for
454 these files. A challenge is figuring out a good id for the data, as
455 it is supposed to be globally unique and shared across distributions
456 (in other words, best to coordinate with upstream what to use). But
457 it can be changed later or, so we went with the package name as
458 upstream for this project is dormant.
</p
>
460 <p
>To get the metadata file installed in the correct location for the
461 mirror update scripts to pick it up and include its content the
462 appstream data source, the file must be installed in the binary
463 package under /usr/share/appdata/. I did this by adding the following
464 line to debian/pymissile.install:
</p
>
466 <blockquote
><pre
>
467 debian/pymissile.metainfo.xml usr/share/appdata
468 </pre
></blockquote
>
470 <p
>With that in place, the command line tool isenkram-lookup will list
471 all packages useful on the current computer automatically, and the GUI
472 pop-up handler will propose to install the package not already
473 installed if a hardware dongle is inserted into the machine in
476 <p
>Details of the modalias field in appstream is available from the
477 <a href=
"https://wiki.debian.org/DEP-
11">DEP-
11</a
> proposal.
</p
>
479 <p
>To locate the modalias values of all hardware present in a machine,
480 try running this command on the command line:
</p
>
482 <blockquote
><pre
>
483 cat $(find /sys/devices/|grep modalias)
484 </pre
></blockquote
>
486 <p
>To learn more about the isenkram system, please check out
487 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">my
488 blog posts tagged isenkram
</a
>.
</p
>
493 <title>Debian Jessie, PXE and automatic firmware installation
</title>
494 <link>http://people.skolelinux.org/pere/blog/Debian_Jessie__PXE_and_automatic_firmware_installation.html
</link>
495 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_Jessie__PXE_and_automatic_firmware_installation.html
</guid>
496 <pubDate>Fri,
17 Oct
2014 14:
10:
00 +
0200</pubDate>
497 <description><p
>When PXE installing laptops with Debian, I often run into the
498 problem that the WiFi card require some firmware to work properly.
499 And it has been a pain to fix this using preseeding in Debian.
500 Normally something more is needed. But thanks to
501 <a href=
"https://packages.qa.debian.org/i/isenkram.html
">my isenkram
502 package
</a
> and its recent tasksel extension, it has now become easy
503 to do this using simple preseeding.
</p
>
505 <p
>The isenkram-cli package provide tasksel tasks which will install
506 firmware for the hardware found in the machine (actually, requested by
507 the kernel modules for the hardware). (It can also install user space
508 programs supporting the hardware detected, but that is not the focus
509 of this story.)
</p
>
511 <p
>To get this working in the default installation, two preeseding
512 values are needed. First, the isenkram-cli package must be installed
513 into the target chroot (aka the hard drive) before tasksel is executed
514 in the pkgsel step of the debian-installer system. This is done by
515 preseeding the base-installer/includes debconf value to include the
516 isenkram-cli package. The package name is next passed to debootstrap
517 for installation. With the isenkram-cli package in place, tasksel
518 will automatically use the isenkram tasks to detect hardware specific
519 packages for the machine being installed and install them, because
520 isenkram-cli contain tasksel tasks.
</p
>
522 <p
>Second, one need to enable the non-free APT repository, because
523 most firmware unfortunately is non-free. This is done by preseeding
524 the apt-mirror-setup step. This is unfortunate, but for a lot of
525 hardware it is the only option in Debian.
</p
>
527 <p
>The end result is two lines needed in your preseeding file to get
528 firmware installed automatically by the installer:
</p
>
530 <p
><blockquote
><pre
>
531 base-installer base-installer/includes string isenkram-cli
532 apt-mirror-setup apt-setup/non-free boolean true
533 </pre
></blockquote
></p
>
535 <p
>The current version of isenkram-cli in testing/jessie will install
536 both firmware and user space packages when using this method. It also
537 do not work well, so use version
0.15 or later. Installing both
538 firmware and user space packages might give you a bit more than you
539 want, so I decided to split the tasksel task in two, one for firmware
540 and one for user space programs. The firmware task is enabled by
541 default, while the one for user space programs is not. This split is
542 implemented in the package currently in unstable.
</p
>
544 <p
>If you decide to give this a go, please let me know (via email) how
545 this recipe work for you. :)
</p
>
547 <p
>So, I bet you are wondering, how can this work. First and
548 foremost, it work because tasksel is modular, and driven by whatever
549 files it find in /usr/lib/tasksel/ and /usr/share/tasksel/. So the
550 isenkram-cli package place two files for tasksel to find. First there
551 is the task description file (/usr/share/tasksel/descs/isenkram.desc):
</p
>
553 <p
><blockquote
><pre
>
554 Task: isenkram-packages
556 Description: Hardware specific packages (autodetected by isenkram)
557 Based on the detected hardware various hardware specific packages are
559 Test-new-install: show show
561 Packages: for-current-hardware
563 Task: isenkram-firmware
565 Description: Hardware specific firmware packages (autodetected by isenkram)
566 Based on the detected hardware various hardware specific firmware
567 packages are proposed.
568 Test-new-install: mark show
570 Packages: for-current-hardware-firmware
571 </pre
></blockquote
></p
>
573 <p
>The key parts are Test-new-install which indicate how the task
574 should be handled and the Packages line referencing to a script in
575 /usr/lib/tasksel/packages/. The scripts use other scripts to get a
576 list of packages to install. The for-current-hardware-firmware script
577 look like this to list relevant firmware for the machine:
579 <p
><blockquote
><pre
>
584 isenkram-autoinstall-firmware -l
585 </pre
></blockquote
></p
>
587 <p
>With those two pieces in place, the firmware is installed by
588 tasksel during the normal d-i run. :)
</p
>
590 <p
>If you want to test what tasksel will install when isenkram-cli is
591 installed, run
<tt
>DEBIAN_PRIORITY=critical tasksel --test
592 --new-install
</tt
> to get the list of packages that tasksel would
595 <p
><a href=
"https://wiki.debian.org/DebianEdu/
">Debian Edu
</a
> will be
596 pilots in testing this feature, as isenkram is used there now to
597 install firmware, replacing the earlier scripts.
</p
>
602 <title>Install hardware dependent packages using tasksel (Isenkram
0.7)
</title>
603 <link>http://people.skolelinux.org/pere/blog/Install_hardware_dependent_packages_using_tasksel__Isenkram_0_7_.html
</link>
604 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Install_hardware_dependent_packages_using_tasksel__Isenkram_0_7_.html
</guid>
605 <pubDate>Wed,
23 Apr
2014 14:
50:
00 +
0200</pubDate>
606 <description><p
>It would be nice if it was easier in Debian to get all the hardware
607 related packages relevant for the computer installed automatically.
608 So I implemented one, using
609 <a href=
"http://packages.qa.debian.org/isenkram
">my Isenkram
610 package
</a
>. To use it, install the tasksel and isenkram packages and
611 run tasksel as user root. You should be presented with a new option,
612 "Hardware specific packages (autodetected by isenkram)
". When you
613 select it, tasksel will install the packages isenkram claim is fit for
614 the current hardware, hot pluggable or not.
<p
>
616 <p
>The implementation is in two files, one is the tasksel menu entry
617 description, and the other is the script used to extract the list of
618 packages to install. The first part is in
619 <tt
>/usr/share/tasksel/descs/isenkram.desc
</tt
> and look like
622 <p
><blockquote
><pre
>
625 Description: Hardware specific packages (autodetected by isenkram)
626 Based on the detected hardware various hardware specific packages are
628 Test-new-install: mark show
630 Packages: for-current-hardware
631 </pre
></blockquote
></p
>
633 <p
>The second part is in
634 <tt
>/usr/lib/tasksel/packages/for-current-hardware
</tt
> and look like
637 <p
><blockquote
><pre
>
642 isenkram-autoinstall-firmware -l
644 </pre
></blockquote
></p
>
646 <p
>All in all, a very short and simple implementation making it
647 trivial to install the hardware dependent package we all may want to
648 have installed on our machines. I
've not been able to find a way to
649 get tasksel to tell you exactly which packages it plan to install
650 before doing the installation. So if you are curious or careful,
651 check the output from the isenkram-* command line tools first.
</p
>
653 <p
>The information about which packages are handling which hardware is
654 fetched either from the isenkram package itself in
655 /usr/share/isenkram/, from git.debian.org or from the APT package
656 database (using the Modaliases header). The APT package database
657 parsing have caused a nasty resource leak in the isenkram daemon (bugs
658 <a href=
"http://bugs.debian.org/
719837">#
719837</a
> and
659 <a href=
"http://bugs.debian.org/
730704">#
730704</a
>). The cause is in
660 the python-apt code (bug
661 <a href=
"http://bugs.debian.org/
745487">#
745487</a
>), but using a
662 workaround I was able to get rid of the file descriptor leak and
663 reduce the memory leak from ~
30 MiB per hardware detection down to
664 around
2 MiB per hardware detection. It should make the desktop
665 daemon a lot more useful. The fix is in version
0.7 uploaded to
666 unstable today.
</p
>
668 <p
>I believe the current way of mapping hardware to packages in
669 Isenkram is is a good draft, but in the future I expect isenkram to
670 use the AppStream data source for this. A proposal for getting proper
671 AppStream support into Debian is floating around as
672 <a href=
"https://wiki.debian.org/DEP-
11">DEP-
11</a
>, and
673 <a href=
"https://wiki.debian.org/SummerOfCode2014/Projects#SummerOfCode2014.2FProjects
.2FAppStreamDEP11Implementation.AppStream
.2FDEP-
11_for_the_Debian_Archive
">GSoC
674 project
</a
> will take place this summer to improve the situation. I
675 look forward to seeing the result, and welcome patches for isenkram to
676 start using the information when it is ready.
</p
>
678 <p
>If you want your package to map to some specific hardware, either
679 add a
"Xb-Modaliases
" header to your control file like I did in
680 <a href=
"http://packages.qa.debian.org/pymissile
">the pymissile
681 package
</a
> or submit a bug report with the details to the isenkram
683 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">all my
684 blog posts tagged isenkram
</a
> for details on the notation. I expect
685 the information will be migrated to AppStream eventually, but for the
686 moment I got no better place to store it.
</p
>
691 <title>Automatically locate and install required firmware packages on Debian (Isenkram
0.4)
</title>
692 <link>http://people.skolelinux.org/pere/blog/Automatically_locate_and_install_required_firmware_packages_on_Debian__Isenkram_0_4_.html
</link>
693 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Automatically_locate_and_install_required_firmware_packages_on_Debian__Isenkram_0_4_.html
</guid>
694 <pubDate>Tue,
25 Jun
2013 11:
50:
00 +
0200</pubDate>
695 <description><p
>It annoys me when the computer fail to do automatically what it is
696 perfectly capable of, and I have to do it manually to get things
697 working. One such task is to find out what firmware packages are
698 needed to get the hardware on my computer working. Most often this
699 affect the wifi card, but some times it even affect the RAID
700 controller or the ethernet card. Today I pushed version
0.4 of the
701 <a href=
"http://packages.qa.debian.org/isenkram
">Isenkram package
</a
>
702 including a new script isenkram-autoinstall-firmware handling the
703 process of asking all the loaded kernel modules what firmware files
704 they want, find debian packages providing these files and install the
705 debian packages. Here is a test run on my laptop:
</p
>
708 # isenkram-autoinstall-firmware
709 info: kernel drivers requested extra firmware: ipw2200-bss.fw ipw2200-ibss.fw ipw2200-sniffer.fw
710 info: fetching http://http.debian.net/debian/dists/squeeze/Contents-i386.gz
711 info: locating packages with the requested firmware files
712 info: Updating APT sources after adding non-free APT source
713 info: trying to install firmware-ipw2x00
716 Preconfiguring packages ...
717 Selecting previously deselected package firmware-ipw2x00.
718 (Reading database ...
259727 files and directories currently installed.)
719 Unpacking firmware-ipw2x00 (from .../firmware-ipw2x00_0.28+squeeze1_all.deb) ...
720 Setting up firmware-ipw2x00 (
0.28+squeeze1) ...
722 </pre
></p
>
724 <p
>When all the requested firmware is present, a simple message is
725 printed instead:
</p
>
728 # isenkram-autoinstall-firmware
729 info: did not find any firmware files requested by loaded kernel modules. exiting
731 </pre
></p
>
733 <p
>It could use some polish, but it is already working well and saving
734 me some time when setting up new machines. :)
</p
>
736 <p
>So, how does it work? It look at the set of currently loaded
737 kernel modules, and look up each one of them using modinfo, to find
738 the firmware files listed in the module meta-information. Next, it
739 download the Contents file from a nearby APT mirror, and search for
740 the firmware files in this file to locate the package with the
741 requested firmware file. If the package is in the non-free section, a
742 non-free APT source is added and the package is installed using
743 <tt
>apt-get install
</tt
>. The end result is a slightly better working
746 <p
>I hope someone find time to implement a more polished version of
747 this script as part of the hw-detect debian-installer module, to
748 finally fix
<a href=
"http://bugs.debian.org/
655507">BTS report
749 #
655507</a
>. There really is no need to insert USB sticks with
750 firmware during a PXE install when the packages already are available
751 from the nearby Debian mirror.
</p
>
756 <title>Isenkram
0.2 finally in the Debian archive
</title>
757 <link>http://people.skolelinux.org/pere/blog/Isenkram_0_2_finally_in_the_Debian_archive.html
</link>
758 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram_0_2_finally_in_the_Debian_archive.html
</guid>
759 <pubDate>Wed,
3 Apr
2013 23:
40:
00 +
0200</pubDate>
760 <description><p
>Today the
<a href=
"http://packages.qa.debian.org/isenkram
">Isenkram
761 package
</a
> finally made it into the archive, after lingering in NEW
762 for many months. I uploaded it to the Debian experimental suite
763 2013-
01-
27, and today it was accepted into the archive.
</p
>
765 <p
>Isenkram is a system for suggesting to users what packages to
766 install to work with a pluggable hardware device. The suggestion pop
767 up when the device is plugged in. For example if a Lego Mindstorm NXT
768 is inserted, it will suggest to install the program needed to program
769 the NXT controller. Give it a go, and report bugs and suggestions to
775 <title>Welcome to the world, Isenkram!
</title>
776 <link>http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
</link>
777 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
</guid>
778 <pubDate>Tue,
22 Jan
2013 22:
00:
00 +
0100</pubDate>
779 <description><p
>Yesterday, I
780 <a href=
"http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
">asked
781 for testers
</a
> for my prototype for making Debian better at handling
782 pluggable hardware devices, which I
783 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">set
784 out to create
</a
> earlier this month. Several valuable testers showed
785 up, and caused me to really want to to open up the development to more
786 people. But before I did this, I want to come up with a sensible name
787 for this project. Today I finally decided on a new name, and I have
788 renamed the project from hw-support-handler to this new name. In the
789 process, I moved the source to git and made it available as a
790 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git
">collab-maint
</a
>
791 repository in Debian. The new name? It is
<strong
>Isenkram
</strong
>.
792 To fetch and build the latest version of the source, use
</p
>
795 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
796 cd isenkram
&& git-buildpackage -us -uc
799 <p
>I have not yet adjusted all files to use the new name yet. If you
800 want to hack on the source or improve the package, please go ahead.
801 But please talk to me first on IRC or via email before you do major
802 changes, to make sure we do not step on each others toes. :)
</p
>
804 <p
>If you wonder what
'isenkram
' is, it is a Norwegian word for iron
805 stuff, typically meaning tools, nails, screws, etc. Typical hardware
806 stuff, in other words. I
've been told it is the Norwegian variant of
807 the German word eisenkram, for those that are familiar with that
810 <p
><strong
>Update
2013-
01-
26</strong
>: Added -us -us to build
811 instructions, to avoid confusing people with an error from the signing
814 <p
><strong
>Update
2013-
01-
27</strong
>: Switch to HTTP URL for the git
815 clone argument to avoid the need for authentication.
</p
>
820 <title>First prototype ready making hardware easier to use in Debian
</title>
821 <link>http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
</link>
822 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
</guid>
823 <pubDate>Mon,
21 Jan
2013 12:
00:
00 +
0100</pubDate>
824 <description><p
>Early this month I set out to try to
825 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">improve
826 the Debian support for pluggable hardware devices
</a
>. Now my
827 prototype is working, and it is ready for a larger audience. To test
829 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">source
830 from the Debian Edu subversion repository
</a
>, build and install the
831 package. You might have to log out and in again activate the
832 autostart script.
</p
>
834 <p
>The design is simple:
</p
>
838 <li
>Add desktop entry in /usr/share/autostart/ causing a program
839 hw-support-handlerd to start when the user log in.
</li
>
841 <li
>This program listen for kernel events about new hardware (directly
842 from the kernel like udev does), not using HAL dbus events as I
843 initially did.
</li
>
845 <li
>When new hardware is inserted, look up the hardware modalias in
846 the APT database, a database
847 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup
">available
848 via HTTP
</a
> and a database available as part of the package.
</li
>
850 <li
>If a package is mapped to the hardware in question, the package
851 isn
't installed yet and this is the first time the hardware was
852 plugged in, show a desktop notification suggesting to install the
853 package or packages.
</li
>
855 <li
>If the user click on the
'install package now
' button, ask
856 aptdaemon via the PackageKit API to install the requrired package.
</li
>
858 <li
>aptdaemon ask for root password or sudo password, and install the
859 package while showing progress information in a window.
</li
>
863 <p
>I still need to come up with a better name for the system. Here
864 are some screen shots showing the prototype in action. First the
865 notification, then the password request, and finally the request to
866 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.
</p
>
868 <p
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
1-notification.png
">
869 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
2-password.png
">
870 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
3-dependencies.png
">
871 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
4-installing.png
">
872 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
5-installing-details.png
" width=
"70%
"></p
>
874 <p
>The prototype still need to be improved with longer timeouts, but
875 is already useful. The database of hardware to package mappings also
876 need more work. It is currently compatible with the Ubuntu way of
877 storing such information in the package control file, but could be
878 changed to use other formats instead or in addition to the current
879 method. I
've dropped the use of discover for this mapping, as the
880 modalias approach is more flexible and easier to use on Linux as long
881 as the Linux kernel expose its modalias strings directly.
</p
>
883 <p
><strong
>Update
2013-
01-
21 16:
50</strong
>: Due to popular demand,
884 here is the command required to check out and build the source: Use
885 '<tt
>svn checkout
886 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
887 hw-support-handler; debuild
</tt
>'. If you lack debuild, install the
888 devscripts package.
</p
>
890 <p
><strong
>Update
2013-
01-
23 12:
00</strong
>: The project is now
891 renamed to Isenkram and the source moved from the Debian Edu
892 subversion repository to a Debian collab-maint git repository. See
893 <a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
">build
894 instructions
</a
> for details.
</p
>
899 <title>Using modalias info to find packages handling my hardware
</title>
900 <link>http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html
</link>
901 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html
</guid>
902 <pubDate>Tue,
15 Jan
2013 08:
00:
00 +
0100</pubDate>
903 <description><p
>Yesterday, I wrote about the
904 <a href=
"http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
">modalias
905 values provided by the Linux kernel
</a
> following my hope for
906 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">better
907 dongle support in Debian
</a
>. Using this knowledge, I have tested how
908 modalias values attached to package names can be used to map packages
909 to hardware. This allow the system to look up and suggest relevant
910 packages when I plug in some new hardware into my machine, and replace
911 discover and discover-data as the database used to map hardware to
914 <p
>I create a modaliases file with entries like the following,
915 containing package name, kernel module name (if relevant, otherwise
916 the package name) and globs matching the relevant hardware
919 <p
><blockquote
>
920 Package: package-name
921 <br
>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)
</p
>
922 </blockquote
></p
>
924 <p
>It is fairly trivial to write code to find the relevant packages
925 for a given modalias value using this file.
</p
>
927 <p
>An entry like this would suggest the video and picture application
928 cheese for many USB web cameras (interface bus class
0E01):
</p
>
930 <p
><blockquote
>
932 <br
>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)
</p
>
933 </blockquote
></p
>
935 <p
>An entry like this would suggest the pcmciautils package when a
936 CardBus bridge (bus class
0607) PCI device is present:
</p
>
938 <p
><blockquote
>
940 <br
>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
941 </blockquote
></p
>
943 <p
>An entry like this would suggest the package colorhug-client when
944 plugging in a ColorHug with USB IDs
04D8:F8DA:
</p
>
946 <p
><blockquote
>
947 Package: colorhug-client
948 <br
>Modaliases: colorhug-client(usb:v04D8pF8DAd*)
</p
>
949 </blockquote
></p
>
951 <p
>I believe the format is compatible with the format of the Packages
952 file in the Debian archive. Ubuntu already uses their Packages file
953 to store their mappings from packages to hardware.
</p
>
955 <p
>By adding a XB-Modaliases: header in debian/control, any .deb can
956 announce the hardware it support in a way my prototype understand.
957 This allow those publishing packages in an APT source outside the
958 Debian archive as well as those backporting packages to make sure the
959 hardware mapping are included in the package meta information. I
've
960 tested such header in the pymissile package, and its modalias mapping
961 is working as it should with my prototype. It even made it to Ubuntu
964 <p
>To test if it was possible to look up supported hardware using only
965 the shell tools available in the Debian installer, I wrote a shell
966 implementation of the lookup code. The idea is to create files for
967 each modalias and let the shell do the matching. Please check out and
969 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co
">hw-support-lookup
</a
>
970 shell script. It run without any extra dependencies and fetch the
971 hardware mappings from the Debian archive and the subversion
972 repository where I currently work on my prototype.
</p
>
974 <p
>When I use it on a machine with a yubikey inserted, it suggest to
975 install yubikey-personalization:
</p
>
977 <p
><blockquote
>
978 % ./hw-support-lookup
979 <br
>yubikey-personalization
981 </blockquote
></p
>
983 <p
>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
984 propose to install the pcmciautils package:
</p
>
986 <p
><blockquote
>
987 % ./hw-support-lookup
988 <br
>pcmciautils
990 </blockquote
></p
>
992 <p
>If you know of any hardware-package mapping that should be added to
993 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co
">my
994 database
</a
>, please tell me about it.
</p
>
996 <p
>It could be possible to generate several of the mappings between
997 packages and hardware. One source would be to look at packages with
998 kernel modules, ie packages with *.ko files in /lib/modules/, and
999 extract their modalias information. Another would be to look at
1000 packages with udev rules, ie packages with files in
1001 /lib/udev/rules.d/, and extract their vendor/model information to
1002 generate a modalias matching rule. I have not tested any of these to
1003 see if it work.
</p
>
1005 <p
>If you want to help implementing a system to let us propose what
1006 packages to install when new hardware is plugged into a Debian
1007 machine, please send me an email or talk to me on
1008 <a href=
"irc://irc.debian.org/%
23debian-devel
">#debian-devel
</a
>.
</p
>
1013 <title>Modalias strings - a practical way to map
"stuff
" to hardware
</title>
1014 <link>http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
</link>
1015 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
</guid>
1016 <pubDate>Mon,
14 Jan
2013 11:
20:
00 +
0100</pubDate>
1017 <description><p
>While looking into how to look up Debian packages based on hardware
1018 information, to find the packages that support a given piece of
1019 hardware, I refreshed my memory regarding modalias values, and decided
1020 to document the details. Here are my findings so far, also available
1022 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">the
1023 Debian Edu subversion repository
</a
>:
1025 <p
><strong
>Modalias decoded
</strong
></p
>
1027 <p
>This document try to explain what the different types of modalias
1028 values stands for. It is in part based on information from
1029 &lt;URL:
<a href=
"https://wiki.archlinux.org/index.php/Modalias
">https://wiki.archlinux.org/index.php/Modalias
</a
> &gt;,
1030 &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;,
1031 &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
1032 &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;.
1034 <p
>The modalias entries for a given Linux machine can be found using
1035 this shell script:
</p
>
1038 find /sys -name modalias -print0 | xargs -
0 cat | sort -u
1041 <p
>The supported modalias globs for a given kernel module can be found
1042 using modinfo:
</p
>
1045 % /sbin/modinfo psmouse | grep alias:
1046 alias: serio:ty05pr*id*ex*
1047 alias: serio:ty01pr*id*ex*
1051 <p
><strong
>PCI subtype
</strong
></p
>
1053 <p
>A typical PCI entry can look like this. This is an Intel Host
1054 Bridge memory controller:
</p
>
1056 <p
><blockquote
>
1057 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
1058 </blockquote
></p
>
1060 <p
>This represent these values:
</p
>
1065 sv
00001028 (subvendor)
1066 sd
000001AD (subdevice)
1068 sc
00 (bus subclass)
1072 <p
>The vendor/device values are the same values outputted from
'lspci
1073 -n
' as
8086:
2770. The bus class/subclass is also shown by lspci as
1074 0600. The
0600 class is a host bridge. Other useful bus values are
1075 0300 (VGA compatible card) and
0200 (Ethernet controller).
</p
>
1077 <p
>Not sure how to figure out the interface value, nor what it
1080 <p
><strong
>USB subtype
</strong
></p
>
1082 <p
>Some typical USB entries can look like this. This is an internal
1083 USB hub in a laptop:
</p
>
1085 <p
><blockquote
>
1086 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
1087 </blockquote
></p
>
1089 <p
>Here is the values included in this alias:
</p
>
1092 v
1D6B (device vendor)
1093 p
0001 (device product)
1095 dc
09 (device class)
1096 dsc
00 (device subclass)
1097 dp
00 (device protocol)
1098 ic
09 (interface class)
1099 isc
00 (interface subclass)
1100 ip
00 (interface protocol)
1103 <p
>The
0900 device class/subclass means hub. Some times the relevant
1104 class is in the interface class section. For a simple USB web camera,
1105 these alias entries show up:
</p
>
1107 <p
><blockquote
>
1108 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
1109 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
1110 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
1111 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
1112 </blockquote
></p
>
1114 <p
>Interface class
0E01 is video control,
0E02 is video streaming (aka
1115 camera),
0101 is audio control device and
0102 is audio streaming (aka
1116 microphone). Thus this is a camera with microphone included.
</p
>
1118 <p
><strong
>ACPI subtype
</strong
></p
>
1120 <p
>The ACPI type is used for several non-PCI/USB stuff. This is an IR
1121 receiver in a Thinkpad X40:
</p
>
1123 <p
><blockquote
>
1124 acpi:IBM0071:PNP0511:
1125 </blockquote
></p
>
1127 <p
>The values between the colons are IDs.
</p
>
1129 <p
><strong
>DMI subtype
</strong
></p
>
1131 <p
>The DMI table contain lots of information about the computer case
1132 and model. This is an entry for a IBM Thinkpad X40, fetched from
1133 /sys/devices/virtual/dmi/id/modalias:
</p
>
1135 <p
><blockquote
>
1136 dmi:bvnIBM:bvr1UETB6WW(
1.66):bd06/
15/
2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
1137 </blockquote
></p
>
1139 <p
>The values present are
</p
>
1142 bvn IBM (BIOS vendor)
1143 bvr
1UETB
6WW(
1.66) (BIOS version)
1144 bd
06/
15/
2005 (BIOS date)
1145 svn IBM (system vendor)
1146 pn
2371H4G (product name)
1147 pvr ThinkPadX40 (product version)
1148 rvn IBM (board vendor)
1149 rn
2371H4G (board name)
1150 rvr NotAvailable (board version)
1151 cvn IBM (chassis vendor)
1152 ct
10 (chassis type)
1153 cvr NotAvailable (chassis version)
1156 <p
>The chassis type
10 is Notebook. Other interesting values can be
1157 found in the dmidecode source:
</p
>
1161 4 Low Profile Desktop
1174 17 Main Server Chassis
1175 18 Expansion Chassis
1177 20 Bus Expansion Chassis
1178 21 Peripheral Chassis
1180 23 Rack Mount Chassis
1189 <p
>The chassis type values are not always accurately set in the DMI
1190 table. For example my home server is a tower, but the DMI modalias
1191 claim it is a desktop.
</p
>
1193 <p
><strong
>SerIO subtype
</strong
></p
>
1195 <p
>This type is used for PS/
2 mouse plugs. One example is from my
1196 test machine:
</p
>
1198 <p
><blockquote
>
1199 serio:ty01pr00id00ex00
1200 </blockquote
></p
>
1202 <p
>The values present are
</p
>
1211 <p
>This type is supported by the psmouse driver. I am not sure what
1212 the valid values are.
</p
>
1214 <p
><strong
>Other subtypes
</strong
></p
>
1216 <p
>There are heaps of other modalias subtypes according to
1217 file2alias.c. There is the rest of the list from that source: amba,
1218 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
1219 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
1220 vmbus, x86cpu and zorro. I did not spend time documenting all of
1221 these, as they do not seem relevant for my intended use with mapping
1222 hardware to packages when new stuff is inserted during run time.
</p
>
1224 <p
><strong
>Looking up kernel modules using modalias values
</strong
></p
>
1226 <p
>To check which kernel modules provide support for a given modalias,
1227 one can use the following shell script:
</p
>
1230 for id in $(find /sys -name modalias -print0 | xargs -
0 cat | sort -u); do \
1231 echo
"$id
" ; \
1232 /sbin/modprobe --show-depends
"$id
"|sed
's/^/ /
' ; \
1236 <p
>The output can look like this (only the first few entries as the
1237 list is very long on my test machine):
</p
>
1241 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/acpi/ac.ko
1243 FATAL: Module acpi:device: not found.
1245 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/char/nvram.ko
1246 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/leds/led-class.ko
1247 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/rfkill/rfkill.ko
1248 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/platform/x86/thinkpad_acpi.ko
1249 acpi:IBM0071:PNP0511:
1250 insmod /lib/modules/
2.6.32-
5-
686/kernel/lib/crc-ccitt.ko
1251 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/irda/irda.ko
1252 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/net/irda/nsc-ircc.ko
1256 <p
>If you want to help implementing a system to let us propose what
1257 packages to install when new hardware is plugged into a Debian
1258 machine, please send me an email or talk to me on
1259 <a href=
"irc://irc.debian.org/%
23debian-devel
">#debian-devel
</a
>.
</p
>
1261 <p
><strong
>Update
2013-
01-
15:
</strong
> Rewrite
"cat $(find ...)
" to
1262 "find ... -print0 | xargs -
0 cat
" to make sure it handle directories
1263 in /sys/ with space in them.
</p
>
1268 <title>Moved the pymissile Debian packaging to collab-maint
</title>
1269 <link>http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html
</link>
1270 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html
</guid>
1271 <pubDate>Thu,
10 Jan
2013 20:
40:
00 +
0100</pubDate>
1272 <description><p
>As part of my investigation on how to improve the support in Debian
1273 for hardware dongles, I dug up my old Mark and Spencer USB Rocket
1274 Launcher and updated the Debian package
1275 <a href=
"http://packages.qa.debian.org/pymissile
">pymissile
</a
> to make
1276 sure udev will fix the device permissions when it is plugged in. I
1277 also added a
"Modaliases
" header to test it in the Debian archive and
1278 hopefully make the package be proposed by jockey in Ubuntu when a user
1279 plug in his rocket launcher. In the process I moved the source to a
1280 git repository under collab-maint, to make it easier for any DD to
1281 contribute.
<a href=
"http://code.google.com/p/pymissile/
">Upstream
</a
>
1282 is not very active, but the software still work for me even after five
1283 years of relative silence. The new git repository is not listed in
1284 the uploaded package yet, because I want to test the other changes a
1285 bit more before I upload the new version. If you want to check out
1286 the new version with a .desktop file included, visit the
1287 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/pymissile.git
">gitweb
1288 view
</a
> or use
"<tt
>git clone
1289 git://anonscm.debian.org/collab-maint/pymissile.git
</tt
>".
</p
>
1294 <title>Lets make hardware dongles easier to use in Debian
</title>
1295 <link>http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
</link>
1296 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
</guid>
1297 <pubDate>Wed,
9 Jan
2013 15:
40:
00 +
0100</pubDate>
1298 <description><p
>One thing that annoys me with Debian and Linux distributions in
1299 general, is that there is a great package management system with the
1300 ability to automatically install software packages by downloading them
1301 from the distribution mirrors, but no way to get it to automatically
1302 install the packages I need to use the hardware I plug into my
1303 machine. Even if the package to use it is easily available from the
1304 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
1305 suggest to automatically install the python-nxt, nbc and t2n packages
1306 I need to talk to it. When I plug in a Yubikey, it could propose the
1307 yubikey-personalization package. The information required to do this
1308 is available, but no-one have pulled all the pieces together.
</p
>
1310 <p
>Some years ago, I proposed to
1311 <a href=
"http://lists.debian.org/debian-devel/
2010/
05/msg01206.html
">use
1312 the discover subsystem to implement this
</a
>. The idea is fairly
1317 <li
>Add a desktop entry in /usr/share/autostart/ pointing to a program
1318 starting when a user log in.
</li
>
1320 <li
>Set this program up to listen for kernel events emitted when new
1321 hardware is inserted into the computer.
</li
>
1323 <li
>When new hardware is inserted, look up the hardware ID in a
1324 database mapping to packages, and take note of any non-installed
1325 packages.
</li
>
1327 <li
>Show a message to the user proposing to install the discovered
1328 package, and make it easy to install it.
</li
>
1332 <p
>I am not sure what the best way to implement this is, but my
1333 initial idea was to use dbus events to discover new hardware, the
1334 discover database to find packages and
1335 <a href=
"http://www.packagekit.org/
">PackageKit
</a
> to install
1338 <p
>Yesterday, I found time to try to implement this idea, and the
1339 draft package is now checked into
1340 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">the
1341 Debian Edu subversion repository
</a
>. In the process, I updated the
1342 <a href=
"http://packages.qa.debian.org/d/discover-data.html
">discover-data
</a
>
1343 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
1344 the relevant packages in Debian, and uploaded a new version
1345 2.2013.01.09 to unstable. I also discovered that the current
1346 <a href=
"http://packages.qa.debian.org/d/discover.html
">discover
</a
>
1347 package in Debian no longer discovered any USB devices, because
1348 /proc/bus/usb/devices is no longer present. I ported it to use
1349 libusb as a fall back option to get it working. The fixed package
1350 version
2.1.2-
6 is now in experimental (didn
't upload it to unstable
1351 because of the freeze).
</p
>
1353 <p
>With this prototype in place, I can insert my Yubikey, and get this
1354 desktop notification to show up (only once, the first time it is
1355 inserted):
</p
>
1357 <p align=
"center
"><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
09-hw-autoinstall.png
"></p
>
1359 <p
>For this prototype to be really useful, some way to automatically
1360 install the proposed packages by pressing the
"Please install
1361 program(s)
" button should to be implemented.
</p
>
1363 <p
>If this idea seem useful to you, and you want to help make it
1364 happen, please help me update the discover-data database with mappings
1365 from hardware to Debian packages. Check if
'discover-pkginstall -l
'
1366 list the package you would like to have installed when a given
1367 hardware device is inserted into your computer, and report bugs using
1368 reportbug if it isn
't. Or, if you know of a better way to provide
1369 such mapping, please let me know.
</p
>
1371 <p
>This prototype need more work, and there are several questions that
1372 should be considered before it is ready for production use. Is dbus
1373 the correct way to detect new hardware? At the moment I look for HAL
1374 dbus events on the system bus, because that is the events I could see
1375 on my Debian Squeeze KDE desktop. Are there better events to use?
1376 How should the user be notified? Is the desktop notification
1377 mechanism the best option, or should the background daemon raise a
1378 popup instead? How should packages be installed? When should they
1379 not be installed?
</p
>
1381 <p
>If you want to help getting such feature implemented in Debian,
1382 please send me an email. :)
</p
>