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>Debian Jessie, PXE and automatic firmware installation
</title>
11 <link>http://people.skolelinux.org/pere/blog/Debian_Jessie__PXE_and_automatic_firmware_installation.html
</link>
12 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Debian_Jessie__PXE_and_automatic_firmware_installation.html
</guid>
13 <pubDate>Fri,
17 Oct
2014 14:
10:
00 +
0200</pubDate>
14 <description><p
>When PXE installing laptops with Debian, I often run into the
15 problem that the WiFi card require some firmware to work properly.
16 And it has been a pain to fix this using preseeding in Debian.
17 Normally something more is needed. But thanks to
18 <a href=
"https://packages.qa.debian.org/i/isenkram.html
">my isenkram
19 package
</a
> and its recent tasksel extension, it has now become easy
20 to do this using simple preseeding.
</p
>
22 <p
>The isenkram-cli package provide tasksel tasks which will install
23 firmware for the hardware found in the machine (actually, requested by
24 the kernel modules for the hardware). (It can also install user space
25 programs supporting the hardware detected, but that is not the focus
26 of this story.)
</p
>
28 <p
>To get this working in the default installation, two preeseding
29 values are needed. First, the isenkram-cli package must be installed
30 into the target chroot (aka the hard drive) before tasksel is executed
31 in the pkgsel step of the debian-installer system. This is done by
32 preseeding the base-installer/includes debconf value to include the
33 isenkram-cli package. The package name is next passed to debootstrap
34 for installation. With the isenkram-cli package in place, tasksel
35 will automatically use the isenkram tasks to detect hardware specific
36 packages for the machine being installed and install them, because
37 isenkram-cli contain tasksel tasks.
</p
>
39 <p
>Second, one need to enable the non-free APT repository, because
40 most firmware unfortunately is non-free. This is done by preseeding
41 the apt-mirror-setup step. This is unfortunate, but for a lot of
42 hardware it is the only option in Debian.
</p
>
44 <p
>The end result is two lines needed in your preseeding file to get
45 firmware installed automatically by the installer:
</p
>
47 <p
><blockquote
><pre
>
48 base-installer base-installer/includes string isenkram-cli
49 apt-mirror-setup apt-setup/non-free boolean true
50 </pre
></blockquote
></p
>
52 <p
>The current version of isenkram-cli in testing/jessie will install
53 both firmware and user space packages when using this method. It also
54 do not work well, so use version
0.15 or later. Installing both
55 firmware and user space packages might give you a bit more than you
56 want, so I decided to split the tasksel task in two, one for firmware
57 and one for user space programs. The firmware task is enabled by
58 default, while the one for user space programs is not. This split is
59 implemented in the package currently in unstable.
</p
>
61 <p
>If you decide to give this a go, please let me know (via email) how
62 this recipe work for you if you decide to give it a go. :)
</p
>
64 <p
>So, I bet you are wondering, how can this work. First and
65 foremost, it work because tasksel is modular, and driven by whatever
66 files it find in /usr/lib/tasksel/ and /usr/share/tasksel/. So the
67 isenkram-cli package place two files for tasksel to find. First there
68 is the task description file (/usr/share/tasksel/descs/isenkram.desc):
</p
>
70 <p
><blockquote
><pre
>
71 Task: isenkram-packages
73 Description: Hardware specific packages (autodetected by isenkram)
74 Based on the detected hardware various hardware specific packages are
76 Test-new-install: show show
78 Packages: for-current-hardware
80 Task: isenkram-firmware
82 Description: Hardware specific firmware packages (autodetected by isenkram)
83 Based on the detected hardware various hardware specific firmware
84 packages are proposed.
85 Test-new-install: mark show
87 Packages: for-current-hardware-firmware
88 </pre
></blockquote
></p
>
90 <p
>The key parts are Test-new-install which indicate how the task
91 should be handled and the Packages line referencing to a script in
92 /usr/lib/tasksel/packages/. The scripts use other scripts to get a
93 list of packages to install. The for-current-hardware-firmware script
94 look like this to list relevant firmware for the machine:
96 <p
><blockquote
><pre
>
101 isenkram-autoinstall-firmware -l
102 </pre
></blockquote
></p
>
104 <p
>With those two pieces in place, the firmware is installed by
105 tasksel during the normal d-i run. :)
</p
>
107 <p
>If you want to test what tasksel will install when isenkram-cli is
108 installed, run
<tt
>DEBIAN_PRIORITY=critical tasksel --test
109 --new-install
</tt
> to get the list of packages that tasksel would
112 <p
><ahref=
"https://wiki.debian.org/DebianEdu/
">Debian Edu
</a
> will be
113 pilots in testing this feature, as isenkram is used to install
114 firmware now.
</p
>
119 <title>Install hardware dependent packages using tasksel (Isenkram
0.7)
</title>
120 <link>http://people.skolelinux.org/pere/blog/Install_hardware_dependent_packages_using_tasksel__Isenkram_0_7_.html
</link>
121 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Install_hardware_dependent_packages_using_tasksel__Isenkram_0_7_.html
</guid>
122 <pubDate>Wed,
23 Apr
2014 14:
50:
00 +
0200</pubDate>
123 <description><p
>It would be nice if it was easier in Debian to get all the hardware
124 related packages relevant for the computer installed automatically.
125 So I implemented one, using
126 <a href=
"http://packages.qa.debian.org/isenkram
">my Isenkram
127 package
</a
>. To use it, install the tasksel and isenkram packages and
128 run tasksel as user root. You should be presented with a new option,
129 "Hardware specific packages (autodetected by isenkram)
". When you
130 select it, tasksel will install the packages isenkram claim is fit for
131 the current hardware, hot pluggable or not.
<p
>
133 <p
>The implementation is in two files, one is the tasksel menu entry
134 description, and the other is the script used to extract the list of
135 packages to install. The first part is in
136 <tt
>/usr/share/tasksel/descs/isenkram.desc
</tt
> and look like
139 <p
><blockquote
><pre
>
142 Description: Hardware specific packages (autodetected by isenkram)
143 Based on the detected hardware various hardware specific packages are
145 Test-new-install: mark show
147 Packages: for-current-hardware
148 </pre
></blockquote
></p
>
150 <p
>The second part is in
151 <tt
>/usr/lib/tasksel/packages/for-current-hardware
</tt
> and look like
154 <p
><blockquote
><pre
>
159 isenkram-autoinstall-firmware -l
161 </pre
></blockquote
></p
>
163 <p
>All in all, a very short and simple implementation making it
164 trivial to install the hardware dependent package we all may want to
165 have installed on our machines. I
've not been able to find a way to
166 get tasksel to tell you exactly which packages it plan to install
167 before doing the installation. So if you are curious or careful,
168 check the output from the isenkram-* command line tools first.
</p
>
170 <p
>The information about which packages are handling which hardware is
171 fetched either from the isenkram package itself in
172 /usr/share/isenkram/, from git.debian.org or from the APT package
173 database (using the Modaliases header). The APT package database
174 parsing have caused a nasty resource leak in the isenkram daemon (bugs
175 <a href=
"http://bugs.debian.org/
719837">#
719837</a
> and
176 <a href=
"http://bugs.debian.org/
730704">#
730704</a
>). The cause is in
177 the python-apt code (bug
178 <a href=
"http://bugs.debian.org/
745487">#
745487</a
>), but using a
179 workaround I was able to get rid of the file descriptor leak and
180 reduce the memory leak from ~
30 MiB per hardware detection down to
181 around
2 MiB per hardware detection. It should make the desktop
182 daemon a lot more useful. The fix is in version
0.7 uploaded to
183 unstable today.
</p
>
185 <p
>I believe the current way of mapping hardware to packages in
186 Isenkram is is a good draft, but in the future I expect isenkram to
187 use the AppStream data source for this. A proposal for getting proper
188 AppStream support into Debian is floating around as
189 <a href=
"https://wiki.debian.org/DEP-
11">DEP-
11</a
>, and
190 <a href=
"https://wiki.debian.org/SummerOfCode2014/Projects#SummerOfCode2014.2FProjects
.2FAppStreamDEP11Implementation.AppStream
.2FDEP-
11_for_the_Debian_Archive
">GSoC
191 project
</a
> will take place this summer to improve the situation. I
192 look forward to seeing the result, and welcome patches for isenkram to
193 start using the information when it is ready.
</p
>
195 <p
>If you want your package to map to some specific hardware, either
196 add a
"Xb-Modaliases
" header to your control file like I did in
197 <a href=
"http://packages.qa.debian.org/pymissile
">the pymissile
198 package
</a
> or submit a bug report with the details to the isenkram
200 <a href=
"http://people.skolelinux.org/pere/blog/tags/isenkram/
">all my
201 blog posts tagged isenkram
</a
> for details on the notation. I expect
202 the information will be migrated to AppStream eventually, but for the
203 moment I got no better place to store it.
</p
>
208 <title>Automatically locate and install required firmware packages on Debian (Isenkram
0.4)
</title>
209 <link>http://people.skolelinux.org/pere/blog/Automatically_locate_and_install_required_firmware_packages_on_Debian__Isenkram_0_4_.html
</link>
210 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Automatically_locate_and_install_required_firmware_packages_on_Debian__Isenkram_0_4_.html
</guid>
211 <pubDate>Tue,
25 Jun
2013 11:
50:
00 +
0200</pubDate>
212 <description><p
>It annoys me when the computer fail to do automatically what it is
213 perfectly capable of, and I have to do it manually to get things
214 working. One such task is to find out what firmware packages are
215 needed to get the hardware on my computer working. Most often this
216 affect the wifi card, but some times it even affect the RAID
217 controller or the ethernet card. Today I pushed version
0.4 of the
218 <a href=
"http://packages.qa.debian.org/isenkram
">Isenkram package
</a
>
219 including a new script isenkram-autoinstall-firmware handling the
220 process of asking all the loaded kernel modules what firmware files
221 they want, find debian packages providing these files and install the
222 debian packages. Here is a test run on my laptop:
</p
>
225 # isenkram-autoinstall-firmware
226 info: kernel drivers requested extra firmware: ipw2200-bss.fw ipw2200-ibss.fw ipw2200-sniffer.fw
227 info: fetching http://http.debian.net/debian/dists/squeeze/Contents-i386.gz
228 info: locating packages with the requested firmware files
229 info: Updating APT sources after adding non-free APT source
230 info: trying to install firmware-ipw2x00
233 Preconfiguring packages ...
234 Selecting previously deselected package firmware-ipw2x00.
235 (Reading database ...
259727 files and directories currently installed.)
236 Unpacking firmware-ipw2x00 (from .../firmware-ipw2x00_0.28+squeeze1_all.deb) ...
237 Setting up firmware-ipw2x00 (
0.28+squeeze1) ...
239 </pre
></p
>
241 <p
>When all the requested firmware is present, a simple message is
242 printed instead:
</p
>
245 # isenkram-autoinstall-firmware
246 info: did not find any firmware files requested by loaded kernel modules. exiting
248 </pre
></p
>
250 <p
>It could use some polish, but it is already working well and saving
251 me some time when setting up new machines. :)
</p
>
253 <p
>So, how does it work? It look at the set of currently loaded
254 kernel modules, and look up each one of them using modinfo, to find
255 the firmware files listed in the module meta-information. Next, it
256 download the Contents file from a nearby APT mirror, and search for
257 the firmware files in this file to locate the package with the
258 requested firmware file. If the package is in the non-free section, a
259 non-free APT source is added and the package is installed using
260 <tt
>apt-get install
</tt
>. The end result is a slightly better working
263 <p
>I hope someone find time to implement a more polished version of
264 this script as part of the hw-detect debian-installer module, to
265 finally fix
<a href=
"http://bugs.debian.org/
655507">BTS report
266 #
655507</a
>. There really is no need to insert USB sticks with
267 firmware during a PXE install when the packages already are available
268 from the nearby Debian mirror.
</p
>
273 <title>Isenkram
0.2 finally in the Debian archive
</title>
274 <link>http://people.skolelinux.org/pere/blog/Isenkram_0_2_finally_in_the_Debian_archive.html
</link>
275 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Isenkram_0_2_finally_in_the_Debian_archive.html
</guid>
276 <pubDate>Wed,
3 Apr
2013 23:
40:
00 +
0200</pubDate>
277 <description><p
>Today the
<a href=
"http://packages.qa.debian.org/isenkram
">Isenkram
278 package
</a
> finally made it into the archive, after lingering in NEW
279 for many months. I uploaded it to the Debian experimental suite
280 2013-
01-
27, and today it was accepted into the archive.
</p
>
282 <p
>Isenkram is a system for suggesting to users what packages to
283 install to work with a pluggable hardware device. The suggestion pop
284 up when the device is plugged in. For example if a Lego Mindstorm NXT
285 is inserted, it will suggest to install the program needed to program
286 the NXT controller. Give it a go, and report bugs and suggestions to
292 <title>Welcome to the world, Isenkram!
</title>
293 <link>http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
</link>
294 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
</guid>
295 <pubDate>Tue,
22 Jan
2013 22:
00:
00 +
0100</pubDate>
296 <description><p
>Yesterday, I
297 <a href=
"http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
">asked
298 for testers
</a
> for my prototype for making Debian better at handling
299 pluggable hardware devices, which I
300 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">set
301 out to create
</a
> earlier this month. Several valuable testers showed
302 up, and caused me to really want to to open up the development to more
303 people. But before I did this, I want to come up with a sensible name
304 for this project. Today I finally decided on a new name, and I have
305 renamed the project from hw-support-handler to this new name. In the
306 process, I moved the source to git and made it available as a
307 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/isenkram.git
">collab-maint
</a
>
308 repository in Debian. The new name? It is
<strong
>Isenkram
</strong
>.
309 To fetch and build the latest version of the source, use
</p
>
312 git clone http://anonscm.debian.org/git/collab-maint/isenkram.git
313 cd isenkram
&& git-buildpackage -us -uc
316 <p
>I have not yet adjusted all files to use the new name yet. If you
317 want to hack on the source or improve the package, please go ahead.
318 But please talk to me first on IRC or via email before you do major
319 changes, to make sure we do not step on each others toes. :)
</p
>
321 <p
>If you wonder what
'isenkram
' is, it is a Norwegian word for iron
322 stuff, typically meaning tools, nails, screws, etc. Typical hardware
323 stuff, in other words. I
've been told it is the Norwegian variant of
324 the German word eisenkram, for those that are familiar with that
327 <p
><strong
>Update
2013-
01-
26</strong
>: Added -us -us to build
328 instructions, to avoid confusing people with an error from the signing
331 <p
><strong
>Update
2013-
01-
27</strong
>: Switch to HTTP URL for the git
332 clone argument to avoid the need for authentication.
</p
>
337 <title>First prototype ready making hardware easier to use in Debian
</title>
338 <link>http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
</link>
339 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/First_prototype_ready_making_hardware_easier_to_use_in_Debian.html
</guid>
340 <pubDate>Mon,
21 Jan
2013 12:
00:
00 +
0100</pubDate>
341 <description><p
>Early this month I set out to try to
342 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">improve
343 the Debian support for pluggable hardware devices
</a
>. Now my
344 prototype is working, and it is ready for a larger audience. To test
346 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">source
347 from the Debian Edu subversion repository
</a
>, build and install the
348 package. You might have to log out and in again activate the
349 autostart script.
</p
>
351 <p
>The design is simple:
</p
>
355 <li
>Add desktop entry in /usr/share/autostart/ causing a program
356 hw-support-handlerd to start when the user log in.
</li
>
358 <li
>This program listen for kernel events about new hardware (directly
359 from the kernel like udev does), not using HAL dbus events as I
360 initially did.
</li
>
362 <li
>When new hardware is inserted, look up the hardware modalias in
363 the APT database, a database
364 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=markup
">available
365 via HTTP
</a
> and a database available as part of the package.
</li
>
367 <li
>If a package is mapped to the hardware in question, the package
368 isn
't installed yet and this is the first time the hardware was
369 plugged in, show a desktop notification suggesting to install the
370 package or packages.
</li
>
372 <li
>If the user click on the
'install package now
' button, ask
373 aptdaemon via the PackageKit API to install the requrired package.
</li
>
375 <li
>aptdaemon ask for root password or sudo password, and install the
376 package while showing progress information in a window.
</li
>
380 <p
>I still need to come up with a better name for the system. Here
381 are some screen shots showing the prototype in action. First the
382 notification, then the password request, and finally the request to
383 approve all the dependencies. Sorry for the Norwegian Bokmål GUI.
</p
>
385 <p
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
1-notification.png
">
386 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
2-password.png
">
387 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
3-dependencies.png
">
388 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
4-installing.png
">
389 <br
><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
21-hw-support-
5-installing-details.png
" width=
"70%
"></p
>
391 <p
>The prototype still need to be improved with longer timeouts, but
392 is already useful. The database of hardware to package mappings also
393 need more work. It is currently compatible with the Ubuntu way of
394 storing such information in the package control file, but could be
395 changed to use other formats instead or in addition to the current
396 method. I
've dropped the use of discover for this mapping, as the
397 modalias approach is more flexible and easier to use on Linux as long
398 as the Linux kernel expose its modalias strings directly.
</p
>
400 <p
><strong
>Update
2013-
01-
21 16:
50</strong
>: Due to popular demand,
401 here is the command required to check out and build the source: Use
402 '<tt
>svn checkout
403 svn://svn.debian.org/debian-edu/trunk/src/hw-support-handler/; cd
404 hw-support-handler; debuild
</tt
>'. If you lack debuild, install the
405 devscripts package.
</p
>
407 <p
><strong
>Update
2013-
01-
23 12:
00</strong
>: The project is now
408 renamed to Isenkram and the source moved from the Debian Edu
409 subversion repository to a Debian collab-maint git repository. See
410 <a href=
"http://people.skolelinux.org/pere/blog/Welcome_to_the_world__Isenkram_.html
">build
411 instructions
</a
> for details.
</p
>
416 <title>Using modalias info to find packages handling my hardware
</title>
417 <link>http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html
</link>
418 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Using_modalias_info_to_find_packages_handling_my_hardware.html
</guid>
419 <pubDate>Tue,
15 Jan
2013 08:
00:
00 +
0100</pubDate>
420 <description><p
>Yesterday, I wrote about the
421 <a href=
"http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
">modalias
422 values provided by the Linux kernel
</a
> following my hope for
423 <a href=
"http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
">better
424 dongle support in Debian
</a
>. Using this knowledge, I have tested how
425 modalias values attached to package names can be used to map packages
426 to hardware. This allow the system to look up and suggest relevant
427 packages when I plug in some new hardware into my machine, and replace
428 discover and discover-data as the database used to map hardware to
431 <p
>I create a modaliases file with entries like the following,
432 containing package name, kernel module name (if relevant, otherwise
433 the package name) and globs matching the relevant hardware
436 <p
><blockquote
>
437 Package: package-name
438 <br
>Modaliases: module(modaliasglob, modaliasglob, modaliasglob)
</p
>
439 </blockquote
></p
>
441 <p
>It is fairly trivial to write code to find the relevant packages
442 for a given modalias value using this file.
</p
>
444 <p
>An entry like this would suggest the video and picture application
445 cheese for many USB web cameras (interface bus class
0E01):
</p
>
447 <p
><blockquote
>
449 <br
>Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)
</p
>
450 </blockquote
></p
>
452 <p
>An entry like this would suggest the pcmciautils package when a
453 CardBus bridge (bus class
0607) PCI device is present:
</p
>
455 <p
><blockquote
>
457 <br
>Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*)
458 </blockquote
></p
>
460 <p
>An entry like this would suggest the package colorhug-client when
461 plugging in a ColorHug with USB IDs
04D8:F8DA:
</p
>
463 <p
><blockquote
>
464 Package: colorhug-client
465 <br
>Modaliases: colorhug-client(usb:v04D8pF8DAd*)
</p
>
466 </blockquote
></p
>
468 <p
>I believe the format is compatible with the format of the Packages
469 file in the Debian archive. Ubuntu already uses their Packages file
470 to store their mappings from packages to hardware.
</p
>
472 <p
>By adding a XB-Modaliases: header in debian/control, any .deb can
473 announce the hardware it support in a way my prototype understand.
474 This allow those publishing packages in an APT source outside the
475 Debian archive as well as those backporting packages to make sure the
476 hardware mapping are included in the package meta information. I
've
477 tested such header in the pymissile package, and its modalias mapping
478 is working as it should with my prototype. It even made it to Ubuntu
481 <p
>To test if it was possible to look up supported hardware using only
482 the shell tools available in the Debian installer, I wrote a shell
483 implementation of the lookup code. The idea is to create files for
484 each modalias and let the shell do the matching. Please check out and
486 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/hw-support-lookup?view=co
">hw-support-lookup
</a
>
487 shell script. It run without any extra dependencies and fetch the
488 hardware mappings from the Debian archive and the subversion
489 repository where I currently work on my prototype.
</p
>
491 <p
>When I use it on a machine with a yubikey inserted, it suggest to
492 install yubikey-personalization:
</p
>
494 <p
><blockquote
>
495 % ./hw-support-lookup
496 <br
>yubikey-personalization
498 </blockquote
></p
>
500 <p
>When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it
501 propose to install the pcmciautils package:
</p
>
503 <p
><blockquote
>
504 % ./hw-support-lookup
505 <br
>pcmciautils
507 </blockquote
></p
>
509 <p
>If you know of any hardware-package mapping that should be added to
510 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/modaliases?view=co
">my
511 database
</a
>, please tell me about it.
</p
>
513 <p
>It could be possible to generate several of the mappings between
514 packages and hardware. One source would be to look at packages with
515 kernel modules, ie packages with *.ko files in /lib/modules/, and
516 extract their modalias information. Another would be to look at
517 packages with udev rules, ie packages with files in
518 /lib/udev/rules.d/, and extract their vendor/model information to
519 generate a modalias matching rule. I have not tested any of these to
520 see if it work.
</p
>
522 <p
>If you want to help implementing a system to let us propose what
523 packages to install when new hardware is plugged into a Debian
524 machine, please send me an email or talk to me on
525 <a href=
"irc://irc.debian.org/%
23debian-devel
">#debian-devel
</a
>.
</p
>
530 <title>Modalias strings - a practical way to map
"stuff
" to hardware
</title>
531 <link>http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
</link>
532 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Modalias_strings___a_practical_way_to_map__stuff__to_hardware.html
</guid>
533 <pubDate>Mon,
14 Jan
2013 11:
20:
00 +
0100</pubDate>
534 <description><p
>While looking into how to look up Debian packages based on hardware
535 information, to find the packages that support a given piece of
536 hardware, I refreshed my memory regarding modalias values, and decided
537 to document the details. Here are my findings so far, also available
539 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">the
540 Debian Edu subversion repository
</a
>:
542 <p
><strong
>Modalias decoded
</strong
></p
>
544 <p
>This document try to explain what the different types of modalias
545 values stands for. It is in part based on information from
546 &lt;URL:
<a href=
"https://wiki.archlinux.org/index.php/Modalias
">https://wiki.archlinux.org/index.php/Modalias
</a
> &gt;,
547 &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;,
548 &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
549 &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;.
551 <p
>The modalias entries for a given Linux machine can be found using
552 this shell script:
</p
>
555 find /sys -name modalias -print0 | xargs -
0 cat | sort -u
558 <p
>The supported modalias globs for a given kernel module can be found
559 using modinfo:
</p
>
562 % /sbin/modinfo psmouse | grep alias:
563 alias: serio:ty05pr*id*ex*
564 alias: serio:ty01pr*id*ex*
568 <p
><strong
>PCI subtype
</strong
></p
>
570 <p
>A typical PCI entry can look like this. This is an Intel Host
571 Bridge memory controller:
</p
>
573 <p
><blockquote
>
574 pci:v00008086d00002770sv00001028sd000001ADbc06sc00i00
575 </blockquote
></p
>
577 <p
>This represent these values:
</p
>
582 sv
00001028 (subvendor)
583 sd
000001AD (subdevice)
589 <p
>The vendor/device values are the same values outputted from
'lspci
590 -n
' as
8086:
2770. The bus class/subclass is also shown by lspci as
591 0600. The
0600 class is a host bridge. Other useful bus values are
592 0300 (VGA compatible card) and
0200 (Ethernet controller).
</p
>
594 <p
>Not sure how to figure out the interface value, nor what it
597 <p
><strong
>USB subtype
</strong
></p
>
599 <p
>Some typical USB entries can look like this. This is an internal
600 USB hub in a laptop:
</p
>
602 <p
><blockquote
>
603 usb:v1D6Bp0001d0206dc09dsc00dp00ic09isc00ip00
604 </blockquote
></p
>
606 <p
>Here is the values included in this alias:
</p
>
609 v
1D6B (device vendor)
610 p
0001 (device product)
613 dsc
00 (device subclass)
614 dp
00 (device protocol)
615 ic
09 (interface class)
616 isc
00 (interface subclass)
617 ip
00 (interface protocol)
620 <p
>The
0900 device class/subclass means hub. Some times the relevant
621 class is in the interface class section. For a simple USB web camera,
622 these alias entries show up:
</p
>
624 <p
><blockquote
>
625 usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc01ip00
626 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic01isc02ip00
627 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc01ip00
628 <br
>usb:v0AC8p3420d5000dcEFdsc02dp01ic0Eisc02ip00
629 </blockquote
></p
>
631 <p
>Interface class
0E01 is video control,
0E02 is video streaming (aka
632 camera),
0101 is audio control device and
0102 is audio streaming (aka
633 microphone). Thus this is a camera with microphone included.
</p
>
635 <p
><strong
>ACPI subtype
</strong
></p
>
637 <p
>The ACPI type is used for several non-PCI/USB stuff. This is an IR
638 receiver in a Thinkpad X40:
</p
>
640 <p
><blockquote
>
641 acpi:IBM0071:PNP0511:
642 </blockquote
></p
>
644 <p
>The values between the colons are IDs.
</p
>
646 <p
><strong
>DMI subtype
</strong
></p
>
648 <p
>The DMI table contain lots of information about the computer case
649 and model. This is an entry for a IBM Thinkpad X40, fetched from
650 /sys/devices/virtual/dmi/id/modalias:
</p
>
652 <p
><blockquote
>
653 dmi:bvnIBM:bvr1UETB6WW(
1.66):bd06/
15/
2005:svnIBM:pn2371H4G:pvrThinkPadX40:rvnIBM:rn2371H4G:rvrNotAvailable:cvnIBM:ct10:cvrNotAvailable:
654 </blockquote
></p
>
656 <p
>The values present are
</p
>
659 bvn IBM (BIOS vendor)
660 bvr
1UETB
6WW(
1.66) (BIOS version)
661 bd
06/
15/
2005 (BIOS date)
662 svn IBM (system vendor)
663 pn
2371H4G (product name)
664 pvr ThinkPadX40 (product version)
665 rvn IBM (board vendor)
666 rn
2371H4G (board name)
667 rvr NotAvailable (board version)
668 cvn IBM (chassis vendor)
670 cvr NotAvailable (chassis version)
673 <p
>The chassis type
10 is Notebook. Other interesting values can be
674 found in the dmidecode source:
</p
>
678 4 Low Profile Desktop
691 17 Main Server Chassis
694 20 Bus Expansion Chassis
695 21 Peripheral Chassis
697 23 Rack Mount Chassis
706 <p
>The chassis type values are not always accurately set in the DMI
707 table. For example my home server is a tower, but the DMI modalias
708 claim it is a desktop.
</p
>
710 <p
><strong
>SerIO subtype
</strong
></p
>
712 <p
>This type is used for PS/
2 mouse plugs. One example is from my
713 test machine:
</p
>
715 <p
><blockquote
>
716 serio:ty01pr00id00ex00
717 </blockquote
></p
>
719 <p
>The values present are
</p
>
728 <p
>This type is supported by the psmouse driver. I am not sure what
729 the valid values are.
</p
>
731 <p
><strong
>Other subtypes
</strong
></p
>
733 <p
>There are heaps of other modalias subtypes according to
734 file2alias.c. There is the rest of the list from that source: amba,
735 ap, bcma, ccw, css, eisa, hid, i2c, ieee1394, input, ipack, isapnp,
736 mdio, of, parisc, pcmcia, platform, scsi, sdio, spi, ssb, vio, virtio,
737 vmbus, x86cpu and zorro. I did not spend time documenting all of
738 these, as they do not seem relevant for my intended use with mapping
739 hardware to packages when new stuff is inserted during run time.
</p
>
741 <p
><strong
>Looking up kernel modules using modalias values
</strong
></p
>
743 <p
>To check which kernel modules provide support for a given modalias,
744 one can use the following shell script:
</p
>
747 for id in $(find /sys -name modalias -print0 | xargs -
0 cat | sort -u); do \
748 echo
"$id
" ; \
749 /sbin/modprobe --show-depends
"$id
"|sed
's/^/ /
' ; \
753 <p
>The output can look like this (only the first few entries as the
754 list is very long on my test machine):
</p
>
758 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/acpi/ac.ko
760 FATAL: Module acpi:device: not found.
762 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/char/nvram.ko
763 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/leds/led-class.ko
764 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/rfkill/rfkill.ko
765 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/platform/x86/thinkpad_acpi.ko
766 acpi:IBM0071:PNP0511:
767 insmod /lib/modules/
2.6.32-
5-
686/kernel/lib/crc-ccitt.ko
768 insmod /lib/modules/
2.6.32-
5-
686/kernel/net/irda/irda.ko
769 insmod /lib/modules/
2.6.32-
5-
686/kernel/drivers/net/irda/nsc-ircc.ko
773 <p
>If you want to help implementing a system to let us propose what
774 packages to install when new hardware is plugged into a Debian
775 machine, please send me an email or talk to me on
776 <a href=
"irc://irc.debian.org/%
23debian-devel
">#debian-devel
</a
>.
</p
>
778 <p
><strong
>Update
2013-
01-
15:
</strong
> Rewrite
"cat $(find ...)
" to
779 "find ... -print0 | xargs -
0 cat
" to make sure it handle directories
780 in /sys/ with space in them.
</p
>
785 <title>Moved the pymissile Debian packaging to collab-maint
</title>
786 <link>http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html
</link>
787 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Moved_the_pymissile_Debian_packaging_to_collab_maint.html
</guid>
788 <pubDate>Thu,
10 Jan
2013 20:
40:
00 +
0100</pubDate>
789 <description><p
>As part of my investigation on how to improve the support in Debian
790 for hardware dongles, I dug up my old Mark and Spencer USB Rocket
791 Launcher and updated the Debian package
792 <a href=
"http://packages.qa.debian.org/pymissile
">pymissile
</a
> to make
793 sure udev will fix the device permissions when it is plugged in. I
794 also added a
"Modaliases
" header to test it in the Debian archive and
795 hopefully make the package be proposed by jockey in Ubuntu when a user
796 plug in his rocket launcher. In the process I moved the source to a
797 git repository under collab-maint, to make it easier for any DD to
798 contribute.
<a href=
"http://code.google.com/p/pymissile/
">Upstream
</a
>
799 is not very active, but the software still work for me even after five
800 years of relative silence. The new git repository is not listed in
801 the uploaded package yet, because I want to test the other changes a
802 bit more before I upload the new version. If you want to check out
803 the new version with a .desktop file included, visit the
804 <a href=
"http://anonscm.debian.org/gitweb/?p=collab-maint/pymissile.git
">gitweb
805 view
</a
> or use
"<tt
>git clone
806 git://anonscm.debian.org/collab-maint/pymissile.git
</tt
>".
</p
>
811 <title>Lets make hardware dongles easier to use in Debian
</title>
812 <link>http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
</link>
813 <guid isPermaLink=
"true">http://people.skolelinux.org/pere/blog/Lets_make_hardware_dongles_easier_to_use_in_Debian.html
</guid>
814 <pubDate>Wed,
9 Jan
2013 15:
40:
00 +
0100</pubDate>
815 <description><p
>One thing that annoys me with Debian and Linux distributions in
816 general, is that there is a great package management system with the
817 ability to automatically install software packages by downloading them
818 from the distribution mirrors, but no way to get it to automatically
819 install the packages I need to use the hardware I plug into my
820 machine. Even if the package to use it is easily available from the
821 Linux distribution. When I plug in a LEGO Mindstorms NXT, it could
822 suggest to automatically install the python-nxt, nbc and t2n packages
823 I need to talk to it. When I plug in a Yubikey, it could propose the
824 yubikey-personalization package. The information required to do this
825 is available, but no-one have pulled all the pieces together.
</p
>
827 <p
>Some years ago, I proposed to
828 <a href=
"http://lists.debian.org/debian-devel/
2010/
05/msg01206.html
">use
829 the discover subsystem to implement this
</a
>. The idea is fairly
834 <li
>Add a desktop entry in /usr/share/autostart/ pointing to a program
835 starting when a user log in.
</li
>
837 <li
>Set this program up to listen for kernel events emitted when new
838 hardware is inserted into the computer.
</li
>
840 <li
>When new hardware is inserted, look up the hardware ID in a
841 database mapping to packages, and take note of any non-installed
844 <li
>Show a message to the user proposing to install the discovered
845 package, and make it easy to install it.
</li
>
849 <p
>I am not sure what the best way to implement this is, but my
850 initial idea was to use dbus events to discover new hardware, the
851 discover database to find packages and
852 <a href=
"http://www.packagekit.org/
">PackageKit
</a
> to install
855 <p
>Yesterday, I found time to try to implement this idea, and the
856 draft package is now checked into
857 <a href=
"http://anonscm.debian.org/viewvc/debian-edu/trunk/src/hw-support-handler/
">the
858 Debian Edu subversion repository
</a
>. In the process, I updated the
859 <a href=
"http://packages.qa.debian.org/d/discover-data.html
">discover-data
</a
>
860 package to map the USB ids of LEGO Mindstorms and Yubikey devices to
861 the relevant packages in Debian, and uploaded a new version
862 2.2013.01.09 to unstable. I also discovered that the current
863 <a href=
"http://packages.qa.debian.org/d/discover.html
">discover
</a
>
864 package in Debian no longer discovered any USB devices, because
865 /proc/bus/usb/devices is no longer present. I ported it to use
866 libusb as a fall back option to get it working. The fixed package
867 version
2.1.2-
6 is now in experimental (didn
't upload it to unstable
868 because of the freeze).
</p
>
870 <p
>With this prototype in place, I can insert my Yubikey, and get this
871 desktop notification to show up (only once, the first time it is
874 <p align=
"center
"><img src=
"http://people.skolelinux.org/pere/blog/images/
2013-
01-
09-hw-autoinstall.png
"></p
>
876 <p
>For this prototype to be really useful, some way to automatically
877 install the proposed packages by pressing the
"Please install
878 program(s)
" button should to be implemented.
</p
>
880 <p
>If this idea seem useful to you, and you want to help make it
881 happen, please help me update the discover-data database with mappings
882 from hardware to Debian packages. Check if
'discover-pkginstall -l
'
883 list the package you would like to have installed when a given
884 hardware device is inserted into your computer, and report bugs using
885 reportbug if it isn
't. Or, if you know of a better way to provide
886 such mapping, please let me know.
</p
>
888 <p
>This prototype need more work, and there are several questions that
889 should be considered before it is ready for production use. Is dbus
890 the correct way to detect new hardware? At the moment I look for HAL
891 dbus events on the system bus, because that is the events I could see
892 on my Debian Squeeze KDE desktop. Are there better events to use?
893 How should the user be notified? Is the desktop notification
894 mechanism the best option, or should the background daemon raise a
895 popup instead? How should packages be installed? When should they
896 not be installed?
</p
>
898 <p
>If you want to help getting such feature implemented in Debian,
899 please send me an email. :)
</p
>