From fb1a2b557277d1515e5fe020c3d2891060452799 Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Tue, 15 Oct 2013 21:00:17 +0300 Subject: [PATCH] added udev rules and their install target: * 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 Acked-by: Russ Meyerriecks --- Makefile | 3 +++ xpp/Makefile | 4 ++++ xpp/xpp.rules | 11 +++++++++++ 3 files changed, 18 insertions(+) create mode 100644 xpp/xpp.rules diff --git a/Makefile b/Makefile index cbd44a2..d9f9b1a 100644 --- 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 diff --git a/xpp/Makefile b/xpp/Makefile index 8cbfae9..49f7b33 100644 --- a/xpp/Makefile +++ b/xpp/Makefile @@ -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 index 0000000..93f772d --- /dev/null +++ b/xpp/xpp.rules @@ -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}"