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

Tom Gundersen teg at jklm.no
Sun Mar 25 16:01:22 EDT 2012


 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) Always apply blacklisting.

Cc: Dominik Brodowski <linux at dominikbrodowski.net>
Signed-off-by: Tom Gundersen <teg at jklm.no>
---

v2: don't convert modprobe to the builtin kmod. This can be done once
    udev>=176 is more widespread.

 udev/rules-base     |    2 +-
 udev/rules-modprobe |    4 ++--
 udev/rules-start    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/udev/rules-base b/udev/rules-base
index f9c411f..9526d51 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", \
+SUBSYSTEM=="pcmcia_socket", DRIVER!="?*", \
 		RUN+="/sbin/modprobe -b pcmcia"
diff --git a/udev/rules-modprobe b/udev/rules-modprobe
index 7fb03f4..5bb6e89 100644
--- a/udev/rules-modprobe
+++ b/udev/rules-modprobe
@@ -1,3 +1,3 @@
 # modprobe $env{MODALIAS} loads all possibly appropriate modules
-SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
-		RUN+="/sbin/modprobe $env{MODALIAS}"
+SUBSYSTEM=="pcmcia", DRIVER!="?*", ENV{MODALIAS}=="?*", \
+		RUN+="/sbin/modprobe -b $env{MODALIAS}"
diff --git a/udev/rules-start b/udev/rules-start
index b67d35d..3349711 100644
--- a/udev/rules-start
+++ b/udev/rules-start
@@ -1,3 +1,3 @@
 # PCMCIA devices:
 #
-ACTION!="add", GOTO="pcmciautils_end"
+ACTION=="remove", GOTO="pcmciautils_end"
-- 
1.7.9.4




More information about the linux-pcmcia mailing list