summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2008-07-11 16:19:06 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2008-07-11 17:53:40 +0200
commitaa82d4498f604252940ec9f645ed49b47788fb25 (patch)
tree110c8829299da72ef7fdd0d02c49b7ab51d98666
parent601ee84e23aaf9b36131effd8dba7d74ba8526d7 (diff)
downloadpcmciautils-aa82d4498f604252940ec9f645ed49b47788fb25.tar.gz
use label to make udev rules more concise
Rather than checking ACTION=="add" over and over again in the udev rules, it would be simpler and more efficient to check once at the top and jump past the add-only rules if ACTION!="add". Signed-off-by: Colin Watson <cjwatson@debian.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--Makefile1
-rw-r--r--udev/rules-base10
-rw-r--r--udev/rules-end2
-rw-r--r--udev/rules-modprobe2
-rw-r--r--udev/rules-nonstaticsocket4
-rw-r--r--udev/rules-start1
6 files changed, 12 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index c46d339..d275af0 100644
--- a/Makefile
+++ b/Makefile
@@ -203,6 +203,7 @@ UDEV_RULES = udev/rules-start udev/rules-modprobe udev/rules-base
ifneq ($(strip $(STARTUP)),false)
UDEV_RULES += udev/rules-nonstaticsocket
endif
+UDEV_RULES += udev/rules-end
all: ccdv $(PCCARDCTL) $(PCMCIA_CHECK_BROKEN_CIS) $(PCMCIA_SOCKET_STARTUP_BUILD) udevrules
diff --git a/udev/rules-base b/udev/rules-base
index 9bad261..0227cef 100644
--- a/udev/rules-base
+++ b/udev/rules-base
@@ -3,15 +3,15 @@
# are so broken that we need to read out random bytes of it
# instead of the manufactor, card or product ID. Then the
# matching is done in userspace.
-ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
- RUN+="/sbin/pcmcia-check-broken-cis"
+SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
+ RUN+="/lib/udev/pcmcia-check-broken-cis"
# However, the "weak" matching by func_id is only allowed _after_ modprobe
# returns, so that "strong" matches have a higher priority.
-ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", ATTR{allow_func_id_match}="1"
+SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", ATTR{allow_func_id_match}="1"
# PCMCIA sockets:
#
# modprobe the pcmcia bus module so that 16-bit PCMCIA devices work
-ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
- RUN+="/sbin/modprobe pcmcia"
+SUBSYSTEM=="pcmcia_socket", \
+ RUN+="/sbin/modprobe -b pcmcia"
diff --git a/udev/rules-end b/udev/rules-end
new file mode 100644
index 0000000..2b5ae20
--- /dev/null
+++ b/udev/rules-end
@@ -0,0 +1,2 @@
+
+LABEL="pcmciautils_end"
diff --git a/udev/rules-modprobe b/udev/rules-modprobe
index a13b2ad..7fb03f4 100644
--- a/udev/rules-modprobe
+++ b/udev/rules-modprobe
@@ -1,3 +1,3 @@
# modprobe $env{MODALIAS} loads all possibly appropriate modules
-ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
+SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \
RUN+="/sbin/modprobe $env{MODALIAS}"
diff --git a/udev/rules-nonstaticsocket b/udev/rules-nonstaticsocket
index 23b599e..8b8e1c2 100644
--- a/udev/rules-nonstaticsocket
+++ b/udev/rules-nonstaticsocket
@@ -1,5 +1,5 @@
# if this is a PCMCIA socket which needs a resource database,
# pcmcia-socket-startup sets it up
-ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
- RUN+="/sbin/pcmcia-socket-startup"
+SUBSYSTEM=="pcmcia_socket", \
+ RUN+="/lib/udev/pcmcia-socket-startup"
diff --git a/udev/rules-start b/udev/rules-start
index 790902b..b67d35d 100644
--- a/udev/rules-start
+++ b/udev/rules-start
@@ -1,2 +1,3 @@
# PCMCIA devices:
#
+ACTION!="add", GOTO="pcmciautils_end"