X-Git-Url: https://pere.pagekite.me/gitweb/homepage.git/blobdiff_plain/e33b64b3c7dc92f5352ae3d932b0a47f3a55557b..2184d10a49e945b52b9c64ed88d8ca46fa16c327:/blog/index.html diff --git a/blog/index.html b/blog/index.html index 9ea17bb146..8fdee642ef 100644 --- a/blog/index.html +++ b/blog/index.html @@ -19,6 +19,126 @@ +
+
Using modalias info to find packages handling my hardware
+
15th January 2013
+

Yesterday, I wrote about the +modalias +values provided by the Linux kernel following my hope for +better +dongle support in Debian. Using this knowledge, I have tested how +modalias values attached to package names can be used to map packages +to hardware. This allow the system to look up and suggest relevant +packages when I plug in some new hardware into my machine, and replace +discover and discover-data as the database used to map hardware to +packages.

+ +

I create a modaliases file with entries like the following, +containing package name, kernel module name (if relevant, otherwise +the package name) and globs matching the relevant hardware +modalias.

+ +

+Package: package-name +
Modaliases: module(modaliasglob, modaliasglob, modaliasglob)

+

+ +

It is fairly trivial to write code to find the relevant packages +for a given modalias value using this file.

+ +

An entry like this would suggest the video and picture application +cheese for many USB web cameras (interface bus class 0E01):

+ +

+Package: cheese +
Modaliases: cheese(usb:v*p*d*dc*dsc*dp*ic0Eisc01ip*)

+

+ +

An entry like this would suggest the pcmciautils package when a +CardBus bridge (bus class 0607) PCI device is present:

+ +

+Package: pcmciautils +
Modaliases: pcmciautils(pci:v*d*sv*sd*bc06sc07i*) +

+ +

An entry like this would suggest the package colorhug-client when +plugging in a ColorHug with USB IDs 04D8:F8DA:

+ +

+Package: colorhug-client +
Modaliases: colorhug-client(usb:v04D8pF8DAd*)

+

+ +

I believe the format is compatible with the format of the Packages +file in the Debian archive. Ubuntu already uses their Packages file +to store their mappings from packages to hardware.

+ +

By adding a XB-Modaliases: header in debian/control, any .deb can +announce the hardware it support in a way my prototype understand. +This allow those publishing packages in an APT source outside the +Debian archive as well as those backporting packages to make sure the +hardware mapping are included in the package meta information. I've +tested such header in the pymissile package, and its modalias mapping +is working as it should with my prototype. It even made it to Ubuntu +Raring.

+ +

To test if it was possible to look up supported hardware using only +the shell tools available in the Debian installer, I wrote a shell +implementation of the lookup code. The idea is to create files for +each modalias and let the shell do the matching. Please check out and +try the +hw-support-lookup +shell script. It run without any extra dependencies and fetch the +hardware mappings from the Debian archive and the subversion +repository where I currently work on my prototype.

+ +

When I use it on a machine with a yubikey inserted, it suggest to +install yubikey-personalization:

+ +

+% ./hw-support-lookup +
yubikey-personalization: +
% +

+ +

When I run it on my Thinkpad X40 with a PCMCIA/CardBus slot, it +propose to install the pcmciautils package:

+ +

+% ./hw-support-lookup +
pcmciautils +
% +

+ +

If you know of any hardware-package mapping that should be added to +my +database, please tell me about it.

+ +

It could be possible to generate several of the mappings between +packages and hardware. One source would be to look at packages with +kernel modules, ie packages with *.ko files in /lib/modules/, and +extract their modalias information. Another would be to look at +packages with udev rules, ie packages with files in +/lib/udev/rules.d/, and extract their vendor/model information to +generate a modalias matching rule. I have not tested any of these to +see if it work.

+ +

If you want to help implementing a system to let us propose what +packages to install when new hardware is plugged into a Debian +machine, please send me an email or talk to me on +#debian-devel.

+
+
+ + + Tags: debian, english. + + +
+
+
+
Modalias strings - a practical way to map "stuff" to hardware
14th January 2013
@@ -794,71 +914,6 @@ misforståelse.

-
-
Ledger - double-entry accounting using text based storage format
-
18th December 2012
-

A few days ago I came across -a blog post from Joey -Hess describing ledger and -hledger, a text based system for double-entry accounting. I found it -interesting, as I am involved with several organizations where -accounting is an issue, and I have not really become too friendly with -the different web based systems we use. I find it hard to find what I -look for in the menus and even harder try to get sensible data out of -the systems. Ledger seem different. The accounting data is kept in -text files that can be stored in a version control system, and there - -are at least five -different implementations able to read the format. An example -entry look like this, and is simple enough that it will be trivial to -generate entries based on CVS files fetched from the bank:

- -
-2004-05-27 Book Store
-      Expenses:Books                 $20.00
-      Liabilities:Visa
-
- -

The concept seemed interesting enough for me to check it out and -look for others using it. I found blog posts from -Christine -Spang, -Pete -Keen, -Andrew -Cantino and -Ronald -Ip describing how they use it, as well as a post from -Bradley -M. Kuhn at the Software Freedom Conservancy. All seemed like good -recommendations fitting my need.

- -

The ledger -package is available in Debian Squeeze, while the -hledger -package only is available in Debian Sid. As I use Squeeze, ledger -seemed the best choice to get started.

- -

To get some real data to test on, I wrote a -web scraper for -LODO, the accounting system used by -the NUUG association, and started to -play with the data set. I'm not really deeply into accounting, but I -am able to get a simple balance and accounting status for example -using the "ledger balance" command. But I will have to -gather more experience before I know if the ledger way is a good fit -for the organisations I am involved in.

-
-
- - - Tags: debian edu, english, nuug. - - -
-
-
-

RSS feed