[backfire] backport r26808 and r26848
[openwrt-10.03/.git] / package / base-files / files / etc / hotplug2-common.rules
index 6bc53dffe85f5cd9e198fcf2ed992d33a9f0ac46..7f7c081a426d064dbd8c4b175ae20c61956c61ee 100644 (file)
@@ -1,5 +1,5 @@
 
-DEVICENAME ~~ (null|full|ptmx|tty|zero|gpio|hvc) {
+DEVICENAME ~~ (null|full|ptmx|zero|gpio|hvc) {
        nothrottle
        makedev /dev/%DEVICENAME% 0666
        next
@@ -8,13 +8,6 @@ DEVICENAME ~~ (null|full|ptmx|tty|zero|gpio|hvc) {
 DEVICENAME ~~ (tun|tap[0-9]) {
        nothrottle
        makedev /dev/net/%DEVICENAME% 0644
-       next
-}
-
-DEVICENAME ~~ (ppp) {
-       nothrottle
-       makedev /dev/%DEVICENAME% 0600
-       next
 }
 
 DEVICENAME ~~ (controlC[0-9]|pcmC0D0*|timer) {
@@ -35,18 +28,30 @@ DEVPATH is set, SUBSYSTEM ~~ (input) {
 }
 
 DEVICENAME == device-mapper {
-       nothrottle
-       makedev /dev/mapper/control 0600
+       nothrottle
+       makedev /dev/mapper/control 0600
+       next
 }
 
-
-DEVPATH is set {
+ACTION == add, DEVPATH is set {
        nothrottle
        makedev /dev/%DEVICENAME% 0644
 }
 
-FIRMWARE is set {
+ACTION == add, DEVPATH is set, DEVICENAME ~~ ^tty {
+       chmod 0666 /dev/%DEVICENAME%
+}
+
+ACTION == add, DEVPATH is set, DEVICENAME ~~ ^ppp {
+       chmod 0600 /dev/%DEVICENAME%
+}
+
+ACTION == remove, DEVPATH is set, MAJOR is set, MINOR is set {
+       remove /dev/%DEVICENAME%
+}
+
+FIRMWARE is set, ACTION == add {
        nothrottle
-       exec /sbin/hotplug-call firmware
+       load-firmware /lib/firmware
        next
 }