VL-Hot: A Non-polling Alternative To HAL

Posted by caitlyn on Feb 21, 2009 4:26 PM EDT
O'Reilly Broadcast; By Caitlyn Martin
Mail this story
Print this story

VL-Hot, developed for Vector Linux provides an alternative that doesn't require continuous hardware polling. Instead VL-Hot uses udev triggers to pop up the required icons. The Vector Linux developers have VL-Hot working with lightweight window managers like JWM and IceWM provided that the PCMan File Manager is installed. I'm quite surprised that other distributions which aim to be lightweight haven't incorporated VL-Hot.

In most current Linux distributions if you plug in a piece of removable media, anything ranging from a USB memory stick to a removable hard drive to a memory card, an icon pops up on the desktop and/or a file manager window opens. The same thing happens if you insert a CD-ROM or DVD-ROM into a drive. This is accomplished by the HAL (Hardware Abstraction Layer) daemon which continually polls the hardware to determine if anything has been added or removed. Generally this works very well and makes the Linux desktop decidedly more user friendly than it was in the days before HAL.



As is usually the case this additional functionality and friendliness comes with a cost. Continuous querying to check for new or removed hardware consumes CPU cycles and energy. On older, legacy hardware or any system with limited processing power, including the lowest end of today's netbooks, using HAL can actually impact system performance in a noticeable way. On battery operated systems it also translates into somewhat shorter battery life. For those interested in green computing and reducing energy consumption the continuous polling activity by the HAL daemon when no hardware changes take place is simply wasteful.



VL-Hot, developed for Vector Linux, provides an alternative that doesn't require continuous hardware polling. Instead VL-Hot uses udev triggers to pop up the required icons. The Vector Linux developers have VL-Hot working with lightweight window managers like JWM and IceWM provided that the PCMan File Manager is installed. I'm quite surprised that other distributions which aim to be lightweight haven't incorporated VL-Hot.



Limitations in VL-Hot



The approach used by VL-Hot works well for most USB media, Firewire and PCMCIA cards. Unfortunately it doesn't work when no udev trigger (uevent) is issued. For example, there is no uevent when a CD-ROM or DVD-ROM is inserted in a drive so VL-Hot can't detect that action. Vector Linux provides alternative GUI methods to mount or unmount CD and DVD media depending on the desktop environment or window manager used. In Vector Linux 6.0 Standard the default Xfce desktop includes the mount applet in the panel. In Vector Linux 5.9 Light the default JWM window manager configuration has an icon on the desktop to mount a CD/DVD. Both of these require user action; a CD or DVD is not automounted as it would be with HAL.



Another limitation involves devices in place when a system is booted. If you have a device already inserted when a system boots VL-Hot won't detect it since there is no uevent after VL-Hot starts. The user has a choice of mounting manually or removing and reinserting the device. In the 1.x versions (used with Vector Linux 5.9.1 and prior) if a device is inserted when a system is shutdown and the desktop environment is configured to save the session state the icons for a device will still be in place at the next boot even if the device itself is no longer present. This has mostly been corrected in version 2.0.0 but I have noticed that if I have two USB sticks inserted when I shutdown the icon for the second one will still be present at next boot.



Using VL-Hot



vl-hot-icons.jpg
When you insert a device VL-Hot pops up two icons on the desktop. This differs from HAL which uses a single icon. VL-Hot automounts the partition(s) on the device or, if there is no partition table, mounts the device as a whole. The image on the right, taken from the top left of my desktop, shows the icons added after inserting a USB stick, specifically a Lexar JumpDrive. The first icon is used to access the mounted device or partition and the second is used to unmount it. (Click on the image to enlarge it.)



The default mount point is /mnt/vl-hot/vl-hot for the first partition or device and /mnt/vl-hot/vl-hotn for each subsequent mounted partition or device. The second mount would be /mnt/vl-hot/vl-hot1. The base path, /mnt/vl-hot, is configurable through a GUI tool called vl-hot-config or by editing /etc/udev/vl-hot.config. The graphical tool can also be used to change icons, sound, the file manager to be used when the first icon is clicked, and options to be used in the mount command. In addition you can assign a custom name to a device index either in the GUI or by editing /etc/udev/vl-hot-names.conf. Code pages and character sets for FAT and NTFS translations can also be set. Another configurable option is the default behavior: instead of just popping up an icon on the desktop you can have VL-Hot open a file manager window.







While this may sound complex the typical user can safely ignore configuration. Basic usage is insert, click, go. For a more sophisticated user VL-Hot can be configured to behave in whatever way is best for you.



For those considering adding VL-Hot to a distribution other than Vector Linux most of the functionality is accomplished through scripts and configuration files. The graphical configuration utility is written in Gambas so the Gambas runtime environment is a dependency for vl-hot-config.



VL-Hot is currently under very active development. New and improved versions appear regularly with announcements appearing the the Vector Linux forum and/or on the Berlios project page.



Conclusion



VL-Hot is an automounter which provides an alternative to the HAL daemon that provides some but not all of the functionality of HAL without continuously polling hardware. While the result isn't quite as complete as HAL for limited or legacy hardware or those concerned with power consumption it can provide a reasonably elegant solution which consumes relatively few resources.

Full Story

  Nav
» Read more about: Story Type: News Story, Tutorial; Groups: Linux, Slackware

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.