Subject was: Re: [PATCH 4/5] ACPI: WMI: Add sysfs userspace interface On Wednesday 27 August 2008 22:44:49 Matthew Garrett wrote: > On Wed, Aug 27, 2008 at 09:21:54PM +0100, Carlos Corbacho wrote: > > Can we abuse uevent and cram all the GUID's into just one MODALIAS line? > > Looking at the udev rules, I suspect we need one event per GUID. > > > Alternatively, maybe just have the directories numbered 1 to X, and have > > a uevent file under each, since we don't care about trying to abuse sysfs > > to let userspace talk to WMI anymore. > > Yeah, that'd work for me. You should add Kay if you get stuck... Based on Kay's recent description on the linux-acpi list I set up this documentation. IMO it's worth adding, Andi, Kay? Thomas ----- From: Kay Sievers <kay.sievers@xxxxxxxx> Documentation: Add udev.txt based on Kay's short summary Signed-off-by: Thomas Renninger <trenn@xxxxxxx> diff --git a/Documentation/00-INDEX b/Documentation/00-INDEX index 5b5aba4..ce9dd7a 100644 --- a/Documentation/00-INDEX +++ b/Documentation/00-INDEX @@ -361,6 +361,8 @@ time_interpolators.txt - info on time interpolators. tty.txt - guide to the locking policies of the tty layer. +udev.txt + - How autoloading of modules work. uml/ - directory with information about User Mode Linux. unicode.txt diff --git a/Documentation/udev.txt b/Documentation/udev.txt new file mode 100644 index 0000000..ceb0e40 --- /dev/null +++ b/Documentation/udev.txt @@ -0,0 +1,37 @@ +Maintainer of udev: Kay Sievers <kay.sievers@xxxxxxxx> + +Abstract: +This is about getting a specific driver automatically loaded +at boot time via udev. Depending on whether the kernel detects +that the HW, the driver is supporting, is available. + + +Devices, any kind of device, can export a match, based on specific +properties of the subsystem it belongs to. In most cases its the same +property/id that is used inside the kernel, to find a (already loaded) +driver which will bind this device. + +Any unique string, hardware ID's, whatever, are stuffed into a modalias, +prefixed by "<subsystem>:" to be unique. + +PCI and USB are pretty obvious, they just stuff all their hardware ID'S +into a string, in a defined order, and let every device export that value +to userspace by MODALIAS environment key and the "modalias" sysfs file. +Other subsystem may have simple strings to match, they define +themselves. + +Now, the drivers contain "match id tables" which are used by the core +to bind devices to drivers. These tables area made available to +file2alias.c in the module postprocessing, and will end up in the +module file itself. The string is mangled to contain wildcards, so +they can just be fnmatch()'d against the modalias value, which the +devices export. + +The string embedded in the modules are extracted by depmod, and put +into the modules.aliases file in /lib/modules/. Every time modprobe +is called with an alias, it searches through this file and loads all +modules which contained a matching alias string. + +Udev does nothing but stupidly running modprobe for every device which +contains MODALIAS in the event environment, and passes $MODALIAS as +an argument to modprobe. -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html