menu: added new Keywords tag to .desktop files
[barry.git] / udev / README
blob2773438d3c1115d9edbe1a7388c9e6fed275dbd3
1 10-blackberry.rules
3         These udev rules run bcharge on matching Blackberry devices
4         in order to enable 500mA battery charging mode.
6 99-blackberry-perms.rules
8         These udev rules set the resulting device mode to the
9         group 'plugdev' and mode '0660' so that Barry can access
10         the device without being root.
13 Commentary:
14 -----------
16 Yes, I tried to keep this in one file, but the prevailing winds of Linux
17 keep this very hard to do.
19 When you run 'udevadm monitor --env' (udevmonitor on some systems)
20 you will see UEVENT entries and UDEV entries.  The UEVENT entries
21 represent kernel level events, generated when you plugin your device
22 or remove it.  These kernel events are what udev daemons watch for.
24 Udev then works on these events and generates "events" of its own.
25 The results of these events are displayed in the monitor output
26 as UDEV entries.
28 It seems that the rules in the above rules files only match against
29 the UEVENT kernel events.
31 Therefore, the common idiom of:
33         SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device"
35 is used to select a newly plugged in device.  Unfortunately, it doesn't
36 seem that the /dev/bus/* device node exists yet at this point, since
37 that appears to happen in /etc/udev/rules.d/50-udev.rules, and on some
38 systems, *that* rule depends on SUBSYSTEM=="usb_device" to work.  This is
39 not guaranteed to exist on all systems.
41 Plus, if the kernel event SUBSYSTEM=="usb_device" does exist, it comes
42 after the one above.
44 So we have the following behaviour:
46         SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device" (always happens first)
47         SUBSYSTEM=="usb_device" (sometimes happens, and if so, happens last)
48         /dev/bus/* created (happens based on udev rules, which differ on
49                                 each system)
51 So... for fans of cross-platform behaviour, and fans of the KISS method,
52 this behaviour rules out SUBSYSTEM=="usb_device" as a valid keyword.  And
53 since the /dev/bus/* (or /proc or whatevever) device node does not yet exist
54 at the very beginning of this udev process, that means we have to do the
55 power adjustment and the permissions in two udev steps.
57 And now you know the rest of the story.
59 - Chris
61 Sept 2009