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

Dominik Brodowski linux at dominikbrodowski.net
Sun Mar 25 15:47:53 EDT 2012


On Sun, Mar 25, 2012 at 09:28:06PM +0200, Tom Gundersen wrote:
> 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>.

Thanks. It looks good, but as long as I use a distro which doesn't provide
this feature, I hesitate to merge it...

Best
	Dominik



More information about the linux-pcmcia mailing list