[PATCH] check ACTION=="add" in pcmcia_socket rules

Colin Watson cjwatson at ubuntu.com
Wed Nov 23 07:04:46 EST 2005


Scott James Remnant pointed out that pcmciautils' udev rules check
ACTION=="add" for SUBSYSTEM=="pcmcia", but not for pcmcia_socket; this
is at variance with hotplug/pcmcia_socket.agent, which only does socket
startup tasks on add actions. I guess removing a PCMCIA socket is going
to be pretty rare, but we might as well bring the hotplug and udev
configuration into sync. The following patch does so; it applies on top
of "[PATCH] make udev rules match SUBSYSTEM rather than setting it".

--- udev/60-pcmcia.rules
+++ udev/60-pcmcia.rules
@@ -16,8 +16,10 @@
 # PCMCIA sockets:
 #
 # modprobe the pcmcia bus module so that 16-bit PCMCIA devices work
-SUBSYSTEM=="pcmcia_socket"      RUN+="/sbin/modprobe pcmcia"
+ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
+		RUN+="/sbin/modprobe pcmcia"
 
 # if this is a PCMCIA socket which needs a resource database,
 # pcmcia-socket-startup sets it up
-SUBSYSTEM=="pcmcia_socket"      RUN+="/lib/udev/pcmcia-socket-startup"
+ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
+		RUN+="/lib/udev/pcmcia-socket-startup"

--- udev/60-pcmcia.rules.static
+++ udev/60-pcmcia.rules.static
@@ -16,8 +16,10 @@
 # PCMCIA sockets:
 #
 # modprobe the pcmcia bus module so that 16-bit PCMCIA devices work
-SUBSYSTEM=="pcmcia_socket"      RUN+="/sbin/modprobe pcmcia"
+ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
+		RUN+="/sbin/modprobe pcmcia"
 
 # if this is a PCMCIA socket which needs a resource database,
 # pcmcia-socket-startup sets it up
-#SUBSYSTEM=="pcmcia_socket"      RUN+="/lib/udev/pcmcia-socket-startup"
+#ACTION=="add", SUBSYSTEM=="pcmcia_socket", \
+#		RUN+="/lib/udev/pcmcia-socket-startup"

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]



More information about the linux-pcmcia mailing list