Title: sysfs_hotplug_udev_hal_dbus_utopia.notes.txt Subject: sysfs, Hotplug, udev, hal, dbus, and utopia project make hardare just work. -------------------------------------------------------------------------------------------- REFERENCE: http://www.linuxjournal.com/article/7745 -------------------------------------------------------------------------------------------- 2.6 Linux kernel introduced the 'device model' - a new mechanism for handling device drivers, where the kernel builds in-memory tree of supported devices. Sysfs exports the kernel in-memory tree device hierarchy as a filesystem, under /sysfs. One directory lists all buses. For each bus, one directory lists all devices on each bus. Files for a given device can link to the associated module. Sysfs allows user space to see the 'device model' 'in-memory tree' via /sysfs, as the kernel sees it, in real time. Kernel's hotplug notifies 'user space' hotplug when a device is added to or removed from the system. 'User space' hotplug notifies udev. Result is that applications are aware of changes to sysfs in real time. Udev is a user-space implementation of devfs-an automated and dynamic manager of device nodes. udev updates /dev on the fly, as sysfs change. hal - system level daemon that ties together hotplug, sysfs and udev "HAL, originally hardware abstraction layer but now not an abstraction of anything whatsoever." HAL uses project called D-BUS as its communications mechanism. D-Bus has 2 sides: 1. a run-of-the-mill interprocess communication (IPC). 2. a system-wide message bus. Utopia Project - attempts to fill missing layers on top of HAL. Gnome volume manager - offers automagic hardware management on top of HAL. insert a device, and auto-run applicaiton that can see it. -------------------------------------------------------------------------------------------- REFERENCE: http://linux.sys-con.com/read/139426_2.htm -------------------------------------------------------------------------------------------- /etc/udev/rules.d/50-udev.rules contains most of the default rules SYMLINK= defines the link that will be created under /dev KERNEL= defines key GROUP="hal" at end of every rule /etc/udev/rules.d/hal.rules Pop in a Falsh device, and run ls -alF /dev/disk/by-id lrwxrwxrwx 1 root root 9 Jul 23 18:59 ata-HITACHI_DK23AA-12B_796746 -> ../../hda lrwxrwxrwx 1 root root 10 Jul 23 18:59 ata-HITACHI_DK23AA-12B_796746-part1 -> ../../hda1 lrwxrwxrwx 1 root root 10 Jul 23 18:59 ata-HITACHI_DK23AA-12B_796746-part2 -> ../../hda2 lrwxrwxrwx 1 root root 10 Jul 23 18:59 ata-HITACHI_DK23AA-12B_796746-part3 -> ../../hda3 lrwxrwxrwx 1 root root 9 Jul 24 16:04 usb-0930_USB_Flash_Memory_0D60FB50728018F9 -> ../../sdb lrwxrwxrwx 1 root root 10 Jul 24 16:04 usb-0930_USB_Flash_Memory_0D60FB50728018F9-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 9 Jul 24 16:02 usb-Generic_USB_Storage-CFC_0AEC326000001A000 -> ../../sda lrwxrwxrwx 1 root root 10 Jul 24 16:02 usb-Generic_USB_Storage-CFC_0AEC326000001A000-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Jul 24 16:02 usb-Generic_USB_Storage-CFC_0AEC326000001A000-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Jul 24 16:02 usb-Generic_USB_Storage-CFC_0AEC326000001A000-part3 -> ../../sda3 HAL Device Information Files: fdi in /usr/share/hal/fdi and /etc/hal/fdi i.e. /usr/share/hal/fdi/information/10freedesktop/10-usb-card-readers.fdi Directories begin with numbers, Lower number is read first, Last property read will overrides previous. Three directories in /usr/share/hal/fdi/ |- Information: info? |- Policy: set policy |- Preprobe: pre-load conditions. Look in /sys/block for flash media -------------------------------------------------------------------------------------------- REFERENCE: http://www.reactivated.net/writing_udev_rules.html -------------------------------------------------------------------------------------------- Install ivman for autofs mounting of cd and dvd when inserted..