On 5/22/06, Warren Wilder <[EMAIL PROTECTED]> wrote:
I've noticed that a lot of emails about DBUS and HAL are passing by lately. (Currrently I have udev as well as hotplug working for me.) I picked up that HAL and DBUS are great for detecting hotpluggable media, creating a desktop icon, mounting them as the device that they are and such. Basically great stuff. But are these two technologies actually going to replace the udev and hotplug cooperation, or at least hotplug?
They all work together, actually. * Udev and hotplug work at a low level. Udev listens for events created by the kernel when new hardware is added. Then it creates nodes, loads drivers, etc. Hotplug was needed to do this on the fly, but now udev can do this all by itself. So, hotplug is obsolete. * D-BUS actually has nothing to do with devices. What it provides is a standard messaging bus for applications to talk to each other over. Where as previous way for two applications to talk would be to open a socket or create temporary files that are polled by each other, D-BUS provides a much cleaner solution. Any application can listen on the message bus for the types of messages it wants, or generate messages for other applications. HAL makes heavy use of this. * HAL abstracts the information about hardware from the udev and kernel level (/dev/sda1, /sys/class/...) and provides a simple, standard notation. For instance, CD and DVD drives are listed in the HAL database with the key storage.drive_type="cdrom". This makes it really easy for other applications using D-BUS to use hardware. They can talk to HAL and find out what properties the hardware can be used in a really simple ways. HAL also provides some scripts for using the hardware and exports these as methods. This allows programs like gnome-volume-manager and gnome-mount to mount new devices in a very agnostic way. When a mountable device is inserted like a USB stick, they tell HAL through D-BUS to mount it. HAL exports other nifty information about the device. For instance if I plug in my digital camera, HAL detects the kind of memory card I have, and eventually it shows up in my application as a Compact Flash icon with Canon ... text. HAL requires udev in that udev tells it about generated hardware events (uevents) through one udev rule: # pass all events to the HAL daemon RUN+="socket:/org/freedesktop/hal/udev_event" So, they're all necessary to play at the desktop level. D-BUS and HAL will become more necessary as more applications drop their hardware tricks and just use these standard interfaces. Udev is already indispensable in my opinion. -- Dan -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page