[PATCH] udev: behave like 80-drivers.rules

Tom Gundersen teg at jklm.no
Sun Mar 25 15:28:06 EDT 2012


On Sun, Mar 25, 2012 at 8:55 PM, Dominik Brodowski
<linux at dominikbrodowski.net> wrote:
> On Wed, Mar 14, 2012 at 06:12:25PM +0100, Tom Gundersen wrote:
>>  1) Apply the rules also to 'change' events. This should do no harm
>>     and makes sure that the rules are run whenever the 80-drivers.rules
>>     are.
>>  2) Don't try to load modules when a driver is already loaded.
>>  3) Use builtins for loading modules. Notice that this means that
>>     blacklisting is applied (I assume the lack of '-b' was a bug?).
>>
>> Cc: Dominik Brodowski <linux at dominikbrodowski.net>
>> Signed-off-by: Tom Gundersen <teg at jklm.no>
>> ---
>>  udev/rules-base     |    4 ++--
>>  udev/rules-modprobe |    4 ++--
>>  udev/rules-start    |    2 +-
>>  3 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/udev/rules-base b/udev/rules-base
>> index f9c411f..34a5b9f 100644
>> --- a/udev/rules-base
>> +++ b/udev/rules-base
>> @@ -13,5 +13,5 @@ SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", ATTR{allow_func_id_match}="1"
>>  # PCMCIA sockets:
>>  #
>>  # modprobe the pcmcia bus module so that 16-bit PCMCIA devices work
>> -SUBSYSTEM=="pcmcia_socket", \
>> -             RUN+="/sbin/modprobe -b pcmcia"
>> +SUBSYSTEM=="pcmcia_socket", DRIVER!="?*", \
>> +             IMPORT{builtin}="kmod load $env{MODALIAS}"
>
> What udev version does this require? I can't find anything like that on my
> system, which seems to use udev-173...
>
> Best,
>        Dominik

Sorry, should have pointed this out. kmod was introduced in udev-176.
For an example of the use, see
<http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=rules/80-drivers.rules;h=38ebfeb0e6145754cf90a9efc4da4b5277339263;hb=HEAD>.

Cheers,

Tom



More information about the linux-pcmcia mailing list