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 <tzafrir.cohen@xorcom.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
Oron Peled 2013-10-15 21:00:17 +03:00 committed by Tzafrir Cohen
parent 6d10525863
commit fb1a2b5572
3 changed files with 18 additions and 0 deletions

View File

@ -85,6 +85,7 @@ MAN_DIR:=$(mandir)/man8
DATA_DIR:=${datadir}/dahdi DATA_DIR:=${datadir}/dahdi
CONFIG_DIR:=$(sysconfdir)/dahdi CONFIG_DIR:=$(sysconfdir)/dahdi
CONFIG_FILE:=$(CONFIG_DIR)/system.conf CONFIG_FILE:=$(CONFIG_DIR)/system.conf
UDEVRULES_DIR:=$(sysconfdir)/udev/rules.d
# Utilities we build with a standard build procedure: # Utilities we build with a standard build procedure:
UTILS = dahdi_tool dahdi_test dahdi_monitor dahdi_speed sethdlc dahdi_cfg \ UTILS = dahdi_tool dahdi_test dahdi_monitor dahdi_speed sethdlc dahdi_cfg \
@ -292,6 +293,8 @@ endif
ifeq (,$(wildcard $(DESTDIR)$(BLACKLIST_FILE))) ifeq (,$(wildcard $(DESTDIR)$(BLACKLIST_FILE)))
$(INSTALL) -D -m 644 blacklist.sample $(DESTDIR)$(BLACKLIST_FILE) $(INSTALL) -D -m 644 blacklist.sample $(DESTDIR)$(BLACKLIST_FILE)
endif endif
$(INSTALL) -d $(DESTDIR)$(UDEVRULES_DIR)
$(INSTALL) -D -m 644 dahdi.rules $(DESTDIR)$(UDEVRULES_DIR)/
ifneq (,$(COPY_NETSCR)) ifneq (,$(COPY_NETSCR))
$(COPY_NETSCR) $(COPY_NETSCR)
endif endif

View File

@ -20,6 +20,8 @@ INSTALL_DATA = $(INSTALL) -m 644
prefix ?= /usr prefix ?= /usr
datadir ?= $(prefix)/share datadir ?= $(prefix)/share
mandir ?= $(datadir)/man mandir ?= $(datadir)/man
sysconfdir ?= $(prefix)/etc
udevrulesdir ?= $(sysconfdir)/udev/rules.d
INSTALL ?= install INSTALL ?= install
INSTALL_DATA = $(INSTALL) -m 644 INSTALL_DATA = $(INSTALL) -m 644
@ -102,6 +104,8 @@ install: all
$(INSTALL) -d $(DESTDIR)$(DATADIR) $(INSTALL) -d $(DESTDIR)$(DATADIR)
$(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/ $(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/
$(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/ $(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/
$(INSTALL) -d $(DESTDIR)$(udevrulesdir)
$(INSTALL_DATA) xpp.rules $(DESTDIR)$(udevrulesdir)/
$(INSTALL) -d $(DESTDIR)$(MANDIR) $(INSTALL) -d $(DESTDIR)$(MANDIR)
$(INSTALL_DATA) $(MAN_INSTALL) $(DESTDIR)$(MANDIR)/ $(INSTALL_DATA) $(MAN_INSTALL) $(DESTDIR)$(MANDIR)/
$(INSTALL) -d $(DESTDIR)$(HOTPLUG_USB_DIR) $(INSTALL) -d $(DESTDIR)$(HOTPLUG_USB_DIR)

11
xpp/xpp.rules Normal file
View File

@ -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}"