added udev rules and their install target:
authorOron Peled <oron.peled@xorcom.com>
Tue, 15 Oct 2013 18:00:17 +0000 (21:00 +0300)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Sun, 24 Nov 2013 14:16:33 +0000 (16:16 +0200)
* Added missing Makefile install rule for dahdi.rules
* Pulled xpp.rules from dahdi-linux and added install rules for it

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>

Makefile
xpp/Makefile
xpp/xpp.rules [new file with mode: 0644]

index cbd44a2..d9f9b1a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -85,6 +85,7 @@ MAN_DIR:=$(mandir)/man8
 DATA_DIR:=${datadir}/dahdi
 CONFIG_DIR:=$(sysconfdir)/dahdi
 CONFIG_FILE:=$(CONFIG_DIR)/system.conf
+UDEVRULES_DIR:=$(sysconfdir)/udev/rules.d
 
 # Utilities we build with a standard build procedure:
 UTILS          = dahdi_tool dahdi_test dahdi_monitor dahdi_speed sethdlc dahdi_cfg \
@@ -292,6 +293,8 @@ endif
 ifeq (,$(wildcard $(DESTDIR)$(BLACKLIST_FILE)))
        $(INSTALL) -D -m 644 blacklist.sample $(DESTDIR)$(BLACKLIST_FILE)
 endif
+       $(INSTALL) -d $(DESTDIR)$(UDEVRULES_DIR)
+       $(INSTALL) -D -m 644 dahdi.rules $(DESTDIR)$(UDEVRULES_DIR)/
 ifneq (,$(COPY_NETSCR))
        $(COPY_NETSCR)
 endif
index 8cbfae9..49f7b33 100644 (file)
@@ -20,6 +20,8 @@ INSTALL_DATA  = $(INSTALL) -m 644
 prefix         ?= /usr
 datadir                ?= $(prefix)/share
 mandir         ?= $(datadir)/man
+sysconfdir     ?= $(prefix)/etc
+udevrulesdir   ?= $(sysconfdir)/udev/rules.d
 INSTALL                ?= install
 
 INSTALL_DATA   = $(INSTALL) -m 644
@@ -102,6 +104,8 @@ install: all
        $(INSTALL) -d $(DESTDIR)$(DATADIR)
        $(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/
        $(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/
+       $(INSTALL) -d $(DESTDIR)$(udevrulesdir)
+       $(INSTALL_DATA) xpp.rules $(DESTDIR)$(udevrulesdir)/
        $(INSTALL) -d $(DESTDIR)$(MANDIR)
        $(INSTALL_DATA) $(MAN_INSTALL) $(DESTDIR)$(MANDIR)/
        $(INSTALL) -d $(DESTDIR)$(HOTPLUG_USB_DIR)
diff --git a/xpp/xpp.rules b/xpp/xpp.rules
new file mode 100644 (file)
index 0000000..93f772d
--- /dev/null
@@ -0,0 +1,11 @@
+# Load firmware into the Xorcom Astribank device:
+SUBSYSTEM=="usb", ACTION=="add", \
+ENV{PRODUCT}=="e4e4/11[3456][013]/*", ENV{DEVTYPE}!="usb_interface", \
+       RUN+="/usr/share/dahdi/xpp_fxloader udev $env{PRODUCT}"
+
+# Hotplug hook for Astribank up/down
+# If you need this functionality, copy the astribank_hook.sample
+# to $XPP_INIT_DIR/astribank_hook
+#
+# By default XPP_INIT_DIR="/usr/share/dahdi"
+KERNEL=="xbus*", RUN+="%E{XPP_INIT_DIR}/astribank_hook udev $kernel $sysfs{status} $sysfs{connector}"