gvfs: Buh-bye, hal!

July 3, 2009 by martinpitt

In the merciless vendetta for purging hal we now reached another major milestone: gvfs, GNOME’s file system layer which handles USB storage as well as virtual file systems for libgphoto2 cameras, Bluetooth devices, audio CDs, or ftp/sftp/cifs mounts, is now fully ported to libgudev and doesn’t need hal at all any more. These long nights of porting weren’t in vain, after all \o/.

Now I just need to hassle David Zeuthen to apply the patches soon. Of course I couldn’t wait and already uploaded them to Karmic, so please test the hell out of it and let me know about problems.

https://wiki.ubuntu.com/Halsectomy is a little greener once again. :-)

Interrogation with Apport hooks / Qt developer needed

June 8, 2009 by martinpitt

So far, Apport package hooks were limited to collecting data from the local system. However, a lot of debugging recipes and standard bug triage ping pong involves asking the reporter further questions which need reponses from a human. This can range from a very simple information message box “Now, please plug in the camera which is not detected” until a complex decision tree based on the symptoms the user sees.

As discussed at UDS Barcelona, Apport will grow this functionality in Karmic. A first preview is available in my PPA. The GUI looks horrible, but the API for hooks won’t change any more, so you can now begin to develop your interactive hooks.

Example:

import apport.hookutils

def add_info(report, ui):
    apport.hookutils.attach_alsa(report)

    ui.information('Now playing test sound...')

    report['AplayOut'] = apport.hookutils.command_output(['aplay',
            '/usr/share/sounds/question.wav'])

    response = ui.yesno('Did you hear the sound?')
    if response == None: # user cancelled
        raise StopIteration
    report['SoundAudible'] = str(response)

Please see the package-hooks.txt documentation for details.

I implemented all currently existing UI functions (information, yes/no question, file selector, multiple choice dialog) for GTK and CLI, and all except the multiple choice dialog for Qt. Anyone willing to hack on an implementation of ui_question_choice() similar to what the GTK frontend is doing?

Update:I merged Richard Johnson’s branch (thanks!) and uploaded a new package into my PPA. apport-qt is now fully functional.

hal-sectomy continues

June 3, 2009 by martinpitt

The migration away from hal continues. Yesterday I uploaded new udev-extras and hal packages which move the handling of local device access from hal to /lib/udev/rules.d/70-acl.rules. Note that this temporarily breaks device access to old cameras which don’t speak the standard PTP protocol yet (and aren’t mass-storage). Most devices should work fine, though, please let me know if something fails (ubuntu-bug udev-extras).

I started a discussion with upstream about how to migrate the libgphoto bits away from hal to udev rules. It shoulnd’t actually be hard to do, and I’m keen on working on it, but it needs agreement between the libgphoto, udev-extras, and gvfs/KDE upstreams, so some coordination work is in order.

I also created a wiki page of the current migration status. Please edit if I forgot something. If you feel inclined to work on a particular bit, the Linux world will heavily appreciate this! It’s still a major Karmic goal to push the transition as far as possible, to avoid intrusive system changes for Ubuntu 10.04 (which is likely to become an LTS).

Easier testing for Apport bug patterns

May 28, 2009 by martinpitt

This morning I added a test script to the Apport bug patterns.

This finally allows you to reliably test a new bug pattern before you actually
commit/push it. You can invoke it with either a .crash file, or a Launchpad bug
number:


$ ./test-local 122988
Matched bug pattern: https://launchpad.net/bugs/122637
$ ./test-local /var/crash/_bin_bash.1000.crash
No match

DeviceKit update, future handling of Fn key maps

May 8, 2009 by martinpitt

I recently started working on packaging pieces of the new DeviceKit world, which is gradually replacing hal. In particular, DeviceKit-disks and DeviceKit-power are in Karmic now, and gnome-disk-utility and a patches gvfs are in the ubuntu-desktop PPA.

A few days ago I wondered what the replacement of hal-setup-keymap would be. This is the bit that makes your laptop’s magic Fn keys work, such as “brightness up”, “next song”, “WWW browser”. I became quite acquainted with this component in the last six months and committed a fair share of fixes to hal-info for those. A quick discussion revealed that nobody was working on this, so I picked that up and created a tool to convert hal keymap .fdi files to udev rules and keymap files, and an udev-extra git branch with those maps, the udev rules, and a small callout which pokes the maps into the corresponding evdev device whenever an input device gets added.

I tested it on my Dell Latitude D430, and it works just fine. Dell laptops are all alike in terms of Fn keys, but I need testing on other laptops. I’m particularly interested in the Sony and ThinkPad models, which don’t send “magic” keys as high keycodes on
a standard i8042 atkbd, but as low keycodes on a separate input device (30-keymap-module-* in hal-info). Testing on Acer and Fujitsu models is also highly welcome.

For testing, add my PPA and do


$ sudo apt-get install udev-extras
# disable the current hal-info keymaps:
$ sudo rm /usr/share/hal/fdi/*/*/30-keymap-*

Packages are available for Jauny and Karmic.

Then reboot, and check if your magic Fn keys still work. Please send success and failure reports by private mail or as comments here. I’ll fix the issues and send a conclusion back here in a few days. If things don’t work for you, please do


$ sudo true
$ sudo udevadm monitor --udev -e > /tmp/udev.log 2>&1
$ sudo udevadm trigger --subsystem-match=input
$ fg
# press Control-C
$ grep . /sys/class/dmi/id/* 2>/dev/null

Please send the output of the last command, and /tmp/udev.log.

If you need to revert, purge udev-extras again and do sudo apt-get install --reinstall hal-info.

Many thanks in advance!

Update (2009-05-09): I got my kernel.org account now, and testing showed a lot of positive and no negative results. Thank you for all your feedback! I pushed the changes to udev-extras master now.

PostgreSQL 8.4beta1 available for testing

April 18, 2009 by martinpitt

Some days ago, the first public beta of PostgreSQL 8.4 was announced. I uploaded a CVS snapshot to Debian experimental two weeks ago, but it didn’t make it out of NEW yet.

Packaging the actual 8.4 bits was actually pretty easy, just took me half a day to adapt the 8.3 packaging and eventually figuring out how to build the entire documentation from SGML sources with Debian/Ubuntu’s broken docbook-utils.

I spent much more work work on supporting 8.4 in postgresql-common, especially with the new per-database locales, migrating changed postgresql.conf parameters in pg_upgradecluster, and so on. Now almost all of the > 1000 tests pass, so I believe it is pretty solid now.

The only exception is the changed behaviour in verifying the server side’s SSL certificate from the client side. At first I thought it was a bug, and reported it to upstream, but it evolved into a pretty lengthy and interesting discussion about the right defaults for SSL verification. I’ll work on better defaults, and the test suite to pass 100% soon.

I invite you give the beta a good beating. Packages for Ubuntu 8.04 LTS and 9.04 are in my
postgresql PPA. Due to postgresql-common, you can safely run 8.4 in parallel with existing 8.3 instances, test-upgrade your 8.3 ones to 8.4 and compare them, etc.

Feedback appreciated!

Presentations of shell commands

April 5, 2009 by martinpitt

Today I was sitting in the plane from Dresden to San Francisco, and worked on my DKMS demo for the Linux Foundation summit. DKMS is a command line tool for managing device driver packages.

I wondered how to present this. The commands and features I wanted to show are quite complex, and typing all of them during the presentation is too cumbersome. Besides, I’m just a lousy typer when someone else is watching. On the other hand, pasting them into classical slides is too static; I find it much easier to understand something that reveals itself step by step.

So what I needed is to prepare the chain of commands in advance, and then send them through an interactive “step by step” interpreter. A quick apt-cache search did not reveal any readymade solution, thus I hacked together a small script “shellpresent” which does exactly that:

  • a line with a command gets echoed, then it waits for a keypress, then runs the command and waits for another keypress (so that you can explain the output)
  • a comment line starting with # is printed in green, and doesn’t wait for a keypress
  • a blank line clears the screen
  • commands are prepended by a red “$” sign to indicate a command prompt

It now does exactly what I want. Perhaps it is useful for someone else out there as well.

On Jaunty bug fixing…

March 31, 2009 by martinpitt

Yes! I just broke the “200 bugs” mark on the “bugs fixed in Jaunty” list.

/me goes to fix more…

Wanna touch DeviceKit?

March 11, 2009 by martinpitt

Still remember the “hal is dead, long live DeviceKit” buzz? It’s time to finally lay our hands on it.

DeviceKit and DeviceKit-power themselves are available for a while in Jaunty’s universe, but installing them by themselves is pretty boring, of course.

Last Saturday I packaged the new gnome-power-manager 2.25.x which is now devkit-ified and doesn’t use hal any more. It is now available in the ubuntu-desktop PPA. Please try it, break it, and complain over there :-)

It works quite well for me, the only thing I noticed is that it currently seems to break my hibernate hotkey. Still investigating..

eBook industry: Lest we never learn…

March 11, 2009 by martinpitt

I was really looking forward to today.

Today, the Sony PRS-505 eBook reader finally gets sold in Germany. Now, I already have mine since January, but the more exciting fact is that libri.de also announced selling their ebooks in the open epub format standard.

When I bought my first eBook at libri.de in January, I unfortunately only discovered after the buy that you can only read it with the Mobipocket reader. Sure, I bought this great eBook reader device so that I can read eBooks under Windows XP in kvm in this silly Mobipocket reader! (The Sony can’t run arbitrary programs like Mobipocket).

That’s why I was really excited about libri.de finally seeing the light and selling epubs. So off to libri.de, and order Ken Follett’s “Die Tore zur Welt” (”World without End”). But aaaaaaaaaargh! Not only that they use DRM (which, frankly, I expected them to, but after all, .epub has DRM capabilities, and the Sony reader has a serial number), but I’m again faced with a vendor lock-in: I can only download and convert those books with a thing called “Adobe Digital Editions”, which again of course only runs under some Windows versions. I didn’t try whether it works under kvm or wine yet (mobipocket didn’t run under wine, and Sony’s own library software doesn’t even run under kvm).

Goddammit, I just want to give you my credit card number, you give me the epub, I save it to the reader, and I want to be done with it! Pragmatically, if it’s DRMed and I don’t notice it, so be it. But jumping through hoops like that, installing a different library program for every eBook shop out there, and none of them even running on Linux? No, thanks.

But there is hope. It only took the music industry a couple of years before they saw the light and sold mp3s with no strings attached. Let’s see when the eBook industry stops repeating these errors and stops doing a format and vendor lock-in war as well. Then I hope eBooks will really start to soar.

Until then, Gutenberg and a lot of other great internet sites provide enough content for me to read.