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