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>Isenkram, Appstream and udev make life as a LEGO builder easier
</title>
11 <link>http://people.skolelinux.org/pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram__Appstream_and_udev_make_life_as_a_LEGO_builder_easier.html
</guid>
13 <pubDate>Fri,
7 Oct
2016 09:
50:
00 +
0200</pubDate>
14 <description><p
><a href=
"http://packages.qa.debian.org/isenkram
">The Isenkram
15 system
</a
> provide a practical and easy way to figure out which
16 packages support the hardware in a given machine. The command line
17 tool
<tt
>isenkram-lookup
</tt
> and the tasksel options provide a
18 convenient way to list and install packages relevant for the current
19 hardware during system installation, both user space packages and
20 firmware packages. The GUI background daemon on the other hand provide
21 a pop-up proposing to install packages when a new dongle is inserted
22 while using the computer. For example, if you plug in a smart card
23 reader, the system will ask if you want to install
<tt
>pcscd
</tt
> if
24 that package isn
't already installed, and if you plug in a USB video
25 camera the system will ask if you want to install
<tt
>cheese
</tt
> if
26 cheese is currently missing. This already work just fine.
</p
>
28 <p
>But Isenkram depend on a database mapping from hardware IDs to
29 package names. When I started no such database existed in Debian, so
30 I made my own data set and included it with the isenkram package and
31 made isenkram fetch the latest version of this database from git using
32 http. This way the isenkram users would get updated package proposals
33 as soon as I learned more about hardware related packages.
</p
>
35 <p
>The hardware is identified using modalias strings. The modalias
36 design is from the Linux kernel where most hardware descriptors are
37 made available as a strings that can be matched using filename style
38 globbing. It handle USB, PCI, DMI and a lot of other hardware related
39 identifiers.
</p
>
41 <p
>The downside to the Isenkram specific database is that there is no
42 information about relevant distribution / Debian version, making
43 isenkram propose obsolete packages too. But along came AppStream, a
44 cross distribution mechanism to store and collect metadata about
45 software packages. When I heard about the proposal, I contacted the
46 people involved and suggested to add a hardware matching rule using
47 modalias strings in the specification, to be able to use AppStream for
48 mapping hardware to packages. This idea was accepted and AppStream is
49 now a great way for a package to announce the hardware it support in a
50 distribution neutral way. I wrote
51 <a href=
"http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
">a
52 recipe on how to add such meta-information
</a
> in a blog post last
53 December. If you have a hardware related package in Debian, please
54 announce the relevant hardware IDs using AppStream.
</p
>
56 <p
>In Debian, almost all packages that can talk to a LEGO Mindestorms
57 RCX or NXT unit, announce this support using AppStream. The effect is
58 that when you insert such LEGO robot controller into your Debian
59 machine, Isenkram will propose to install the packages needed to get
60 it working. The intention is that this should allow the local user to
61 start programming his robot controller right away without having to
62 guess what packages to use or which permissions to fix.
</p
>
64 <p
>But when I sat down with my son the other day to program our NXT
65 unit using his Debian Stretch computer, I discovered something
66 annoying. The local console user (ie my son) did not get access to
67 the USB device for programming the unit. This used to work, but no
68 longer in Jessie and Stretch. After some investigation and asking
69 around on #debian-devel, I discovered that this was because udev had
70 changed the mechanism used to grant access to local devices. The
71 ConsoleKit mechanism from
<tt
>/lib/udev/rules.d/
70-udev-acl.rules
</tt
>
72 no longer applied, because LDAP users no longer was added to the
73 plugdev group during login. Michael Biebl told me that this method
74 was obsolete and the new method used ACLs instead. This was good
75 news, as the plugdev mechanism is a mess when using a remote user
76 directory like LDAP. Using ACLs would make sure a user lost device
77 access when she logged out, even if the user left behind a background
78 process which would retain the plugdev membership with the ConsoleKit
79 setup. Armed with this knowledge I moved on to fix the access problem
80 for the LEGO Mindstorms related packages.
</p
>
82 <p
>The new system uses a udev tag,
'uaccess
'. It can either be
83 applied directly for a device, or is applied in
84 /lib/udev/rules.d/
70-uaccess.rules for classes of devices. As the
85 LEGO Mindstorms udev rules did not have a class, I decided to add the
86 tag directly in the udev rules files included in the packages. Here
87 is one example. For the nqc C compiler for the RCX, the
88 <tt
>/lib/udev/rules.d/
60-nqc.rules
</tt
> file now look like this:
91 SUBSYSTEM==
"usb
", ACTION==
"add
", ATTR{idVendor}==
"0694", ATTR{idProduct}==
"0001", \
92 SYMLINK+=
"rcx-%k
", TAG+=
"uaccess
"
93 </pre
></p
>
95 <p
>The key part is the
'TAG+=
"uaccess
"' at the end. I suspect all
96 packages using plugdev in their /lib/udev/rules.d/ files should be
97 changed to use this tag (either directly or indirectly via
98 <tt
>70-uaccess.rules
</tt
>). Perhaps a lintian check should be created
99 to detect this?
</p
>
101 <p
>I
've been unable to find good documentation on the uaccess feature.
102 It is unclear to me if the uaccess tag is an internal implementation
103 detail like the udev-acl tag used by
104 <tt
>/lib/udev/rules.d/
70-udev-acl.rules
</tt
>. If it is, I guess the
105 indirect method is the preferred way. Michael
106 <a href=
"https://github.com/systemd/systemd/issues/
4288">asked for more
107 documentation from the systemd project
</a
> and I hope it will make
108 this clearer. For now I use the generic classes when they exist and
109 is already handled by
<tt
>70-uaccess.rules
</tt
>, and add the tag
110 directly if no such class exist.
</p
>
112 <p
>To learn more about the isenkram system, please check out
113 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">my
114 blog posts tagged isenkram
</a
>.
</p
>
116 <p
>To help out making life for LEGO constructors in Debian easier,
117 please join us on our IRC channel
118 <a href=
"irc://irc.debian.org/%
23debian-lego
">#debian-lego
</a
> and join
119 the
<a href=
"https://alioth.debian.org/projects/debian-lego/
">Debian
120 LEGO team
</a
> in the Alioth project we created yesterday. A mailing
121 list is not yet created, but we are working on it. :)
</p
>
123 <p
>As usual, if you use Bitcoin and want to show your support of my
124 activities, please send Bitcoin donations to my address
125 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
&label=PetterReinholdtsenBlog
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
130 <title>Isenkram with PackageKit support - new version
0.23 available in Debian unstable
</title>
131 <link>http://people.skolelinux.org/pere/blog/Isenkram_with_PackageKit_support___new_version_0_23_available_in_Debian_unstable.html
</link>
132 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram_with_PackageKit_support___new_version_0_23_available_in_Debian_unstable.html
</guid>
133 <pubDate>Wed,
25 May
2016 10:
20:
00 +
0200</pubDate>
134 <description><p
><a href=
"https://tracker.debian.org/pkg/isenkram
">The isenkram
135 system
</a
> is a user-focused solution in Debian for handling hardware
136 related packages. The idea is to have a database of mappings between
137 hardware and packages, and pop up a dialog suggesting for the user to
138 install the packages to use a given hardware dongle. Some use cases
139 are when you insert a Yubikey, it proposes to install the software
140 needed to control it; when you insert a braille reader list it
141 proposes to install the packages needed to send text to the reader;
142 and when you insert a ColorHug screen calibrator it suggests to
143 install the driver for it. The system work well, and even have a few
144 command line tools to install firmware packages and packages for the
145 hardware already in the machine (as opposed to hotpluggable hardware).
</p
>
147 <p
>The system was initially written using aptdaemon, because I found
148 good documentation and example code on how to use it. But aptdaemon
149 is going away and is generally being replaced by
150 <a href=
"http://www.freedesktop.org/software/PackageKit/
">PackageKit
</a
>,
151 so Isenkram needed a rewrite. And today, thanks to the great patch
152 from my college Sunil Mohan Adapa in the FreedomBox project, the
153 rewrite finally took place. I
've just uploaded a new version of
154 Isenkram into Debian Unstable with the patch included, and the default
155 for the background daemon is now to use PackageKit. To check it out,
156 install the
<tt
>isenkram
</tt
> package and insert some hardware dongle
157 and see if it is recognised.
</p
>
159 <p
>If you want to know what kind of packages isenkram would propose for
160 the machine it is running on, you can check out the isenkram-lookup
161 program. This is what it look like on a Thinkpad X230:
</p
>
163 <p
><blockquote
><pre
>
179 </pre
></blockquote
></p
>
181 <p
>The hardware mappings come from several places. The preferred way
182 is for packages to announce their hardware support using
183 <a href=
"https://www.freedesktop.org/software/appstream/docs/
">the
184 cross distribution appstream system
</a
>.
186 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">previous
187 blog posts about isenkram
</a
> to learn how to do that.
</p
>
192 <title>Using appstream with isenkram to install hardware related packages in Debian
</title>
193 <link>http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</link>
194 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
</guid>
195 <pubDate>Sun,
20 Dec
2015 12:
20:
00 +
0100</pubDate>
196 <description><p
>Around three years ago, I created
197 <a href=
"http://packages.qa.debian.org/isenkram
">the isenkram
198 system
</a
> to get a more practical solution in Debian for handing
199 hardware related packages. A GUI system in the isenkram package will
200 present a pop-up dialog when some hardware dongle supported by
201 relevant packages in Debian is inserted into the machine. The same
202 lookup mechanism to detect packages is available as command line
203 tools in the isenkram-cli package. In addition to mapping hardware,
204 it will also map kernel firmware files to packages and make it easy to
205 install needed firmware packages automatically. The key for this
206 system to work is a good way to map hardware to packages, in other
207 words, allow packages to announce what hardware they will work
210 <p
>I started by providing data files in the isenkram source, and
211 adding code to download the latest version of these data files at run
212 time, to ensure every user had the most up to date mapping available.
213 I also added support for storing the mapping in the Packages file in
214 the apt repositories, but did not push this approach because while I
215 was trying to figure out how to best store hardware/package mappings,
216 <a href=
"http://www.freedesktop.org/software/appstream/docs/
">the
217 appstream system
</a
> was announced. I got in touch and suggested to
218 add the hardware mapping into that data set to be able to use
219 appstream as a data source, and this was accepted at least for the
220 Debian version of appstream.
</p
>
222 <p
>A few days ago using appstream in Debian for this became possible,
223 and today I uploaded a new version
0.20 of isenkram adding support for
224 appstream as a data source for mapping hardware to packages. The only
225 package so far using appstream to announce its hardware support is my
226 pymissile package. I got help from Matthias Klumpp with figuring out
227 how do add the required
228 <a href=
"https://appstream.debian.org/html/sid/main/metainfo/pymissile.html
">metadata
229 in pymissile
</a
>. I added a file debian/pymissile.metainfo.xml with
230 this content:
</p
>
232 <blockquote
><pre
>
233 &lt;?xml version=
"1.0" encoding=
"UTF-
8"?
&gt;
234 &lt;component
&gt;
235 &lt;id
&gt;pymissile
&lt;/id
&gt;
236 &lt;metadata_license
&gt;MIT
&lt;/metadata_license
&gt;
237 &lt;name
&gt;pymissile
&lt;/name
&gt;
238 &lt;summary
&gt;Control original Striker USB Missile Launcher
&lt;/summary
&gt;
239 &lt;description
&gt;
241 Pymissile provides a curses interface to control an original
242 Marks and Spencer / Striker USB Missile Launcher, as well as a
243 motion control script to allow a webcamera to control the
246 &lt;/description
&gt;
247 &lt;provides
&gt;
248 &lt;modalias
&gt;usb:v1130p0202d*
&lt;/modalias
&gt;
249 &lt;/provides
&gt;
250 &lt;/component
&gt;
251 </pre
></blockquote
>
253 <p
>The key for isenkram is the component/provides/modalias value,
254 which is a glob style match rule for hardware specific strings
255 (modalias strings) provided by the Linux kernel. In this case, it
256 will map to all USB devices with vendor code
1130 and product code
259 <p
>Note, it is important that the license of all the metadata files
260 are compatible to have permissions to aggregate them into archive wide
261 appstream files. Matthias suggested to use MIT or BSD licenses for
262 these files. A challenge is figuring out a good id for the data, as
263 it is supposed to be globally unique and shared across distributions
264 (in other words, best to coordinate with upstream what to use). But
265 it can be changed later or, so we went with the package name as
266 upstream for this project is dormant.
</p
>
268 <p
>To get the metadata file installed in the correct location for the
269 mirror update scripts to pick it up and include its content the
270 appstream data source, the file must be installed in the binary
271 package under /usr/share/appdata/. I did this by adding the following
272 line to debian/pymissile.install:
</p
>
274 <blockquote
><pre
>
275 debian/pymissile.metainfo.xml usr/share/appdata
276 </pre
></blockquote
>
278 <p
>With that in place, the command line tool isenkram-lookup will list
279 all packages useful on the current computer automatically, and the GUI
280 pop-up handler will propose to install the package not already
281 installed if a hardware dongle is inserted into the machine in
284 <p
>Details of the modalias field in appstream is available from the
285 <a href=
"https://wiki.debian.org/DEP-
11">DEP-
11</a
> proposal.
</p
>
287 <p
>To locate the modalias values of all hardware present in a machine,
288 try running this command on the command line:
</p
>
290 <blockquote
><pre
>
291 cat $(find /sys/devices/|grep modalias)
292 </pre
></blockquote
>
294 <p
>To learn more about the isenkram system, please check out
295 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">my
296 blog posts tagged isenkram
</a
>.
</p
>
301 <title>Debian Jessie, PXE and automatic firmware installation
</title>
302 <link>http://people.skolelinux.org/pere/blog/Debian_Jessie__PXE_and_automatic_firmware_installation.html
</link>
303 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_Jessie__PXE_and_automatic_firmware_installation.html
</guid>
304 <pubDate>Fri,
17 Oct
2014 14:
10:
00 +
0200</pubDate>
305 <description><p
>When PXE installing laptops with Debian, I often run into the
306 problem that the WiFi card require some firmware to work properly.
307 And it has been a pain to fix this using preseeding in Debian.
308 Normally something more is needed. But thanks to
309 <a href=
"https://packages.qa.debian.org/i/isenkram.html
">my isenkram
310 package
</a
> and its recent tasksel extension, it has now become easy
311 to do this using simple preseeding.
</p
>
313 <p
>The isenkram-cli package provide tasksel tasks which will install
314 firmware for the hardware found in the machine (actually, requested by
315 the kernel modules for the hardware). (It can also install user space
316 programs supporting the hardware detected, but that is not the focus
317 of this story.)
</p
>
319 <p
>To get this working in the default installation, two preeseding
320 values are needed. First, the isenkram-cli package must be installed
321 into the target chroot (aka the hard drive) before tasksel is executed
322 in the pkgsel step of the debian-installer system. This is done by
323 preseeding the base-installer/includes debconf value to include the
324 isenkram-cli package. The package name is next passed to debootstrap
325 for installation. With the isenkram-cli package in place, tasksel
326 will automatically use the isenkram tasks to detect hardware specific
327 packages for the machine being installed and install them, because
328 isenkram-cli contain tasksel tasks.
</p
>
330 <p
>Second, one need to enable the non-free APT repository, because
331 most firmware unfortunately is non-free. This is done by preseeding
332 the apt-mirror-setup step. This is unfortunate, but for a lot of
333 hardware it is the only option in Debian.
</p
>
335 <p
>The end result is two lines needed in your preseeding file to get
336 firmware installed automatically by the installer:
</p
>
338 <p
><blockquote
><pre
>
339 base-installer base-installer/includes string isenkram-cli
340 apt-mirror-setup apt-setup/non-free boolean true
341 </pre
></blockquote
></p
>
343 <p
>The current version of isenkram-cli in testing/jessie will install
344 both firmware and user space packages when using this method. It also
345 do not work well, so use version
0.15 or later. Installing both
346 firmware and user space packages might give you a bit more than you
347 want, so I decided to split the tasksel task in two, one for firmware
348 and one for user space programs. The firmware task is enabled by
349 default, while the one for user space programs is not. This split is
350 implemented in the package currently in unstable.
</p
>
352 <p
>If you decide to give this a go, please let me know (via email) how
353 this recipe work for you. :)
</p
>
355 <p
>So, I bet you are wondering, how can this work. First and
356 foremost, it work because tasksel is modular, and driven by whatever
357 files it find in /usr/lib/tasksel/ and /usr/share/tasksel/. So the
358 isenkram-cli package place two files for tasksel to find. First there
359 is the task description file (/usr/share/tasksel/descs/isenkram.desc):
</p
>
361 <p
><blockquote
><pre
>
362 Task: isenkram-packages
364 Description: Hardware specific packages (autodetected by isenkram)
365 Based on the detected hardware various hardware specific packages are
367 Test-new-install: show show
369 Packages: for-current-hardware
371 Task: isenkram-firmware
373 Description: Hardware specific firmware packages (autodetected by isenkram)
374 Based on the detected hardware various hardware specific firmware
375 packages are proposed.
376 Test-new-install: mark show
378 Packages: for-current-hardware-firmware
379 </pre
></blockquote
></p
>
381 <p
>The key parts are Test-new-install which indicate how the task
382 should be handled and the Packages line referencing to a script in
383 /usr/lib/tasksel/packages/. The scripts use other scripts to get a
384 list of packages to install. The for-current-hardware-firmware script
385 look like this to list relevant firmware for the machine:
387 <p
><blockquote
><pre
>
392 isenkram-autoinstall-firmware -l
393 </pre
></blockquote
></p
>
395 <p
>With those two pieces in place, the firmware is installed by
396 tasksel during the normal d-i run. :)
</p
>
398 <p
>If you want to test what tasksel will install when isenkram-cli is
399 installed, run
<tt
>DEBIAN_PRIORITY=critical tasksel --test
400 --new-install
</tt
> to get the list of packages that tasksel would
403 <p
><a href=
"https://wiki.debian.org/DebianEdu/
">Debian Edu
</a
> will be
404 pilots in testing this feature, as isenkram is used there now to
405 install firmware, replacing the earlier scripts.
</p
>
410 <title>Install hardware dependent packages using tasksel (Isenkram
0.7)
</title>
411 <link>http://people.skolelinux.org/pere/blog/Install_hardware_dependent_packages_using_tasksel__Isenkram_0_7_.html
</link>
412 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Install_hardware_dependent_packages_using_tasksel__Isenkram_0_7_.html
</guid>
413 <pubDate>Wed,
23 Apr
2014 14:
50:
00 +
0200</pubDate>
414 <description><p
>It would be nice if it was easier in Debian to get all the hardware
415 related packages relevant for the computer installed automatically.
416 So I implemented one, using
417 <a href=
"http://packages.qa.debian.org/isenkram
">my Isenkram
418 package
</a
>. To use it, install the tasksel and isenkram packages and
419 run tasksel as user root. You should be presented with a new option,
420 "Hardware specific packages (autodetected by isenkram)
". When you
421 select it, tasksel will install the packages isenkram claim is fit for
422 the current hardware, hot pluggable or not.
<p
>
424 <p
>The implementation is in two files, one is the tasksel menu entry
425 description, and the other is the script used to extract the list of
426 packages to install. The first part is in
427 <tt
>/usr/share/tasksel/descs/isenkram.desc
</tt
> and look like
430 <p
><blockquote
><pre
>
433 Description: Hardware specific packages (autodetected by isenkram)
434 Based on the detected hardware various hardware specific packages are
436 Test-new-install: mark show
438 Packages: for-current-hardware
439 </pre
></blockquote
></p
>
441 <p
>The second part is in
442 <tt
>/usr/lib/tasksel/packages/for-current-hardware
</tt
> and look like
445 <p
><blockquote
><pre
>
450 isenkram-autoinstall-firmware -l
452 </pre
></blockquote
></p
>
454 <p
>All in all, a very short and simple implementation making it
455 trivial to install the hardware dependent package we all may want to
456 have installed on our machines. I
've not been able to find a way to
457 get tasksel to tell you exactly which packages it plan to install
458 before doing the installation. So if you are curious or careful,
459 check the output from the isenkram-* command line tools first.
</p
>
461 <p
>The information about which packages are handling which hardware is
462 fetched either from the isenkram package itself in
463 /usr/share/isenkram/, from git.debian.org or from the APT package
464 database (using the Modaliases header). The APT package database
465 parsing have caused a nasty resource leak in the isenkram daemon (bugs
466 <a href=
"http://bugs.debian.org/
719837">#
719837</a
> and
467 <a href=
"http://bugs.debian.org/
730704">#
730704</a
>). The cause is in
468 the python-apt code (bug
469 <a href=
"http://bugs.debian.org/
745487">#
745487</a
>), but using a
470 workaround I was able to get rid of the file descriptor leak and
471 reduce the memory leak from ~
30 MiB per hardware detection down to
472 around
2 MiB per hardware detection. It should make the desktop
473 daemon a lot more useful. The fix is in version
0.7 uploaded to
474 unstable today.
</p
>
476 <p
>I believe the current way of mapping hardware to packages in
477 Isenkram is is a good draft, but in the future I expect isenkram to
478 use the AppStream data source for this. A proposal for getting proper
479 AppStream support into Debian is floating around as
480 <a href=
"https://wiki.debian.org/DEP-
11">DEP-
11</a
>, and
481 <a href=
"https://wiki.debian.org/SummerOfCode2014/Projects#SummerOfCode2014.2FProjects
.2FAppStreamDEP11Implementation.AppStream
.2FDEP-
11_for_the_Debian_Archive
">GSoC
482 project
</a
> will take place this summer to improve the situation. I
483 look forward to seeing the result, and welcome patches for isenkram to
484 start using the information when it is ready.
</p
>
486 <p
>If you want your package to map to some specific hardware, either
487 add a
"Xb-Modaliases
" header to your control file like I did in
488 <a href=
"http://packages.qa.debian.org/pymissile
">the pymissile
489 package
</a
> or submit a bug report with the details to the isenkram
491 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">all my
492 blog posts tagged isenkram
</a
> for details on the notation. I expect
493 the information will be migrated to AppStream eventually, but for the
494 moment I got no better place to store it.
</p
>
499 <title>Automatically locate and install required firmware packages on Debian (Isenkram
0.4)
</title>
500 <link>http://people.skolelinux.org/pere/blog/Automatically_locate_and_install_required_firmware_packages_on_Debian__Isenkram_0_4_.html
</link>
501 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Automatically_locate_and_install_required_firmware_packages_on_Debian__Isenkram_0_4_.html
</guid>
502 <pubDate>Tue,
25 Jun
2013 11:
50:
00 +
0200</pubDate>
503 <description><p
>It annoys me when the computer fail to do automatically what it is
504 perfectly capable of, and I have to do it manually to get things
505 working. One such task is to find out what firmware packages are
506 needed to get the hardware on my computer working. Most often this
507 affect the wifi card, but some times it even affect the RAID
508 controller or the ethernet card. Today I pushed version
0.4 of the
509 <a href=
"http://packages.qa.debian.org/isenkram
">Isenkram package
</a
>
510 including a new script isenkram-autoinstall-firmware handling the
511 process of asking all the loaded kernel modules what firmware files
512 they want, find debian packages providing these files and install the
513 debian packages. Here is a test run on my laptop:
</p
>
516 # isenkram-autoinstall-firmware
517 info: kernel drivers requested extra firmware: ipw2200-bss.fw ipw2200-ibss.fw ipw2200-sniffer.fw
518 info: fetching http://http.debian.net/debian/dists/squeeze/Contents-i386.gz
519 info: locating packages with the requested firmware files
520 info: Updating APT sources after adding non-free APT source
521 info: trying to install firmware-ipw2x00
524 Preconfiguring packages ...
525 Selecting previously deselected package firmware-ipw2x00.
526 (Reading database ...
259727 files and directories currently installed.)
527 Unpacking firmware-ipw2x00 (from .../firmware-ipw2x00_0.28+squeeze1_all.deb) ...
528 Setting up firmware-ipw2x00 (
0.28+squeeze1) ...
530 </pre
></p
>
532 <p
>When all the requested firmware is present, a simple message is
533 printed instead:
</p
>
536 # isenkram-autoinstall-firmware
537 info: did not find any firmware files requested by loaded kernel modules. exiting
539 </pre
></p
>
541 <p
>It could use some polish, but it is already working well and saving
542 me some time when setting up new machines. :)
</p
>
544 <p
>So, how does it work? It look at the set of currently loaded
545 kernel modules, and look up each one of them using modinfo, to find
546 the firmware files listed in the module meta-information. Next, it
547 download the Contents file from a nearby APT mirror, and search for
548 the firmware files in this file to locate the package with the
549 requested firmware file. If the package is in the non-free section, a
550 non-free APT source is added and the package is installed using
551 <tt
>apt-get install
</tt
>. The end result is a slightly better working
554 <p
>I hope someone find time to implement a more polished version of
555 this script as part of the hw-detect debian-installer module, to
556 finally fix
<a href=
"http://bugs.debian.org/
655507">BTS report
557 #
655507</a
>. There really is no need to insert USB sticks with
558 firmware during a PXE install when the packages already are available
559 from the nearby Debian mirror.
</p
>
564 <title>Isenkram
0.2 finally in the Debian archive
</title>
565 <link>http://people.skolelinux.org/pere/blog/Isenkram_0_2_finally_in_the_Debian_archive.html
</link>
566 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram_0_2_finally_in_the_Debian_archive.html
</guid>
567 <pubDate>Wed,
3 Apr
2013 23:
40:
00 +
0200</pubDate>
568 <description><p
>Today the
<a href=
"http://packages.qa.debian.org/isenkram
">Isenkram
569 package
</a
> finally made it into the archive, after lingering in NEW
570 for many months. I uploaded it to the Debian experimental suite
571 2013-
01-
27, and today it was accepted into the archive.
</p
>
573 <p
>Isenkram is a system for suggesting to users what packages to
574 install to work with a pluggable hardware device. The suggestion pop
575 up when the device is plugged in. For example if a Lego Mindstorm NXT
576 is inserted, it will suggest to install the program needed to program
577 the NXT controller. Give it a go, and report bugs and suggestions to
583 <title>Welcome to the world, Isenkram!
</title>
584 <link>http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
</link>
585 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
</guid>
586 <pubDate>Tue,
22 Jan
2013 22:
00:
00 +
0100</pubDate>
587 <description><p
>Yesterday, I
588 <a href=
"http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
">asked
589 for testers
</a
> for my prototype for making Debian better at handling
590 pluggable hardware devices, which I
591 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">set
592 out to create
</a
> earlier this month. Several valuable testers showed
593 up, and caused me to really want to to open up the development to more
594 people. But before I did this, I want to come up with a sensible name
595 for this project. Today I finally decided on a new name, and I have
596 renamed the project from hw-support-handler to this new name. In the
597 process, I moved the source to git and made it available as a
598 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git
">collab-maint
</a
>
599 repository in Debian. The new name? It is
<strong
>Isenkram
</strong
>.
600 To fetch and build the latest version of the source, use
</p
>
603 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
604 cd isenkram
&& git-buildpackage -us -uc
607 <p
>I have not yet adjusted all files to use the new name yet. If you
608 want to hack on the source or improve the package, please go ahead.
609 But please talk to me first on IRC or via email before you do major
610 changes, to make sure we do not step on each others toes. :)
</p
>
612 <p
>If you wonder what
'isenkram
' is, it is a Norwegian word for iron
613 stuff, typically meaning tools, nails, screws, etc. Typical hardware
614 stuff, in other words. I
've been told it is the Norwegian variant of
615 the German word eisenkram, for those that are familiar with that
618 <p
><strong
>Update
2013-
01-
26</strong
>: Added -us -us to build
619 instructions, to avoid confusing people with an error from the signing
622 <p
><strong
>Update
2013-
01-
27</strong
>: Switch to HTTP URL for the git
623 clone argument to avoid the need for authentication.
</p
>
628 <title>First prototype ready making hardware easier to use in Debian
</title>
629 <link>http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
</link>
630 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
</guid>
631 <pubDate>Mon,
21 Jan
2013 12:
00:
00 +
0100</pubDate>
632 <description><p
>Early this month I set out to try to
633 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">improve
634 the Debian support for pluggable hardware devices
</a
>. Now my
635 prototype is working, and it is ready for a larger audience. To test
637 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">source
638 from the Debian Edu subversion repository
</a
>, build and install the
639 package. You might have to log out and in again activate the
640 autostart script.
</p
>
642 <p
>The design is simple:
</p
>
646 <li
>Add desktop entry in /usr/share/autostart/ causing a program
647 hw-support-handlerd to start when the user log in.
</li
>
649 <li
>This program listen for kernel events about new hardware (directly
650 from the kernel like udev does), not using HAL dbus events as I
651 initially did.
</li
>
653 <li
>When new hardware is inserted, look up the hardware modalias in
654 the APT database, a database
655 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup
">available
656 via HTTP
</a
> and a database available as part of the package.
</li
>
658 <li
>If a package is mapped to the hardware in question, the package
659 isn
't installed yet and this is the first time the hardware was
660 plugged in, show a desktop notification suggesting to install the
661 package or packages.
</li
>
663 <li
>If the user click on the
'install package now
' button, ask
664 aptdaemon via the PackageKit API to install the requrired package.
</li
>
666 <li
>aptdaemon ask for root password or sudo password, and install the
667 package while showing progress information in a window.
</li
>
671 <p
>I still need to come up with a better name for the system. Here
672 are some screen shots showing the prototype in action. First the
673 notification, then the password request, and finally the request to
674 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.
</p
>
676 <p
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
1-notification.png
">
677 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
2-password.png
">
678 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
3-dependencies.png
">
679 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
4-installing.png
">
680 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
5-installing-details.png
" width=
"70%
"></p
>
682 <p
>The prototype still need to be improved with longer timeouts, but
683 is already useful. The database of hardware to package mappings also
684 need more work. It is currently compatible with the Ubuntu way of
685 storing such information in the package control file, but could be
686 changed to use other formats instead or in addition to the current
687 method. I
've dropped the use of discover for this mapping, as the
688 modalias approach is more flexible and easier to use on Linux as long
689 as the Linux kernel expose its modalias strings directly.
</p
>
691 <p
><strong
>Update
2013-
01-
21 16:
50</strong
>: Due to popular demand,
692 here is the command required to check out and build the source: Use
693 '<tt
>svn checkout
694 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
695 hw-support-handler; debuild
</tt
>'. If you lack debuild, install the
696 devscripts package.
</p
>
698 <p
><strong
>Update
2013-
01-
23 12:
00</strong
>: The project is now
699 renamed to Isenkram and the source moved from the Debian Edu
700 subversion repository to a Debian collab-maint git repository. See
701 <a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
">build
702 instructions
</a
> for details.
</p
>
707 <title>Using modalias info to find packages handling my hardware
</title>
708 <link>http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html
</link>
709 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html
</guid>
710 <pubDate>Tue,
15 Jan
2013 08:
00:
00 +
0100</pubDate>
711 <description><p
>Yesterday, I wrote about the
712 <a href=
"http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
">modalias
713 values provided by the Linux kernel
</a
> following my hope for
714 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">better
715 dongle support in Debian
</a
>. Using this knowledge, I have tested how
716 modalias values attached to package names can be used to map packages
717 to hardware. This allow the system to look up and suggest relevant
718 packages when I plug in some new hardware into my machine, and replace
719 discover and discover-data as the database used to map hardware to
722 <p
>I create a modaliases file with entries like the following,
723 containing package name, kernel module name (if relevant, otherwise
724 the package name) and globs matching the relevant hardware
727 <p
><blockquote
>
728 Package: package-name
729 <br
>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)
</p
>
730 </blockquote
></p
>
732 <p
>It is fairly trivial to write code to find the relevant packages
733 for a given modalias value using this file.
</p
>
735 <p
>An entry like this would suggest the video and picture application
736 cheese for many USB web cameras (interface bus class
0E01):
</p
>
738 <p
><blockquote
>
740 <br
>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)
</p
>
741 </blockquote
></p
>
743 <p
>An entry like this would suggest the pcmciautils package when a
744 CardBus bridge (bus class
0607) PCI device is present:
</p
>
746 <p
><blockquote
>
748 <br
>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
749 </blockquote
></p
>
751 <p
>An entry like this would suggest the package colorhug-client when
752 plugging in a ColorHug with USB IDs
04D8:F8DA:
</p
>
754 <p
><blockquote
>
755 Package: colorhug-client
756 <br
>Modaliases: colorhug-client(usb:v04D8pF8DAd*)
</p
>
757 </blockquote
></p
>
759 <p
>I believe the format is compatible with the format of the Packages
760 file in the Debian archive. Ubuntu already uses their Packages file
761 to store their mappings from packages to hardware.
</p
>
763 <p
>By adding a XB-Modaliases: header in debian/control, any .deb can
764 announce the hardware it support in a way my prototype understand.
765 This allow those publishing packages in an APT source outside the
766 Debian archive as well as those backporting packages to make sure the
767 hardware mapping are included in the package meta information. I
've
768 tested such header in the pymissile package, and its modalias mapping
769 is working as it should with my prototype. It even made it to Ubuntu
772 <p
>To test if it was possible to look up supported hardware using only
773 the shell tools available in the Debian installer, I wrote a shell
774 implementation of the lookup code. The idea is to create files for
775 each modalias and let the shell do the matching. Please check out and
777 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co
">hw-support-lookup
</a
>
778 shell script. It run without any extra dependencies and fetch the
779 hardware mappings from the Debian archive and the subversion
780 repository where I currently work on my prototype.
</p
>
782 <p
>When I use it on a machine with a yubikey inserted, it suggest to
783 install yubikey-personalization:
</p
>
785 <p
><blockquote
>
786 % ./hw-support-lookup
787 <br
>yubikey-personalization
789 </blockquote
></p
>
791 <p
>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
792 propose to install the pcmciautils package:
</p
>
794 <p
><blockquote
>
795 % ./hw-support-lookup
796 <br
>pcmciautils
798 </blockquote
></p
>
800 <p
>If you know of any hardware-package mapping that should be added to
801 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co
">my
802 database
</a
>, please tell me about it.
</p
>
804 <p
>It could be possible to generate several of the mappings between
805 packages and hardware. One source would be to look at packages with
806 kernel modules, ie packages with *.ko files in /lib/modules/, and
807 extract their modalias information. Another would be to look at
808 packages with udev rules, ie packages with files in
809 /lib/udev/rules.d/, and extract their vendor/model information to
810 generate a modalias matching rule. I have not tested any of these to
811 see if it work.
</p
>
813 <p
>If you want to help implementing a system to let us propose what
814 packages to install when new hardware is plugged into a Debian
815 machine, please send me an email or talk to me on
816 <a href=
"irc://irc.debian.org/%
23debian-devel
">#debian-devel
</a
>.
</p
>
821 <title>Modalias strings - a practical way to map
"stuff
" to hardware
</title>
822 <link>http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
</link>
823 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
</guid>
824 <pubDate>Mon,
14 Jan
2013 11:
20:
00 +
0100</pubDate>
825 <description><p
>While looking into how to look up Debian packages based on hardware
826 information, to find the packages that support a given piece of
827 hardware, I refreshed my memory regarding modalias values, and decided
828 to document the details. Here are my findings so far, also available
830 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">the
831 Debian Edu subversion repository
</a
>:
833 <p
><strong
>Modalias decoded
</strong
></p
>
835 <p
>This document try to explain what the different types of modalias
836 values stands for. It is in part based on information from
837 &lt;URL:
<a href=
"https://wiki.archlinux.org/index.php/Modalias
">https://wiki.archlinux.org/index.php/Modalias
</a
> &gt;,
838 &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;,
839 &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
840 &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;.
842 <p
>The modalias entries for a given Linux machine can be found using
843 this shell script:
</p
>
846 find /sys -name modalias -print0 | xargs -
0 cat | sort -u
849 <p
>The supported modalias globs for a given kernel module can be found
850 using modinfo:
</p
>
853 % /sbin/modinfo psmouse | grep alias:
854 alias: serio:ty05pr*id*ex*
855 alias: serio:ty01pr*id*ex*
859 <p
><strong
>PCI subtype
</strong
></p
>
861 <p
>A typical PCI entry can look like this. This is an Intel Host
862 Bridge memory controller:
</p
>
864 <p
><blockquote
>
865 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
866 </blockquote
></p
>
868 <p
>This represent these values:
</p
>
873 sv
00001028 (subvendor)
874 sd
000001AD (subdevice)
880 <p
>The vendor/device values are the same values outputted from
'lspci
881 -n
' as
8086:
2770. The bus class/subclass is also shown by lspci as
882 0600. The
0600 class is a host bridge. Other useful bus values are
883 0300 (VGA compatible card) and
0200 (Ethernet controller).
</p
>
885 <p
>Not sure how to figure out the interface value, nor what it
888 <p
><strong
>USB subtype
</strong
></p
>
890 <p
>Some typical USB entries can look like this. This is an internal
891 USB hub in a laptop:
</p
>
893 <p
><blockquote
>
894 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
895 </blockquote
></p
>
897 <p
>Here is the values included in this alias:
</p
>
900 v
1D6B (device vendor)
901 p
0001 (device product)
904 dsc
00 (device subclass)
905 dp
00 (device protocol)
906 ic
09 (interface class)
907 isc
00 (interface subclass)
908 ip
00 (interface protocol)
911 <p
>The
0900 device class/subclass means hub. Some times the relevant
912 class is in the interface class section. For a simple USB web camera,
913 these alias entries show up:
</p
>
915 <p
><blockquote
>
916 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
917 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
918 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
919 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
920 </blockquote
></p
>
922 <p
>Interface class
0E01 is video control,
0E02 is video streaming (aka
923 camera),
0101 is audio control device and
0102 is audio streaming (aka
924 microphone). Thus this is a camera with microphone included.
</p
>
926 <p
><strong
>ACPI subtype
</strong
></p
>
928 <p
>The ACPI type is used for several non-PCI/USB stuff. This is an IR
929 receiver in a Thinkpad X40:
</p
>
931 <p
><blockquote
>
932 acpi:IBM0071:PNP0511:
933 </blockquote
></p
>
935 <p
>The values between the colons are IDs.
</p
>
937 <p
><strong
>DMI subtype
</strong
></p
>
939 <p
>The DMI table contain lots of information about the computer case
940 and model. This is an entry for a IBM Thinkpad X40, fetched from
941 /sys/devices/virtual/dmi/id/modalias:
</p
>
943 <p
><blockquote
>
944 dmi:bvnIBM:bvr1UETB6WW(
1.66):bd06/
15/
2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
945 </blockquote
></p
>
947 <p
>The values present are
</p
>
950 bvn IBM (BIOS vendor)
951 bvr
1UETB
6WW(
1.66) (BIOS version)
952 bd
06/
15/
2005 (BIOS date)
953 svn IBM (system vendor)
954 pn
2371H4G (product name)
955 pvr ThinkPadX40 (product version)
956 rvn IBM (board vendor)
957 rn
2371H4G (board name)
958 rvr NotAvailable (board version)
959 cvn IBM (chassis vendor)
961 cvr NotAvailable (chassis version)
964 <p
>The chassis type
10 is Notebook. Other interesting values can be
965 found in the dmidecode source:
</p
>
969 4 Low Profile Desktop
982 17 Main Server Chassis
985 20 Bus Expansion Chassis
986 21 Peripheral Chassis
988 23 Rack Mount Chassis
997 <p
>The chassis type values are not always accurately set in the DMI
998 table. For example my home server is a tower, but the DMI modalias
999 claim it is a desktop.
</p
>
1001 <p
><strong
>SerIO subtype
</strong
></p
>
1003 <p
>This type is used for PS/
2 mouse plugs. One example is from my
1004 test machine:
</p
>
1006 <p
><blockquote
>
1007 serio:ty01pr00id00ex00
1008 </blockquote
></p
>
1010 <p
>The values present are
</p
>
1019 <p
>This type is supported by the psmouse driver. I am not sure what
1020 the valid values are.
</p
>
1022 <p
><strong
>Other subtypes
</strong
></p
>
1024 <p
>There are heaps of other modalias subtypes according to
1025 file2alias.c. There is the rest of the list from that source: amba,
1026 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
1027 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
1028 vmbus, x86cpu and zorro. I did not spend time documenting all of
1029 these, as they do not seem relevant for my intended use with mapping
1030 hardware to packages when new stuff is inserted during run time.
</p
>
1032 <p
><strong
>Looking up kernel modules using modalias values
</strong
></p
>
1034 <p
>To check which kernel modules provide support for a given modalias,
1035 one can use the following shell script:
</p
>
1038 for id in $(find /sys -name modalias -print0 | xargs -
0 cat | sort -u); do \
1039 echo
"$id
" ; \
1040 /sbin/modprobe --show-depends
"$id
"|sed
's/^/ /
' ; \
1044 <p
>The output can look like this (only the first few entries as the
1045 list is very long on my test machine):
</p
>
1049 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/acpi/ac.ko
1051 FATAL: Module acpi:device: not found.
1053 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/char/nvram.ko
1054 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/leds/led-class.ko
1055 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/rfkill/rfkill.ko
1056 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/platform/x86/thinkpad_acpi.ko
1057 acpi:IBM0071:PNP0511:
1058 insmod /lib/modules/
2.6.32-
5-
686/kernel/lib/crc-ccitt.ko
1059 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/irda/irda.ko
1060 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/net/irda/nsc-ircc.ko
1064 <p
>If you want to help implementing a system to let us propose what
1065 packages to install when new hardware is plugged into a Debian
1066 machine, please send me an email or talk to me on
1067 <a href=
"irc://irc.debian.org/%
23debian-devel
">#debian-devel
</a
>.
</p
>
1069 <p
><strong
>Update
2013-
01-
15:
</strong
> Rewrite
"cat $(find ...)
" to
1070 "find ... -print0 | xargs -
0 cat
" to make sure it handle directories
1071 in /sys/ with space in them.
</p
>
1076 <title>Moved the pymissile Debian packaging to collab-maint
</title>
1077 <link>http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html
</link>
1078 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html
</guid>
1079 <pubDate>Thu,
10 Jan
2013 20:
40:
00 +
0100</pubDate>
1080 <description><p
>As part of my investigation on how to improve the support in Debian
1081 for hardware dongles, I dug up my old Mark and Spencer USB Rocket
1082 Launcher and updated the Debian package
1083 <a href=
"http://packages.qa.debian.org/pymissile
">pymissile
</a
> to make
1084 sure udev will fix the device permissions when it is plugged in. I
1085 also added a
"Modaliases
" header to test it in the Debian archive and
1086 hopefully make the package be proposed by jockey in Ubuntu when a user
1087 plug in his rocket launcher. In the process I moved the source to a
1088 git repository under collab-maint, to make it easier for any DD to
1089 contribute.
<a href=
"http://code.google.com/p/pymissile/
">Upstream
</a
>
1090 is not very active, but the software still work for me even after five
1091 years of relative silence. The new git repository is not listed in
1092 the uploaded package yet, because I want to test the other changes a
1093 bit more before I upload the new version. If you want to check out
1094 the new version with a .desktop file included, visit the
1095 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/pymissile.git
">gitweb
1096 view
</a
> or use
"<tt
>git clone
1097 git://anonscm.debian.org/collab-maint/pymissile.git
</tt
>".
</p
>
1102 <title>Lets make hardware dongles easier to use in Debian
</title>
1103 <link>http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
</link>
1104 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
</guid>
1105 <pubDate>Wed,
9 Jan
2013 15:
40:
00 +
0100</pubDate>
1106 <description><p
>One thing that annoys me with Debian and Linux distributions in
1107 general, is that there is a great package management system with the
1108 ability to automatically install software packages by downloading them
1109 from the distribution mirrors, but no way to get it to automatically
1110 install the packages I need to use the hardware I plug into my
1111 machine. Even if the package to use it is easily available from the
1112 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
1113 suggest to automatically install the python-nxt, nbc and t2n packages
1114 I need to talk to it. When I plug in a Yubikey, it could propose the
1115 yubikey-personalization package. The information required to do this
1116 is available, but no-one have pulled all the pieces together.
</p
>
1118 <p
>Some years ago, I proposed to
1119 <a href=
"http://lists.debian.org/debian-devel/
2010/
05/msg01206.html
">use
1120 the discover subsystem to implement this
</a
>. The idea is fairly
1125 <li
>Add a desktop entry in /usr/share/autostart/ pointing to a program
1126 starting when a user log in.
</li
>
1128 <li
>Set this program up to listen for kernel events emitted when new
1129 hardware is inserted into the computer.
</li
>
1131 <li
>When new hardware is inserted, look up the hardware ID in a
1132 database mapping to packages, and take note of any non-installed
1133 packages.
</li
>
1135 <li
>Show a message to the user proposing to install the discovered
1136 package, and make it easy to install it.
</li
>
1140 <p
>I am not sure what the best way to implement this is, but my
1141 initial idea was to use dbus events to discover new hardware, the
1142 discover database to find packages and
1143 <a href=
"http://www.packagekit.org/
">PackageKit
</a
> to install
1146 <p
>Yesterday, I found time to try to implement this idea, and the
1147 draft package is now checked into
1148 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">the
1149 Debian Edu subversion repository
</a
>. In the process, I updated the
1150 <a href=
"http://packages.qa.debian.org/d/discover-data.html
">discover-data
</a
>
1151 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
1152 the relevant packages in Debian, and uploaded a new version
1153 2.2013.01.09 to unstable. I also discovered that the current
1154 <a href=
"http://packages.qa.debian.org/d/discover.html
">discover
</a
>
1155 package in Debian no longer discovered any USB devices, because
1156 /proc/bus/usb/devices is no longer present. I ported it to use
1157 libusb as a fall back option to get it working. The fixed package
1158 version
2.1.2-
6 is now in experimental (didn
't upload it to unstable
1159 because of the freeze).
</p
>
1161 <p
>With this prototype in place, I can insert my Yubikey, and get this
1162 desktop notification to show up (only once, the first time it is
1163 inserted):
</p
>
1165 <p align=
"center
"><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
09-hw-autoinstall.png
"></p
>
1167 <p
>For this prototype to be really useful, some way to automatically
1168 install the proposed packages by pressing the
"Please install
1169 program(s)
" button should to be implemented.
</p
>
1171 <p
>If this idea seem useful to you, and you want to help make it
1172 happen, please help me update the discover-data database with mappings
1173 from hardware to Debian packages. Check if
'discover-pkginstall -l
'
1174 list the package you would like to have installed when a given
1175 hardware device is inserted into your computer, and report bugs using
1176 reportbug if it isn
't. Or, if you know of a better way to provide
1177 such mapping, please let me know.
</p
>
1179 <p
>This prototype need more work, and there are several questions that
1180 should be considered before it is ready for production use. Is dbus
1181 the correct way to detect new hardware? At the moment I look for HAL
1182 dbus events on the system bus, because that is the events I could see
1183 on my Debian Squeeze KDE desktop. Are there better events to use?
1184 How should the user be notified? Is the desktop notification
1185 mechanism the best option, or should the background daemon raise a
1186 popup instead? How should packages be installed? When should they
1187 not be installed?
</p
>
1189 <p
>If you want to help getting such feature implemented in Debian,
1190 please send me an email. :)
</p
>