HAL is gone

“I’m afraid. I’m afraid, Dave. Dave, my mind is going. I can feel it. I can feel it. My mind is going. There is no question about it. I can feel it. I can feel it. I can feel it. I’m a… fraid.”

[HAL’s shutdown]

I decided to take the Ubuntu 10.04 plunge after waiting a week for any last minute glitches to be fixed. Ubuntu 10.04, dubbed Lucid Lynx brings a number of changes to the distro including the 2.6.32 Kernel a new boot splash mechanism called Plymouth and the removal of HAL, the Hardware Abstraction Layer , not the homicidal Heuristic ALgorithmic computer from 2001: A Space Odyssey.

I was happy enough to move up to the new Kernel, in fact that was one of my primary reasons for the change. The 2.6.32 kernel integrates a small change I submitted to the psmouse driver, so now I would no longer have to patch the driver with every kernel update to have a working touchscreen. This change only affects Panasonic Toughbook CF-72 touchscreens, so only me and a few other people will notice it.

Update Manager did not present me with an upgrade option; perhaps because I have some non-standard repositories on my apt sources list. Instead I edited the list with sed;

sudo sed -i 's/karmic/lucid/g' /etc/apt/sources.list
sudo apt-get udate
sudo apt-get dist-upgrade

On the first reboot the touchscreen worked, but after purging residual config from packages that were no longer installed it stopped working. It wasn’t exactly clear to me what happened, but after investigating I found that it had to be linked to the removal of HAL. Oddly enough the rules in /et/hal/rules.d are still there. In fact, earlier when I booted the live disk and looked in /etc/hal, the rules.d folder was still there which had led me to make the false assumption that HAL was still present.

More pressing than the touchscreen was the failure to resume from suspend. To be fair it comes out of suspend, but the screen is scrambled. A quick look around finds that many people are having this problem with older ATI and Nvidia graphics cards, usually because a framebuffer conflict with closed source manufacturer supplied drivers. Even though I use the open source radeon driver I had the same framebuffer conflict. The problem was easily fixed by switching to the uvesafb framebuffer.

First install v86d which is necessary for uvesafb

sudo apt-get install v86d

Next blacklist the default radeondrmfb framebuffer;

sudo bash -c "echo 'blacklist radeondrmfb' >> /etc/modprobe.d/blacklist-framebuffer.conf"

and change  this line in /etc/default/grub;

GRUB_CMDLINE_LINUX="quiet splash"

it should read (all one line);

GRUB_CMDLINE_LINUX="quiet splash nomodeset
video=uvesafb:mode_option=1024x768-24,mtrr=3,scroll=ywrap"

Then edit /etc/initramfs-tools/modules to include uvesafb like this (all one line; notice the escape);

sudo bash -c "echo 'uvesafb mode_option=1366x768-24 mtrr=3 scroll=ywrap'\
 >> /etc/initramfs-tools/modules"

Next Force the Plymouth splash to use the framebuffer;

sudo bash -c "echo FRAMEBUFFER=y >> /etc/initramfs-tools/conf.d/splash"

Lastly update grub and the boot image;

sudo update-grub
sudo update-initramfs -u

With suspend working again, I turned my attention to the touchscreen. The original move to HAL from xorg.conf occurred as most device configuration was automated through various mechanisms. HAL was not well liked and seen as a bit of a kludge; it was the best that could be done at the time. However due the HAL code becoming increasingly unmaintainable, there has been a move to deprecate it and move on resulting in its exclusion from the current Ubuntu distribution.

According to wiki.ubuntu.com the xorg input configuration tasks are to be moved to udev. I have written a few udev rules, but quite frankly I have found the syntax even more complex than HAL xml files (which were pretty simple actually). A little crash course was in order, between this document and the udev man page I thought I had a rule that would work. It didn’t work.

Despite what has been posted at wiki.ubuntu.com the current official method is to use either xorg.conf or device specific snippets in separate files placed in /etc/xorg.conf.d/(e.g. /etc/xorg.conf.d/10-synaptics.con containing touchpad configuration). By separating the the machine/device specific configurations into separate files in xorg.conf.d the configuration files will be more machine editable, which has always been one of the big complaints about xorg.conf and one of the few things that HAL had going for it. If you use xorg snippets you need to make several to cover all your inputs, I tried just one for the touchscreen and ended up with a functioning touchscreen and nothing else. Acording to this blog post you should be able to combine a general purpose xorg.conf with snippets, but I never had any luck with that. What did work for me was making three snippets;
for the touchscreen

# /etc/xorg.conf.d/90-touchscreen.conf
Section "InputDevice"
        Identifier      "Fujitsu TouchScreen"
        Driver          "evtouch"
        Option          "Device" "/dev/input/event6"
        Option          "DeviceName" "touchscreen"
        Option          "MinX" "230"
        Option          "MinY" "220"
        Option          "MaxX" "3900"
        Option          "MaxY" "3850"
        Option          "MoveLimit" "5"
        Option          "ReportingMode" "Raw"
        Option          "SendCoreEvents" "true"
        Option          "Emulate3Buttons" "true"
        Option          "Emulate3Timeout" "40"
        Option          "AutoServerLayout" "on"
EndSection

the keyboard

# /etc/xorg.conf.d/97-keyboard.conf
Section "InputDevice"
        Identifier      "Default Keyboard"
        Driver          "kbd"
        Option          "AutoServerLayout" "on"
EndSection

and the evdev catchall

# /etc/xorg.conf.d/99-evdev.conf
Section "InputClass"
        Identifier      "evdev-catchall"
        Driver          "evdev"
EndSection
sudo
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s